Advertisement
Guest User

Untitled

a guest
Aug 27th, 2014
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. Config = {
  2. plypertimeadd = 5, -- Per player
  3. fiveplytimemin = 5, --default time to start at
  4. addtime = 1 --Added after amount of "per player" is reached
  5. }
  6.  
  7. function ChangeRoundTime()
  8. PlayersTab = player.GetAll()
  9. AlivePlayers = {}
  10. for k,v in pairs(PlayersTab) do
  11. if v:Alive() then
  12. table.insert(AlivePlayers, table.Count(AlivePlayers) + 1, v)
  13. end
  14. end
  15.  
  16. timer.Create("SetTime", GetConVarNumber("ttt_preptime_seconds") - 2, 1, function()
  17. RunConsoleCommand("ttt_roundtime_minutes", Config.fiveplytimemin + (math.floor((math.floor(table.Count(AlivePlayers) / Config.plypertimeadd) * Config.plypertimeadd) / Config.plypertimeadd)) * Config.addtime)
  18. table.Empty(AlivePlayers)
  19. end)
  20. end
  21. hook.Add("TTTPrepareRound", "SetRoundTime", ChangeRoundTime)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement