Advertisement
Guest User

ugh

a guest
Nov 23rd, 2014
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1.  
  2. --Death
  3.  
  4. maxdeathtime = 10;
  5.  
  6. function Death(ply)
  7. ply.deathtime = 0
  8. ply.nextsecond = CurTime() + 1
  9. ply.deathTimeLeft = maxdeathtime
  10. umsg.Start("gms_updaterespawntimer", ply)
  11. umsg.Short( ply.deathTimeLeft )
  12. umsg.End()
  13. umsg.Start("gms_startrespawntimer", ply)
  14. umsg.End()
  15. ply.NextSpawnTime = CurTime() + 400
  16. ply:ConCommand( "gms_dropall" )
  17. if ply.AFK == true then
  18. ply:Freeze(false)
  19. ply.AFK = false
  20. umsg.Start("gms_stopafk",ply)
  21. umsg.End()
  22. end
  23. end
  24. hook.Add( "PlayerDeath", "Death", Death )
  25.  
  26. function GM:PlayerDeathThink( ply )
  27. if (CurTime()>ply.nextsecond) then --If the current time has execeeded our next second add time
  28. if (ply.deathtime < maxdeathtime) then --If the number of seconds dead less than our max death time
  29. ply.deathtime = ply.deathtime + 1; --add one to the number of seconds dead
  30. ply.nextsecond = CurTime()+1; --set our next death second add time
  31. ply.deathTimeLeft = maxdeathtime - ply.deathtime
  32. umsg.Start("gms_updaterespawntimer", ply)
  33. umsg.Short( ply.deathTimeLeft )
  34. umsg.End()
  35. else --Otherwise
  36. ply.deathtime = nil; --erase our deathtime variable by seting to nil
  37. ply.nextsecond = nil; --erase our new add time storage by seting to nil
  38. umsg.Start("gms_stoprespawntimer", ply)
  39. umsg.End()
  40. ply:Spawn() --tell the player to spawn
  41. end
  42. end
  43. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement