SecretBoss

Untitled

Dec 7th, 2015
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. public CheckForAFK()
  2. {
  3. foreach(new i : Player)
  4. {
  5. if(gettime()-AFK[i] > 5)
  6. {
  7. if(PlayerAFK[i] == false && FunctionCall[0][i] == false)
  8. {
  9. PlayerAFK[i] = true;
  10. CallLocalFunction("OnPlayerPause", "i", i);
  11. FunctionCall[0][i] = true;
  12. FunctionCall[1][i] = false;
  13. AFK[i] = gettime();
  14. }
  15. }
  16. else
  17. {
  18. if(PlayerAFK[i] == true && FunctionCall[1][i] == false)
  19. {
  20. PlayerAFK[i] = false;
  21. CallLocalFunction("OnPlayerUnpause", "i", i);
  22. FunctionCall[1][i] = true;
  23. FunctionCall[0][i] = false;
  24. AFK[i] = gettime()-AFK[i];
  25. }
  26. }
  27. }
  28. return 1;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment