Advertisement
Guest User

Untitled

a guest
Dec 12th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. /*
  2. File: fn_antiAFK.sqf
  3. Author: Maihym
  4.  
  5. Description:
  6. Activated when mouse is not moving. Determines if user is afk.
  7. */
  8. sleep 300;
  9. _lastMoved = time - timeMouseMoved;
  10. if(_lastMoved >= 300 && !AFK_FirstWarning) then {
  11. AFK_FirstWarning = true;
  12. [name player,"You have been AFK for 5 minutes. Please wake up or you will be kicked soon.",[1,0,0,1],"error"] call life_fnc_sendNotification;
  13. };
  14. if(_lastMoved >= 600 && !AFK_SecondWarning) then {
  15. AFK_SecondWarning = true;
  16. [name player,"You have been AFK for 10 minutes. Please wake up or you will be kicked soon.",[1,0,0,1],"error"] call life_fnc_sendNotification;
  17. };
  18. if(_lastMoved >= 900 && !AFK_LastWarning) then {
  19. AFK_LastWarning = true;
  20. [name player,"You have been AFK for 15 minutes. Please wake up or you will be kicked soon.",[1,0,0,1],"error"] call life_fnc_sendNotification;
  21. };
  22. if (_lastMoved >= 910 && AFK_LastWarning) then {
  23. [str(getPlayerUID player)] remoteExec ["TON_fnc_kickPlayer",2];
  24. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement