Advertisement
Deadman69330

Untitled

Oct 9th, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. local timerBeforeShow = 600 -- Time before we show the menu to the player (in seconds)
  2.  
  3.  
  4. util.AddNetworkString("RequestDemoODicta")
  5. util.AddNetworkString("SetRegime")
  6.  
  7. hook.Add("OnPlayerChangedTeam","IsDemoOrDicta",function(ply, _, teams)
  8. if team.GetName(teams) == MaireConf.MayorJob then
  9. timer.Create("Deadman:::DemocratieTimer"..ply:SteamID(), timerBeforeShow, 1, function()
  10.  
  11. if ply:team.GetName(ply:Team()) == MaireConf.MayorJob then -- Check if player is still mayor
  12. net.Start("RequestDemoODicta")
  13. net.Send(ply)
  14. end
  15.  
  16. end)
  17. end
  18. end)
  19.  
  20. net.Receive("SetRegime",function(_,ply)
  21. ply:SetNWString("RegimeMaire",net.ReadBool() and "Démocratie" or "Dictature")
  22. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement