Guest User

BB-AFK

a guest
Oct 31st, 2013
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.13 KB | None | 0 0
  1. /*
  2. BB AFK System
  3. By BlackBomb
  4. Version v0.1
  5. */
  6.  
  7. //Includes
  8. #include <a_samp>
  9. #include <zcmd>
  10.  
  11. //Define Colours
  12. #define green 0xFF0000
  13. #define red 0xFF0000FF
  14. #define orange 0xFF9900AA
  15. #define COLOR_GREEN 0x33AA33AA
  16. #define COLOR_ORANGE 0xFF9900AA
  17. #define COLOR_WHITE 0xFFFFFFAA
  18. #define COLOR_RED 0xFF0000AA
  19. #define COLOR_LIGHTBLUE 0x33CCFFAA
  20. #define COLOR_YELLOW 0xFFFF00AA
  21.  
  22. new AFK[MAX_PLAYERS];
  23. new Float:xpos,Float:ypos,Float:zpos;
  24. new Float:hp[MAX_PLAYERS];
  25. new Float:armour[MAX_PLAYERS];
  26.  
  27. CMD:afk(playerid, params [])
  28. {
  29. if(AFK[playerid] == 1)
  30. {
  31. return SendClientMessage(playerid,COLOR_RED,"You are Already AFK.");
  32. }
  33. TogglePlayerControllable(playerid, 0);
  34. new string[64], pName[MAX_PLAYER_NAME];
  35. GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
  36. GetPlayerPos(playerid,xpos,ypos,zpos);
  37. GetPlayerHealth(playerid,hp[playerid]);
  38. GetPlayerArmour(playerid,armour[playerid]);
  39. AFK[playerid] = 1;
  40. SetPlayerHealth(playerid,100000);
  41. SetPlayerArmour(playerid,100000);
  42. SetPlayerInterior(playerid,17);
  43. SetPlayerPos(playerid, 486.890991,-14.522799,1000.679687);
  44. GameTextForPlayer(playerid,"~G~ You're ~P~Now ~Y~AFK",3000,3);
  45. ApplyAnimation(playerid,"DANCING","dance_loop", 4.1,1,1,1,1,1);
  46. format(string, sizeof(string), "%s {33CCFF}is now {33AA33}Away From His Keyboard.",pName);
  47. SendClientMessageToAll(red,string);
  48. SendClientMessage(playerid, COLOR_YELLOW, "[AFK] - When you come back, use /back!");
  49. return 1;
  50. }
  51.  
  52. CMD:back(playerid, params [])
  53. {
  54. if(AFK[playerid] == 0)
  55. {
  56. return SendClientMessage(playerid,COLOR_RED,"You Must be AFK to use this Command.");
  57. }
  58. new string[129], pName[MAX_PLAYER_NAME];
  59. GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
  60. AFK[playerid] = 0;
  61. SetPlayerPos(playerid,xpos,ypos,zpos);
  62. SetPlayerHealth(playerid,hp[playerid]);
  63. SetPlayerArmour(playerid,armour[playerid]);
  64. ClearAnimations(playerid);
  65. SetPlayerInterior(playerid,0);
  66. GameTextForPlayer(playerid,"~G~ Well~P~Come ~Y~Back",3000,3);
  67. format(string,sizeof string, "%s {33CCFF}is no longer {33AA33}Away From His Keyboard.",pName);
  68. SendClientMessageToAll(red,string);
  69. TogglePlayerControllable(playerid, 1);
  70. SendClientMessage(playerid, COLOR_WHITE, "Welcome Back!");
  71. return 1;
  72. }
  73.  
  74. CMD:afkhelp(playerid, params [])
  75. {
  76. SendClientMessage(playerid, red, "___________________________BB-AFK System Help___________________________");
  77. SendClientMessage(playerid, COLOR_LIGHTBLUE, "To Get in AFK Status Use: /AFK ");
  78. SendClientMessage(playerid, COLOR_LIGHTBLUE, "To Get Back Into the normal status ( not afk any more ) Use: /Back");
  79. SendClientMessage(playerid, red, "_________________________________________________________________________");
  80. return 1;
  81. }
  82.  
  83. public OnPlayerText(playerid,text[])
  84. {
  85. if(AFK[playerid] == 1) return SendClientMessage(playerid, red, "You Cannot Talk, while You're AFK."), 0;
  86. return 1;
  87. }
Advertisement
Add Comment
Please, Sign In to add comment