KillerDVX

Mine system - KillerDVX

Jun 24th, 2015
342
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.70 KB | None | 0 0
  1. #include <a_samp>
  2. #include <streamer>
  3.  
  4. #pragma tabsize 0
  5.  
  6. new Float:mineposx[11][MAX_PLAYERS];
  7. new Float:mineposy[11][MAX_PLAYERS];
  8. new Float:mineposz[11][MAX_PLAYERS];
  9. new mine[MAX_PLAYERS];
  10. new mineo[11][MAX_PLAYERS];
  11.  
  12. public OnFilterScriptInit()
  13. {
  14. print("\n--------------------------------------");
  15. print(" Mine system Enabled");
  16. print("--------------------------------------\n");
  17. return 1;
  18. }
  19.  
  20. public OnFilterScriptExit()
  21. {
  22. print("\n--------------------------------------");
  23. print(" Mine system Disabled");
  24. print("--------------------------------------\n");
  25. return 1;
  26. }
  27.  
  28. main()
  29. {
  30. print("\n----------------------------------");
  31. print(" Mine system By KillerDVX");
  32. print("----------------------------------\n");
  33. }
  34.  
  35. public OnGameModeInit()
  36. {
  37. return 1;
  38. }
  39.  
  40. public OnGameModeExit()
  41. {
  42. return 1;
  43. }
  44.  
  45. public OnPlayerRequestClass(playerid, classid)
  46. {
  47. return 1;
  48. }
  49.  
  50. public OnPlayerConnect(playerid)
  51. {
  52. ApplyAnimation(playerid,"BOMBER","null",0,0,0,0,0,0,0); //This is to preload the animation Liberary
  53. for(new i;i < 11;i++)
  54. {
  55. mineposx[i][playerid] = 9999;
  56. mineposy[i][playerid] = 9999;
  57. mineposz[i][playerid] = 9999;
  58. }
  59. mine[playerid] = 0;
  60. return 1;
  61. }
  62.  
  63. public OnPlayerDisconnect(playerid, reason)
  64. {
  65. for(new i;i < 11;i++)
  66. {
  67. mineposx[i][playerid] = 9999;
  68. mineposy[i][playerid] = 9999;
  69. mineposz[i][playerid] = 9999;
  70. DestroyDynamicObject(mineo[i][playerid]);
  71. }
  72. mine[playerid] = 0;
  73. return 1;
  74. }
  75.  
  76. public OnPlayerSpawn(playerid)
  77. {
  78. return 1;
  79. }
  80.  
  81. public OnPlayerDeath(playerid, killerid, reason)
  82. {
  83. return 1;
  84. }
  85.  
  86. public OnVehicleSpawn(vehicleid)
  87. {
  88. return 1;
  89. }
  90.  
  91. public OnVehicleDeath(vehicleid, killerid)
  92. {
  93. return 1;
  94. }
  95.  
  96. public OnPlayerText(playerid, text[])
  97. {
  98. return 1;
  99. }
  100.  
  101. public OnPlayerCommandText(playerid, cmdtext[])
  102. {
  103. if (strcmp("/placemine", cmdtext, true, 10) == 0)
  104. {
  105. new i;
  106. mine[playerid] ++;
  107. i = mine[playerid];
  108. new Float:x, Float:y, Float:z;
  109. GetPlayerPos(playerid,x,y,z);
  110. mineposx[i][playerid] = x;
  111. mineposy[i][playerid] = y;
  112. mineposz[i][playerid] = z;
  113. mineo[i][playerid] = CreateDynamicObject(363,x,y,z-0.9,-90,0,0,-1,-1,-1,200);
  114. SendClientMessage(playerid,0xFF0000AA,"You have placed a mine, tap /explosem to explose it.");
  115. return 1;
  116. }
  117. if (strcmp("/explosem", cmdtext, true, 10) == 0)
  118. {
  119. for(new i; i < 11;i++)
  120. {
  121. if(mineposx[i][playerid] != 9999 && mineposy[i][playerid] != 9999 && mineposz[i][playerid] != 9999)
  122. {
  123. CreateExplosion(mineposx[i][playerid],mineposy[i][playerid],mineposz[i][playerid],3,3);
  124. DestroyDynamicObject(mineo[i][playerid]);
  125. mineposx[i][playerid] = 9999;
  126. mineposy[i][playerid] = 9999;
  127. mineposz[i][playerid] = 9999;
  128. }
  129. }
  130. mine[playerid] = 0;
  131. return 1;
  132. }
  133. return 0;
  134. }
  135.  
  136. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  137. {
  138. return 1;
  139. }
  140.  
  141. public OnPlayerExitVehicle(playerid, vehicleid)
  142. {
  143. return 1;
  144. }
  145.  
  146. public OnPlayerStateChange(playerid, newstate, oldstate)
  147. {
  148. return 1;
  149. }
  150.  
  151. public OnPlayerEnterCheckpoint(playerid)
  152. {
  153. return 1;
  154. }
  155.  
  156. public OnPlayerLeaveCheckpoint(playerid)
  157. {
  158. return 1;
  159. }
  160.  
  161. public OnPlayerEnterRaceCheckpoint(playerid)
  162. {
  163. return 1;
  164. }
  165.  
  166. public OnPlayerLeaveRaceCheckpoint(playerid)
  167. {
  168. return 1;
  169. }
  170.  
  171. public OnRconCommand(cmd[])
  172. {
  173. return 1;
  174. }
  175.  
  176. public OnPlayerRequestSpawn(playerid)
  177. {
  178. return 1;
  179. }
  180.  
  181. public OnObjectMoved(objectid)
  182. {
  183. return 1;
  184. }
  185.  
  186. public OnPlayerObjectMoved(playerid, objectid)
  187. {
  188. return 1;
  189. }
  190.  
  191. public OnPlayerPickUpPickup(playerid, pickupid)
  192. {
  193. return 1;
  194. }
  195.  
  196. public OnVehicleMod(playerid, vehicleid, componentid)
  197. {
  198. return 1;
  199. }
  200.  
  201. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  202. {
  203. return 1;
  204. }
  205.  
  206. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  207. {
  208. return 1;
  209. }
  210.  
  211. public OnPlayerSelectedMenuRow(playerid, row)
  212. {
  213. return 1;
  214. }
  215.  
  216. public OnPlayerExitedMenu(playerid)
  217. {
  218. return 1;
  219. }
  220.  
  221. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  222. {
  223. return 1;
  224. }
  225.  
  226. public OnRconLoginAttempt(ip[], password[], success)
  227. {
  228. return 1;
  229. }
  230.  
  231. public OnPlayerUpdate(playerid)
  232. {
  233. return 1;
  234. }
  235.  
  236. public OnPlayerStreamIn(playerid, forplayerid)
  237. {
  238. return 1;
  239. }
  240.  
  241. public OnPlayerStreamOut(playerid, forplayerid)
  242. {
  243. return 1;
  244. }
  245.  
  246. public OnVehicleStreamIn(vehicleid, forplayerid)
  247. {
  248. return 1;
  249. }
  250.  
  251. public OnVehicleStreamOut(vehicleid, forplayerid)
  252. {
  253. return 1;
  254. }
  255.  
  256. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  257. {
  258. return 1;
  259. }
  260.  
  261. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  262. {
  263. return 1;
  264. }
Advertisement
Add Comment
Please, Sign In to add comment