TheMaddox

AFK systeme

Oct 15th, 2011
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.58 KB | None | 0 0
  1. #define FILTERSCRIPT
  2.  
  3. #include <a_samp>
  4. #include <a_players>
  5. #if defined FILTERSCRIPT
  6. new bool:AFK[MAX_PLAYERS];
  7. public OnFilterScriptInit()
  8. {
  9. print("\n--------------------------------------");
  10. print(" Simple AFK system(DFreeman) ");
  11. print("--------------------------------------\n");
  12. return 1;
  13. }
  14.  
  15. public OnFilterScriptExit()
  16. {
  17. print("\n--------------------------------------");
  18. print(" Simple AFK system(DFreeman) ");
  19. print("--------------------------------------\n");
  20. return 1;
  21. }
  22. #endif
  23. public OnPlayerConnect(playerid)
  24. {
  25. AFK[playerid] = false;
  26. return 1;
  27. }
  28.  
  29. public OnPlayerDisconnect(playerid, reason)
  30. {
  31. return 1;
  32. }
  33.  
  34. public OnPlayerSpawn(playerid)
  35. {
  36. return 1;
  37. }
  38.  
  39. public OnPlayerDeath(playerid, killerid, reason)
  40. {
  41. return 1;
  42. }
  43.  
  44. public OnVehicleSpawn(vehicleid)
  45. {
  46. return 1;
  47. }
  48.  
  49. public OnVehicleDeath(vehicleid, killerid)
  50. {
  51. return 1;
  52. }
  53.  
  54. public OnPlayerText(playerid, text[])
  55. {
  56. return 1;
  57. }
  58.  
  59. public OnPlayerCommandText(playerid, cmdtext[])
  60. {
  61. new Pname[MAX_PLAYER_NAME];
  62. new string[120];
  63. if(strcmp(cmdtext,"/afk",true) == 0)
  64. {
  65. if(AFK[playerid] == false)
  66. {
  67. AFK[playerid] = true;
  68. SetPlayerHealth(playerid,9999.9);
  69. TogglePlayerControllable(playerid,0);
  70. GetPlayerName(playerid,Pname,sizeof(Pname));
  71. format(string,sizeof(string),"{FF0000}[SERVER]:{00FF00}%s est AFK(/afk)",Pname);
  72. SendClientMessageToAll(0xFFFFFFFF,string);
  73. }
  74. else
  75. {
  76. AFK[playerid] = false;
  77. SetPlayerHealth(playerid,100.0);
  78. TogglePlayerControllable(playerid,1);
  79. GetPlayerName(playerid,Pname,sizeof(Pname));
  80. format(string,sizeof(string),"{FF0000}[SERVER]:{00FF00}%s est revenu",Pname);
  81. SendClientMessageToAll(0xFFFFFFFF,string);
  82. }
  83. }
  84. return 0;
  85. }
  86.  
  87. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  88. {
  89. return 1;
  90. }
  91.  
  92. public OnPlayerExitVehicle(playerid, vehicleid)
  93. {
  94. return 1;
  95. }
  96.  
  97. public OnPlayerStateChange(playerid, newstate, oldstate)
  98. {
  99. return 1;
  100. }
  101.  
  102. public OnPlayerEnterCheckpoint(playerid)
  103. {
  104. return 1;
  105. }
  106.  
  107. public OnPlayerLeaveCheckpoint(playerid)
  108. {
  109. return 1;
  110. }
  111.  
  112. public OnPlayerEnterRaceCheckpoint(playerid)
  113. {
  114. return 1;
  115. }
  116.  
  117. public OnPlayerLeaveRaceCheckpoint(playerid)
  118. {
  119. return 1;
  120. }
  121.  
  122. public OnRconCommand(cmd[])
  123. {
  124. return 1;
  125. }
  126.  
  127. public OnPlayerRequestSpawn(playerid)
  128. {
  129. return 1;
  130. }
  131.  
  132. public OnObjectMoved(objectid)
  133. {
  134. return 1;
  135. }
  136.  
  137. public OnPlayerObjectMoved(playerid, objectid)
  138. {
  139. return 1;
  140. }
  141.  
  142. public OnPlayerPickUpPickup(playerid, pickupid)
  143. {
  144. return 1;
  145. }
  146.  
  147. public OnVehicleMod(playerid, vehicleid, componentid)
  148. {
  149. return 1;
  150. }
  151.  
  152. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  153. {
  154. return 1;
  155. }
  156.  
  157. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  158. {
  159. return 1;
  160. }
  161.  
  162. public OnPlayerSelectedMenuRow(playerid, row)
  163. {
  164. return 1;
  165. }
  166.  
  167. public OnPlayerExitedMenu(playerid)
  168. {
  169. return 1;
  170. }
  171.  
  172. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  173. {
  174. return 1;
  175. }
  176.  
  177. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  178. {
  179. return 1;
  180. }
  181.  
  182. public OnRconLoginAttempt(ip[], password[], success)
  183. {
  184. return 1;
  185. }
  186.  
  187. public OnPlayerUpdate(playerid)
  188. {
  189. return 1;
  190. }
  191.  
  192. public OnPlayerStreamIn(playerid, forplayerid)
  193. {
  194. return 1;
  195. }
  196.  
  197. public OnPlayerStreamOut(playerid, forplayerid)
  198. {
  199. return 1;
  200. }
  201.  
  202. public OnVehicleStreamIn(vehicleid, forplayerid)
  203. {
  204. return 1;
  205. }
  206.  
  207. public OnVehicleStreamOut(vehicleid, forplayerid)
  208. {
  209. return 1;
  210. }
  211.  
  212. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  213. {
  214. return 1;
  215. }
  216.  
  217. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  218. {
  219. return 1;
  220. }
  221.  
  222.  
Advertisement
Add Comment
Please, Sign In to add comment