RedWingz

Simple AFK System - 14/05/12

May 14th, 2012
406
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.65 KB | None | 0 0
  1. ////////////////////////////////////////////////////////////////////////////////
  2. /////////////////////////////Simple AFK System//////////////////////////////////
  3. ////////////////////////////////By RedWingz/////////////////////////////////////
  4. /////////////////////////////////14/05/12///////////////////////////////////////
  5. ////////////////////////////////////////////////////////////////////////////////
  6.  
  7. #include <a_samp>
  8.  
  9. #define FILTERSCRIPT
  10. #if defined FILTERSCRIPT
  11.  
  12. #define COLOR_GREEN 0x33AA33AA
  13. #define COLOR_RED 0xCC0000AA
  14. #define COLOR_YELLOW 0xFFFF00AA
  15.  
  16. public OnFilterScriptInit()
  17. {
  18.     print("\n======================================");
  19.     print("    Simple AFK System by RedWingz");
  20.     print("              14/05/12");
  21.     print("========================================\n");
  22.     return 1;
  23. }
  24.  
  25. #endif
  26.  
  27. public OnPlayerCommandText(playerid, cmdtext[])
  28. {
  29.     if(strcmp("/afk", cmdtext, true, 10) == 0)
  30.     {
  31.         TogglePlayerControllable(playerid, 0); //This freezes the player//
  32.         SetPlayerVirtualWorld(playerid, 1); //This moves the player to another virtual world//
  33.         SetPlayerHealth(playerid, 9999999); //Makes the player invincible//
  34.         SendClientMessage(playerid, COLOR_GREEN, "You are now AFK. Type /back when you are back!");
  35.         return 1;
  36.     }
  37.     if(strcmp("/back", cmdtext, true, 10) == 0)
  38.     {
  39.         TogglePlayerControllable(playerid, 1); //This unfreezes the player//
  40.         SetPlayerVirtualWorld(playerid, 0); //This moves the player to the default virtual world//
  41.         SetPlayerHealth(playerid, 100); //Makes the player vincible again//
  42.         SendClientMessage(playerid, COLOR_GREEN, "You are no longer AFK.");
  43.         return 1;
  44.     }
  45.     return 0;
  46. }
Advertisement
Add Comment
Please, Sign In to add comment