[Cs:s] Effects showing certain user
Posted: Sun Jul 25, 2021 6:28 pm
Hi guys i have a issue of my code when i try make show effect for certain users.
When in rpg set effects to off, it works fine that doesn't show effects when is alone, but when other player is and have effects on, i still see the effects even suppose not.
Here is the effect code
RPG effect:
Here is getUseridList() defined:
When in rpg set effects to off, it works fine that doesn't show effects when is alone, but when other player is and have effects on, i still see the effects even suppose not.
Here is the effect code
Syntax: Select all
def beam(users, _start, _end, lifeTime, startWidth, endWidth, amplitude, r, g, b, a=255, vmt='sprites/laserbeam.vmt'):
modelIndex = engine_server.precache_model(vmt)
tempEnt = TempEntity('BeamPoints')
tempEnt.red = r
tempEnt.green = g
tempEnt.blue = b
tempEnt.alpha = a
tempEnt.start_point = _start
tempEnt.end_point = _end
tempEnt.life_time = lifeTime
tempEnt.start_width = startWidth
tempEnt.end_width = endWidth
tempEnt.amplitude = amplitude
tempEnt.halo_index = modelIndex
tempEnt.model_index = modelIndex
tempEnt.create(RecipientFilter(*users))
beam(rpg.getEffectUsers(), _start, _end, 0.2, 30, 1, 2, color[0], color[1], color[2], 255, 'sprites/laser.vmt')
RPG effect:
Syntax: Select all
def getEffectUsers():
return filter(lambda x: not rpglib.is_bot(x) and players[x]['effects'] == 1, rpglib.getUseridList())
Here is getUseridList() defined:
Syntax: Select all
def getUseridList():
for i in PlayerIter.iterator():
yield i.userid