Advertisement
DeWilX

Simple AFK System [0.2]

Apr 27th, 2011
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.16 KB | None | 0 0
  1. /* Simple AFK System by DeWilX */
  2.  
  3. #define FILTERSCRIPT
  4.  
  5. #include <a_samp>
  6.  
  7. #define COLOR_YELLOW 0xFFFF00AA
  8. #define COLOR_RED 0xFF0000FF
  9.  
  10. new gPlayers[MAX_PLAYERS][MAX_PLAYER_NAME+1];
  11. new hp = 9999999;
  12. new Float:phealth[MAX_PLAYERS];
  13.  
  14. public OnFilterScriptInit()
  15. {
  16.     print("\n--------------------------------------");
  17.     print(" DeWilX's Simple AFK System -- Loaded");
  18.     print("--------------------------------------\n");
  19.     return 1;
  20. }
  21.  
  22. public OnPlayerCommandText(playerid, cmdtext[])
  23. {
  24. if (strcmp("/afk", cmdtext, true, 10) == 0)
  25. {
  26.     new string[33];
  27.     GetPlayerName(playerid,gPlayers[playerid],MAX_PLAYER_NAME);
  28.     GetPlayerHealth(playerid,phealth[playerid]);
  29.     SetPlayerHealth(playerid,hp);
  30.     TogglePlayerControllable(playerid, 0);
  31.     format(string,sizeof(string),"%s is afk!",gPlayers[playerid]);
  32.     SendClientMessageToAll(COLOR_RED,string);
  33. }
  34. if (strcmp("/back", cmdtext, true, 10) == 0)
  35. {
  36.     new string[33];
  37.     TogglePlayerControllable(playerid, 1);
  38.     SetPlayerHealth(playerid,phealth[playerid]);
  39.     format(string,sizeof(string),"%s is back!",gPlayers[playerid]);
  40.     SendClientMessageToAll(COLOR_YELLOW,string);
  41.     return 1;
  42. }
  43. return 1;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement