Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Death
- maxdeathtime = 10;
- function Death(ply)
- ply.deathtime = 0
- ply.nextsecond = CurTime() + 1
- ply.deathTimeLeft = maxdeathtime
- umsg.Start("gms_updaterespawntimer", ply)
- umsg.Short( ply.deathTimeLeft )
- umsg.End()
- umsg.Start("gms_startrespawntimer", ply)
- umsg.End()
- ply.NextSpawnTime = CurTime() + 400
- ply:ConCommand( "gms_dropall" )
- if ply.AFK == true then
- ply:Freeze(false)
- ply.AFK = false
- umsg.Start("gms_stopafk",ply)
- umsg.End()
- end
- end
- hook.Add( "PlayerDeath", "Death", Death )
- function GM:PlayerDeathThink( ply )
- if (CurTime()>ply.nextsecond) then --If the current time has execeeded our next second add time
- if (ply.deathtime < maxdeathtime) then --If the number of seconds dead less than our max death time
- ply.deathtime = ply.deathtime + 1; --add one to the number of seconds dead
- ply.nextsecond = CurTime()+1; --set our next death second add time
- ply.deathTimeLeft = maxdeathtime - ply.deathtime
- umsg.Start("gms_updaterespawntimer", ply)
- umsg.Short( ply.deathTimeLeft )
- umsg.End()
- else --Otherwise
- ply.deathtime = nil; --erase our deathtime variable by seting to nil
- ply.nextsecond = nil; --erase our new add time storage by seting to nil
- umsg.Start("gms_stoprespawntimer", ply)
- umsg.End()
- ply:Spawn() --tell the player to spawn
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement