def player_death(event_var):
# Check to see if the round is active
if not roundInfo.active:
return
# Get userid and attacker userids
userid = int(event_var['userid'])
attacker = int(event_var['attacker'])
ggVictim = Player(userid)
# Was suicide?
if userid == attacker or attacker == 0:
gamethread.delayed(10, respawnPlayer, (userid, roundInfo.round))
ggVictim.msg('SuicideAutoRespawn', prefix=True)
# Was a teamkill?
elif event_var['es_userteam'] == event_var['es_attackerteam']:
gamethread.delayed(0.1, respawnPlayer, (userid, roundInfo.round))
ggVictim.msg('TeamKillAutoRespawn', prefix=True)
# Was a normal death
else:
ggAttacker = Player(attacker)
# Add victim to the attackers eliminated players
ggAttacker.eliminated.append(userid)
# Tell them they will respawn when their attacker dies
index = ggAttacker.index
ggVictim.saytext2(index, 'RespawnWhenAttackerDies',
{'attacker': event_var['es_attackername']}, True)
# Check if victim had any Eliminated players
gamethread.delayed(1.1, respawnEliminated, (userid, roundInfo.round))
Is there a way you can add a script in which detects players alive, and stops the re-spawn scripts.
So say that if there are only two living people the respawn script will stop.(Until round_start)
This would allow for knife fights and the suck on elim servers.
I dont know how you would wanna do it but maybe this sscenario will help.
"Three people left alive two T one CT. (Kris, Kyle (t), and Bret).
Kyle has killed 2 other people on brets team, and kris 1.
If Bret killed either would we want the script to stop (Can you make it an opion)."
I gave myself a try at this (Not being great @ Python) and had a hard time figureing out how to grab the respawn script.
Maybe if you made the re-spawn times cvar's you could relay this to a custom script in hich someone else could make not not have to make it a build in one.
Just thought about this i might see what i can do with deathmatch since it dose have re-spawn cvar.