Guest User

Version 1.0 - AFK System

a guest
May 6th, 2013
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.19 KB | None | 0 0
  1. // ****************************************CREDITS*INFORMATION*************************************************
  2. // [Basic] AFK System (Made by DJTunes)
  3. // Notice: This is my third filterscript, please don't be harsh
  4. // Notice: If you would like to edit/use my work, it'd be nice of you to contact me, before hand
  5. // Other FS's made by DJTunes: Welcome Message System, Credit System, Anti Team Kill Kick,
  6. // Other GM's made by DJTunes: Modern Warfare, Instant Warfare, Team Death Match,
  7. // ****************************************INCLUDES*************************************************
  8. #include <a_samp>
  9. // ****************************************DEFINES*************************************************
  10. #define COLOR_GRAD1 0xB4B5B7FF
  11. #define COLOR_GRAD2 0xBFC0C2FF
  12. #define COLOR_GRAD3 0xCBCCCEFF
  13. #define COLOR_GRAD4 0xD8D8D8FF
  14. #define COLOR_GRAD5 0xE3E3E3FF
  15. #define COLOR_GRAD6 0xF0F0F0FF
  16. #define COLOR_GREY 0xAFAFAFAA
  17. #define COLOR_GREEN 0x33AA33AA
  18. #define COLOR_RED 0xAA3333AA
  19. #define COLOR_YELLOW 0xFFFF00AA
  20. #define COLOR_WHITE 0xFFFFFFAA
  21. #define COLOR_FADE1 0xE6E6E6E6
  22. #define COLOR_FADE2 0xC8C8C8C8
  23. #define COLOR_FADE3 0xAAAAAAAA
  24. #define COLOR_FADE4 0x8C8C8C8C
  25. #define COLOR_FADE5 0x6E6E6E6E
  26. #define COLOR_PURPLE 0xC2A2DAAA
  27. #define COLOR_DBLUE 0x2641FEAA
  28. #define COLOR_ALLDEPT 0xFF8282AA
  29. // ******************************************SCRIPT*********************************************
  30. public OnPlayerCommandText(playerid, cmdtext[])
  31. {
  32. if(strcmp(cmdtext, "/afk", true) == 0)
  33. {
  34. new pName[MAX_PLAYER_NAME];
  35. new string[128];
  36. GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
  37. format(string, sizeof(string), "---> #s now AFK!", pName);
  38. SendClientMessageToAll(COLOR_RED, string);
  39. TogglePlayerControllable(playerid, 0);
  40. SetPlayerHealth(playerid, 999999.99);
  41. return 1;
  42. }
  43. if(strcmp(cmdtext, "/back", true) == 0)
  44. {
  45. new pName[MAX_PLAYER_NAME];
  46. new string[128];
  47. GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
  48. format(string, sizeof(string), "---> #s now back!", pName);
  49. SendClientMessageToAll(COLOR_GREEN, string);
  50. TogglePlayerControllable(playerid, 1);
  51. SetPlayerHealth(playerid, 100);
  52. return 1;
  53. }
  54. return 0;
  55. }
Advertisement
Add Comment
Please, Sign In to add comment