Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2011
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.47 KB | None | 0 0
  1. /* --------- AFk System By _DownLoaD_ For www.Sa-mp.com -------- */
  2.  
  3. #include <a_samp>
  4. #pragma tabsize 0
  5.  
  6. new AFKS[MAX_PLAYERS];
  7.  
  8. #define COLOR_BLUE 0x0000ffff
  9. #define COLOR_RED 0xFF0000FF
  10. #define COLOR_YELLOW 0xffff33ff
  11. #define COLOR_WHITE 0xffffffff
  12. #define COLOR_GREEN 0x33ff33ff
  13. #define COLOR_LIME 0xccff00ff
  14. #define COLOR_AQUA 0x00ccccff
  15. #define COLOR_BLACK 0x000000ff
  16. #define COLOR_ROSE 0xffccccff
  17. #define COLOR_GREY 0xccccccff
  18. #define COLOR_PINK 0xff33ffff
  19. #define COLOR_BROWN 0x993300ff
  20. #define COLOR_DARKRED 0x990000AA
  21. #define COLOR_ORANGE 0xFF9900AA
  22. #define COLOR_IBlue 0x00FFFFAA
  23. #define COLOR_BRIGHTRED 0xFF0000AA
  24. #define COLOR_TAN 0xBDB76BAA
  25. #define COLOR_PURPLE 0x800080AA
  26. #define COLOR_LIGHTBLUE 0x33CCFFAA
  27. #define COLOR_INDIGO 0x4B00B0AA
  28. #define COLOR_DARKGREY 0x696969FF
  29. #if defined FILTERSCRIPT
  30.  
  31. public OnFilterScriptInit()
  32. {
  33. print("\n--------------------------------------");
  34. print(" AFk System By _DownLoaD_ Loaded!");
  35. print("--------------------------------------\n");
  36. return 1;
  37. }
  38.  
  39. public OnFilterScriptExit()
  40. {
  41. return 1;
  42. }
  43.  
  44. #else
  45.  
  46. main()
  47. {
  48. print("\n----------------------------------");
  49. print(" AFk Syste By _DownLoaD_ UnLoaded!");
  50. print("----------------------------------\n");
  51. }
  52.  
  53. #endif
  54.  
  55. public OnGameModeInit()
  56. {
  57. SetGameModeText("Blank Script");
  58. AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  59. return 1;
  60. }
  61.  
  62.  
  63. public OnPlayerRequestClass(playerid, classid)
  64. {
  65. SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  66. SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  67. SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  68. return 1;
  69. }
  70.  
  71. public OnPlayerCommandText(playerid, cmdtext[])
  72. {
  73. new string[256];
  74. /* ========================= [AFk System] ====================================*/
  75. if (strcmp("/AFK", cmdtext, true) == 0)
  76. {
  77. printf("[INFO]: %s Typed /AFk",GetName(playerid));
  78. if(AFKS[playerid] == 0)
  79. {
  80. AFKS[playerid] = 1;
  81. SetPlayerPos(playerid, 1117.6093,-2036.9828,78.7500);
  82. SetPlayerFacingAngle(playerid, 270.1927);
  83. SetPlayerVirtualWorld(playerid,259+1);
  84. TogglePlayerControllable(playerid, 0);
  85. SetCameraBehindPlayer(playerid);
  86. SendClientMessage(playerid, COLOR_GREEN, "You Are AFK!");
  87. }
  88. else if (AFKS[playerid] == 1)
  89. {
  90. AFKS[playerid] = 0;
  91. SpawnPlayer(playerid);
  92. SetCameraBehindPlayer(playerid);
  93. SetPlayerVirtualWorld(playerid,0);
  94. TogglePlayerControllable(playerid, 1);
  95. SendClientMessage(playerid, COLOR_ORANGE, "You Are No UnAFK!");
  96. }
  97. return 1;
  98. }
  99. // -----------------------------------------------------------------------------
  100. if(strcmp(cmdtext, "/AFKList", true) == 0)
  101. {
  102. printf("[INFO]: %s Typed /AFKList",GetName(playerid));
  103. if(IsPlayerConnected(playerid))
  104. {
  105. new count = 0;
  106. for(new i=0; i < MAX_PLAYERS; i++)
  107. {
  108. if(IsPlayerConnected(i))
  109. {
  110. if(AFKS[i] == 1)
  111. {
  112. SendClientMessage(playerid, COLOR_WHITE, "--- AFK LIST ---");
  113. new giveplayer[MAX_PLAYER_NAME];
  114. GetPlayerName(i, giveplayer, sizeof(giveplayer));
  115. format(string, sizeof(string), "{1E90FF}%d).%s", i,giveplayer);
  116. SendClientMessage(playerid,COLOR_WHITE,string);
  117. count++;
  118. }}}
  119. if(count == 0)
  120. {
  121. SendClientMessage(playerid,COLOR_RED,"NO AFKS");
  122. }}
  123. return 1;
  124. }
  125. return 0;
  126. }
  127.  
  128. // ----------------------------[Stocks]-----------------------------------------
  129. stock GetName(playerid)
  130. {
  131. new Name[MAX_PLAYER_NAME];
  132. GetPlayerName(playerid,Name,MAX_PLAYER_NAME);
  133. return Name;
  134. }
  135.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement