Advertisement
Guest User

Mgd-AFK System

a guest
Jan 19th, 2013
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.10 KB | None | 0 0
  1. //made by mgd
  2. #include <a_samp>  
  3. #include <zcmd>    
  4.  
  5. new IsAfk[MAX_PLAYERS];
  6.  
  7. public OnPlayerConnect(playerid)
  8. {
  9.     IsAfk[playerid] = 0;
  10.     return 1;
  11. }
  12.  
  13. public OnPlayerDisconnect(playerid, reason)
  14. {
  15.     IsAfk[playerid] = 0;
  16.     return 1;
  17. }
  18.  
  19.  
  20. CMD:afk(playerid,params[])
  21. {
  22.     new string[128], pName[MAX_PLAYER_NAME];
  23.     if(IsAfk[playerid] == 1) return SendClientMessage(playerid, 0xFF0000FF,"You Are Already AFK");
  24.     TogglePlayerControllable(playerid, 0);
  25.     format(string,sizeof(string),"Server: %s Is Now Afk", pName);
  26.     SendClientMessageToAll(0xFFFF00,string);
  27.     SendClientMessage(playerid, 0xFF00FFFF,"Type /back if you want to continue");
  28.     IsAfk[playerid] = 1;
  29.     return 1;
  30. }
  31.  
  32. CMD:back(playerid,params[])
  33. {
  34.     new string[128], pName[MAX_PLAYER_NAME];
  35.     if(IsAfk[playerid] == 0) return SendClientMessage(playerid, 0xFF0000FF,"You Are Not AFK");
  36.     TogglePlayerControllable(playerid, 1);
  37.     format(string,sizeof(string),"Server: %s Is Back!", pName);
  38.     SendClientMessageToAll(0xFFFF00,string);
  39.     IsAfk[playerid] = 0;
  40.     return 1;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement