Advertisement
DeWilX

Simple AFK System [0.1]

Apr 20th, 2013
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.09 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 hp2 = 100;
  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[256];
  27.     GetPlayerName(playerid,gPlayers[playerid],MAX_PLAYER_NAME);
  28.     SetPlayerHealth(playerid,hp);
  29.     TogglePlayerControllable(playerid, 0);
  30.     format(string,sizeof(string),"%s is afk!",gPlayers[playerid]);
  31.     SendClientMessageToAll(COLOR_RED,string);
  32. }
  33. if (strcmp("/back", cmdtext, true, 10) == 0)
  34. {
  35.     new string[256];
  36.     TogglePlayerControllable(playerid, 1);
  37.     SetPlayerHealth(playerid,hp2);
  38.     format(string,sizeof(string),"%s is back!",gPlayers[playerid]);
  39.     SendClientMessageToAll(COLOR_YELLOW,string);
  40.     return 1;
  41. }
  42. return 1;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement