1Geek

Simple AFK System by 1Geek v2.0

Aug 18th, 2013
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.39 KB | None | 0 0
  1. #include <a_samp>
  2. #define FILTERSCRIPT
  3. #define COLOR_ORANGE 0xFF9900AA
  4. #define COLOR_RED    0xF30000AA
  5. public OnFilterScriptInit()
  6. {
  7.     print("\n----------------------------------------------");
  8.     print(" 1AFK System by: 1Geek v2.0");
  9.     print("------------------------------------------------\n");
  10.     return 1;
  11. }
  12. public OnPlayerCommandText(playerid, cmdtext[])
  13. {
  14.     if(strcmp(cmdtext, "/afkoff", true) == 0 || strcmp(cmdtext, "/back", true) == 0)
  15.     {
  16.         new string[256];
  17.         new name[MAX_PLAYER_NAME];
  18.         GetPlayerName(playerid,name,18);
  19.         format(string, sizeof(string), "%s is back to keyboard",name);
  20.         SetPlayerHealth(playerid, 100);
  21.         SendClientMessageToAll(COLOR_ORANGE,string);
  22.         TogglePlayerControllable(playerid,1);
  23.         SendClientMessage(playerid, COLOR_RED, " type /afkoff | /back to go back");
  24.         return 1;
  25.     }
  26.     if(strcmp(cmdtext, "/afkon", true) == 0 || strcmp(cmdtext, "/away", true) == 0)
  27.     {
  28.         SetPlayerHealth(playerid, 9999999);
  29.         ResetPlayerWeapons(playerid);
  30.         new name[MAX_PLAYER_NAME];
  31.         GetPlayerName(playerid,name,18);
  32.         new string[256];
  33.         format(string, sizeof(string), "%s is now Away From Keyboard",name);
  34.         TogglePlayerControllable(playerid,0);
  35.         SendClientMessage(playerid, COLOR_ORANGE, " Type /afkon | /away to go in AFK mode.");
  36.         SendClientMessageToAll(COLOR_RED,string);
  37.         return 1;
  38.     }
  39.     return 0;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment