shadowndacorner

Clientside Portion of Rounds System

Jan 6th, 2013
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.84 KB | None | 0 0
  1. GAMEMODE.Rounds={}
  2. GAMEMODE.Rounds.CurRound=0
  3. GAMEMODE.Rounds.TimeStarted=CurTime() or 0
  4. GAMEMODE.Rounds.TimeToEnd=-1
  5. GAMEMODE.Rounds.Waiting=false
  6.  
  7. function GetCurrentRound()
  8.     return GAMEMODE.Rounds.CurRound
  9. end
  10.  
  11. function GetRoundStartTime()
  12.     return GAMEMODE.Rounds.TimeStarted
  13. end
  14.  
  15. function GetRoundEndTime()
  16.     if !(GAMEMODE.Rounds.TimeToEnd==-1) then
  17.         return GAMEMODE.Rounds.TimeToEnd
  18.     end
  19. end
  20.  
  21. usermessage.Hook("roundData", function(data)
  22.     GAMEMODE.Rounds.CurRound=data:ReadLong() or GAMEMODE.Rounds.CurRound
  23.     GAMEMODE.Rounds.TimeStarted=data:ReadLong() or GAMEMODE.Rounds.TimeStarted
  24.     GAMEMODE.Rounds.TimeToEnd=data:ReadLong() or GAMEMODE.Rounds.TimeToEnd
  25. end)
  26.  
  27. usermessage.Hook("roundWaiting", function(data)
  28.     GAMEMODE.Rounds.Waiting=data:ReadBool()
  29.     GAMEMODE.Rounds.TimeStarted=data:ReadLong() or GAMEMODE.Rounds.TimeStarted
  30. end)
Advertisement
Add Comment
Please, Sign In to add comment