Advertisement
Guest User

Untitled

a guest
Mar 14th, 2015
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.98 KB | None | 0 0
  1.  
  2. GM.RoundStage = 0
  3. GM.LootCollected = 0
  4. GM.RoundSettings = {}
  5. if GAMEMODE then
  6.     GM.RoundStage = GAMEMODE.RoundStage
  7.     GM.LootCollected = GAMEMODE.LootCollected
  8.     GM.RoundSettings = GAMEMODE.RoundSettings
  9. end
  10.  
  11. function GM:GetRound()
  12.     return self.RoundStage or 0
  13. end
  14.  
  15. net.Receive("SetRound", function (length)
  16.     local r = net.ReadUInt(8)
  17.     local start = net.ReadDouble()
  18.     GAMEMODE.RoundStage = r
  19.     GAMEMODE.RoundStart = start
  20.  
  21.     GAMEMODE.RoundSettings = {}
  22.     local settings = net.ReadUInt(8)
  23.     if settings != 0 then
  24.         GAMEMODE.RoundSettings.ShowAdminsOnScoreboard = net.ReadUInt(8) != 0
  25.         GAMEMODE.RoundSettings.AdminPanelAllowed = net.ReadUInt(8) != 0
  26.         GAMEMODE.RoundSettings.ShowSpectateInfo = net.ReadUInt(8) != 0
  27.     end
  28.  
  29.     if r == 1 then
  30.         timer.Simple(0.2, function ()
  31.             local pitch = math.random(70, 140)
  32.             if IsValid(LocalPlayer()) then
  33.                 LocalPlayer():EmitSound("ambient/creatures/town_child_scream1.wav", 100, pitch)
  34.             end
  35.         end)
  36.         GAMEMODE.LootCollected = 0
  37.     end
  38. end)
  39.  
  40. net.Receive("DeclareWinner" , function (length)
  41.     local data = {}
  42.     data.reason = net.ReadUInt(8)
  43.     data.murderer = net.ReadEntity()
  44.     data.murdererColor = net.ReadVector()
  45.     data.murdererName = net.ReadString()
  46.     if IsValid(data.murderer) then
  47.     end
  48.  
  49.     data.collectedLoot = {}
  50.     while true do
  51.         local cont = net.ReadUInt(8)
  52.         if cont == 0 then break end
  53.  
  54.         local t = {}
  55.         t.player = net.ReadEntity()
  56.         if IsValid(t.player) then
  57.             t.playerName = t.player:Nick()
  58.         end
  59.         t.count = net.ReadUInt(32)
  60.         t.playerColor = net.ReadVector()
  61.         t.playerBystanderName = net.ReadString()
  62.         table.insert(data.collectedLoot, t)
  63.     end
  64.  
  65.     GAMEMODE:DisplayEndRoundBoard(data)
  66.  
  67.     local pitch = math.random(80, 120)
  68.     if IsValid(LocalPlayer()) then
  69.         LocalPlayer():EmitSound("ambient/alarms/warningbell1.wav", 100, pitch)
  70.     end
  71. end)
  72.  
  73. net.Receive("GrabLoot", function (length)
  74.     GAMEMODE.LootCollected = net.ReadUInt(32)
  75. end)
  76.  
  77. net.Receive("SetLoot", function (length)
  78.     GAMEMODE.LootCollected = net.ReadUInt(32)
  79. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement