Advertisement
_iLustcheR_

AFK System by VeLLuX - Fixed by LustcheR

Sep 10th, 2014
288
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.48 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. #define Red 0xFF0000FF
  4.  
  5. new InAFK[MAX_PLAYERS], String[82];
  6.  
  7. public OnPlayerText(playerid, text[])
  8. {
  9.         if(InAFK[playerid] == 1) return SendClientMessage(playerid, Red, "!AFK אינך יכול לכתוב בצ'אט כאשר אתה במצב");
  10.         return 0;
  11. }
  12.  
  13. public OnPlayerCommandText(playerid, cmdtext[])
  14. {
  15.         if(strcmp(cmdtext, "/AFK", true) == 0)
  16.         {
  17.         if(InAFK[playerid] == 1)
  18.         {
  19.                     format(String, sizeof(String),"!AFK יצא ממצב {FFFF00}%s {FFFFFF}השחקן",GetName(playerid));
  20.                     SendClientMessageToAll(-1, String);
  21.                     AFK[playerid] = 0;
  22.                     SetPlayerVirtualWorld(playerid, 0);
  23.                     SpawnPlayer(playerid);
  24.                     TogglePlayerControllable(playerid, true);
  25.         }
  26.         else
  27.         {
  28.                     format(String, sizeof(String),"!AFK נכנס למצב {FFFFFF}%s {FFFF00}השחקן",GetName(playerid));
  29.                     SendClientMessageToAll(-1, String);
  30.                     AFK[playerid] = 1;
  31.                     SetPlayerVirtualWorld(playerid, playerid + 1);
  32.                     TogglePlayerControllable(playerid, false);
  33.         }
  34.                 return 1;
  35.         }
  36.     if(InAFK[playerid] == 1) return SendClientMessage(playerid, Red, "!AFK אינך יכול לבצע פקודות כאשר אתה במצב");
  37.         return 0;
  38. }
  39.  
  40. stock GetName(playerid)
  41. {
  42.     new pName[MAX_PLAYER_NAME + 5];
  43.     GetPlayerName(playerid, pName, sizeof(pName));
  44.     return pName;
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement