Advertisement
Guest User

AFK System by Stuun

a guest
Nov 1st, 2014
564
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. #include <a_samp>
  2. #include <zcmd>
  3.  
  4. new IsPlayerAfk[MAX_PLAYERS];
  5.  
  6. CMD:afk(playerid, params[])
  7. {
  8. if(IsPlayerAfk[playerid] == 1) return SendClientMessage(playerid, -1, "{FF0000}You are already AFK");
  9. IsPlayerAfk[playerid] = 1;
  10. GameTextForPlayer(playerid, "~g~AFK",2000,3);
  11. SetPlayerHealth(playerid, 9999999999999999999.0);
  12. TogglePlayerControllable(playerid,0);
  13. return 1;
  14. }
  15. CMD:back(playerid,params[])
  16. {
  17. if(IsPlayerAfk[playerid] == 0) return SendClientMessage(playerid, -1, "{FF0000}You are not AFK");
  18. if(IsPlayerAfk[playerid] == 1)
  19. {
  20. IsPlayerAfk[playerid] = 0;
  21. SendClientMessage(playerid, -1,"{00CC00}You are back from AFK");
  22. SetPlayerHealth(playerid, 100);
  23. TogglePlayerControllable(playerid,1);
  24. }
  25. return 1;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement