Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- File: fn_antiAFK.sqf
- Author: Maihym
- Description:
- Activated when mouse is not moving. Determines if user is afk.
- */
- sleep 300;
- _lastMoved = time - timeMouseMoved;
- if(_lastMoved >= 300 && !AFK_FirstWarning) then {
- AFK_FirstWarning = true;
- [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;
- };
- if(_lastMoved >= 600 && !AFK_SecondWarning) then {
- AFK_SecondWarning = true;
- [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;
- };
- if(_lastMoved >= 900 && !AFK_LastWarning) then {
- AFK_LastWarning = true;
- [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;
- };
- if (_lastMoved >= 910 && AFK_LastWarning) then {
- [str(getPlayerUID player)] remoteExec ["TON_fnc_kickPlayer",2];
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement