Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public CheckForAFK()
- {
- foreach(new i : Player)
- {
- if(gettime()-AFK[i] > 5)
- {
- if(PlayerAFK[i] == false && FunctionCall[0][i] == false)
- {
- PlayerAFK[i] = true;
- CallLocalFunction("OnPlayerPause", "i", i);
- FunctionCall[0][i] = true;
- FunctionCall[1][i] = false;
- AFK[i] = gettime();
- }
- }
- else
- {
- if(PlayerAFK[i] == true && FunctionCall[1][i] == false)
- {
- PlayerAFK[i] = false;
- CallLocalFunction("OnPlayerUnpause", "i", i);
- FunctionCall[1][i] = true;
- FunctionCall[0][i] = false;
- AFK[i] = gettime()-AFK[i];
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment