Advertisement
Guest User

Untitled

a guest
Oct 24th, 2014
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. Client side
  2.  
  3. if timer.Exists("isAFK33") then
  4. timer.Destory("isAFK33")
  5. end
  6. local isAFKOnce = 0
  7. timer.Simple(4,function()
  8. timer.Create("isAFK33",1800,0,function()
  9. print("If you got kicked by accident and you are watching the console, please let bob know!")
  10. print("For Bob, the variable was: ".. isAFKOnce)
  11.  
  12. net.Start("Kick_afk_network_bob")
  13. net.WriteInt(isAFKOnce,2)
  14. net.SendToServer()
  15. isAFKOnce = 1
  16. end)
  17. end)
  18. hook.Add("KeyPress","AFK_Main",function(ply)
  19. timer.Stop("isAFK33")
  20. timer.Start("isAFK33")
  21. isAFKOnce = 0
  22. end)
  23.  
  24.  
  25. Server Side
  26.  
  27. util.AddNetworkString("Kick_afk_network_bob")
  28.  
  29. net.Receive("Kick_afk_network_bob", function(len,ply)
  30. local IsDemoted = net.ReadInt(2)
  31. if IsDemoted == 0 then
  32. ply:changeTeam(TEAM_CITIZEN,true)
  33. ply:PrintMessage(HUD_PRINTTALK, "You have been demoted because you were AFK for more than 30 minutes!")
  34. end
  35. if IsDemoted == 1 then
  36. ply:Kick("You have been AFK for over an hour!")
  37. end
  38.  
  39. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement