Guest User

Proximity Mines & Money Bags by Killa[DGZ]

a guest
Nov 21st, 2010
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.28 KB | None | 0 0
  1. /*------------------------------------------------------------------------------
  2. Proximity Mines & Money Bags Created by Killa[DGZ]
  3. ------------------------------------------------------------------------------*/
  4. #define FILTERSCRIPT
  5.  
  6. #include <a_samp>
  7.  
  8. #define RED 0xFF6347AA
  9. #define GREY 0xAFAFAFAA
  10. #define LIGHTBLUE 0x33CCFFAA
  11.  
  12. #if defined FILTERSCRIPT
  13.  
  14. #define MAX_MINES 25
  15. #define MAX_MBMINES 25
  16.  
  17. enum ProxyMines
  18. {
  19. Proxymine,
  20. Float:MineX,
  21. Float:MineY,
  22. Float:MineZ,
  23. MineObject,
  24. };
  25. new Proxycords[MAX_MINES][ProxyMines];
  26.  
  27. enum MBProxyMines
  28. {
  29. MBProxymine,
  30. Float:MBMineX,
  31. Float:MBMineY,
  32. Float:MBMineZ,
  33. MBMineObject,
  34. };
  35. new MBProxycords[MAX_MBMINES][MBProxyMines];
  36.  
  37. public OnFilterScriptInit()
  38. {
  39. print("\n----------------------------------------");
  40. print("Proximity Mines & Money Bags By Killa[DGZ]");
  41. print("----------------------------------------\n");
  42. return 1;
  43. }
  44.  
  45. public OnFilterScriptExit()
  46. {
  47. return 1;
  48. }
  49.  
  50. public OnPlayerConnect(playerid)
  51. {
  52. SendClientMessage(playerid, LIGHTBLUE,"* Proximity Mines & Money Bags, Type: /proxyhelp for more info *");
  53. return 1;
  54. }
  55.  
  56. public OnPlayerUpdate(playerid)
  57. {
  58. for(new i = 0; i < sizeof(Proxycords); i++)
  59. {
  60. if(IsPlayerInRangeOfPoint(playerid, 2.0, Proxycords[i][MineX], Proxycords[i][MineY], Proxycords[i][MineZ]))
  61. {
  62. if(Proxycords[i][Proxymine] == 1)
  63. {
  64. new Float:minex, Float:miney, Float:minez;
  65. GetPlayerPos(playerid,minex, miney, minez);
  66. CreateExplosion(minex, miney , minez, 6, 10);
  67. DeleteClosestProxyMine(playerid);
  68. return 0;
  69. }
  70. }
  71. else if(IsPlayerInRangeOfPoint(playerid, 2.0, MBProxycords[i][MBMineX], MBProxycords[i][MBMineY], MBProxycords[i][MBMineZ]))
  72. {
  73. if(MBProxycords[i][MBProxymine] == 1)
  74. {
  75. new Float:MBminex, Float:MBminey, Float:MBminez;
  76. GetPlayerPos(playerid,MBminex, MBminey, MBminez);
  77. CreateExplosion(MBminex, MBminey , MBminez, 7, 10);
  78. DeleteClosestMBProxyMine(playerid);
  79. return 0;
  80. }
  81. }
  82. }
  83. return 1;
  84. }
  85.  
  86. public OnPlayerCommandText(playerid, cmdtext[])
  87. {
  88. if (strcmp(cmdtext,"/proxyhelp",true) == 0)
  89. {
  90. SendClientMessage(playerid, RED," * Proximity Mines *");
  91. SendClientMessage(playerid, LIGHTBLUE,": /spm to set a Proximity Mine *");
  92. SendClientMessage(playerid, LIGHTBLUE,": /dcpm to delete the Proximity Mine closest to you *");
  93. SendClientMessage(playerid, LIGHTBLUE,": /dapm to delete all Proximity Mines created *");
  94. SendClientMessage(playerid, RED," * Proximity Money Bags Bombs *");
  95. SendClientMessage(playerid, LIGHTBLUE,": /smb to set a Proximity Money Bag Bomb *");
  96. SendClientMessage(playerid, LIGHTBLUE,": /dcmb to delete the Proximity Money Bag Bomb closest to you *");
  97. SendClientMessage(playerid, LIGHTBLUE,": /damb to delete all Proximity Money Bag Bombs created *");
  98. SendClientMessage(playerid, LIGHTBLUE,"");
  99. SendClientMessage(playerid, GREY,": /proxycredits for credits *");
  100. return 1;
  101. }
  102. if (strcmp(cmdtext,"/proxycredits",true) == 0)
  103. {
  104. SendClientMessage(playerid, GREY,"* Proximity Mines & Money Bags - Created By Killa[DGZ] 20-11-2010 *");
  105. return 1;
  106. }
  107. if(strcmp(cmdtext, "/spm", true) == 0)
  108. {
  109. new Float:PposX,Float:PposY,Float:PposZ,Float:PposA;
  110. GetPlayerPos(playerid, PposX, PposY, PposZ);
  111. GetPlayerFacingAngle(playerid, PposA);
  112. PposX += (3 * floatsin(-PposA, degrees));
  113. PposY += (3 * floatcos(-PposA, degrees));
  114. CreateProxyMine(PposX,PposY,PposZ);
  115. return 1;
  116. }
  117. if(strcmp(cmdtext, "/dcpm", true) == 0)
  118. {
  119. DeleteClosestProxyMine(playerid);
  120. return 1;
  121. }
  122. if(strcmp(cmdtext, "/dapm", true) == 0)
  123. {
  124. DeleteAllProxyMine();
  125. return 1;
  126. }
  127. if(strcmp(cmdtext, "/smb", true) == 0)
  128. {
  129. new Float:PposX,Float:PposY,Float:PposZ,Float:PposA;
  130. GetPlayerPos(playerid, PposX, PposY, PposZ);
  131. GetPlayerFacingAngle(playerid, PposA);
  132. PposX += (3 * floatsin(-PposA, degrees));
  133. PposY += (3 * floatcos(-PposA, degrees));
  134. CreateMBProxyMine(PposX,PposY,PposZ);
  135. return 1;
  136. }
  137. if(strcmp(cmdtext, "/dcmb", true) == 0)
  138. {
  139. DeleteClosestMBProxyMine(playerid);
  140. return 1;
  141. }
  142. if(strcmp(cmdtext, "/damb", true) == 0)
  143. {
  144. DeleteAllMBProxyMine();
  145. return 1;
  146. }
  147. return 0;
  148. }
  149.  
  150. stock CreateProxyMine(Float:x,Float:y,Float:z)
  151. {
  152. for(new i = 0; i < sizeof(Proxycords); i++)
  153. {
  154. if(Proxycords[i][Proxymine] == 0)
  155. {
  156. Proxycords[i][Proxymine]=1;
  157. Proxycords[i][MineX]=x;
  158. Proxycords[i][MineY]=y;
  159. Proxycords[i][MineZ]=z;
  160. Proxycords[i][MineObject] = CreateObject(1654, x, y, z-0.8,0,0,300);
  161. return 1;
  162. }
  163. }
  164. return 0;
  165. }
  166.  
  167. stock DeleteClosestProxyMine(playerid)
  168. {
  169. for(new i = 0; i < sizeof(Proxycords); i++)
  170. {
  171. if(IsPlayerInRangeOfPoint(playerid, 5.0, Proxycords[i][MineX], Proxycords[i][MineY], Proxycords[i][MineZ]))
  172. {
  173. if(Proxycords[i][Proxymine] == 1)
  174. {
  175. Proxycords[i][Proxymine]=0;
  176. Proxycords[i][MineX]=0.0;
  177. Proxycords[i][MineY]=0.0;
  178. Proxycords[i][MineZ]=0.0;
  179. DestroyObject(Proxycords[i][MineObject]);
  180. return 1;
  181. }
  182. }
  183. }
  184. return 0;
  185. }
  186.  
  187. stock DeleteAllProxyMine()
  188. {
  189. for(new i = 0; i < sizeof(Proxycords); i++)
  190. {
  191. if(Proxycords[i][Proxymine] == 1)
  192. {
  193. Proxycords[i][Proxymine]=0;
  194. Proxycords[i][MineX]=0.0;
  195. Proxycords[i][MineY]=0.0;
  196. Proxycords[i][MineZ]=0.0;
  197. DestroyObject(Proxycords[i][MineObject]);
  198. }
  199. }
  200. return 0;
  201. }
  202.  
  203. stock CreateMBProxyMine(Float:x,Float:y,Float:z)
  204. {
  205. for(new i = 0; i < sizeof(MBProxycords); i++)
  206. {
  207. if(MBProxycords[i][MBProxymine] == 0)
  208. {
  209. MBProxycords[i][MBProxymine]=1;
  210. MBProxycords[i][MBMineX]=x;
  211. MBProxycords[i][MBMineY]=y;
  212. MBProxycords[i][MBMineZ]=z;
  213. MBProxycords[i][MBMineObject] = CreateObject(1550, x, y, z-0.75,0,0,300);
  214. return 1;
  215. }
  216. }
  217. return 0;
  218. }
  219.  
  220. stock DeleteClosestMBProxyMine(playerid)
  221. {
  222. for(new i = 0; i < sizeof(MBProxycords); i++)
  223. {
  224. if(IsPlayerInRangeOfPoint(playerid, 5.0, MBProxycords[i][MBMineX], MBProxycords[i][MBMineY], MBProxycords[i][MBMineZ]))
  225. {
  226. if(MBProxycords[i][MBProxymine] == 1)
  227. {
  228. MBProxycords[i][MBProxymine]=0;
  229. MBProxycords[i][MBMineX]=0.0;
  230. MBProxycords[i][MBMineY]=0.0;
  231. MBProxycords[i][MBMineZ]=0.0;
  232. DestroyObject(MBProxycords[i][MBMineObject]);
  233. return 1;
  234. }
  235. }
  236. }
  237. return 0;
  238. }
  239.  
  240. stock DeleteAllMBProxyMine()
  241. {
  242. for(new i = 0; i < sizeof(MBProxycords); i++)
  243. {
  244. if(MBProxycords[i][MBProxymine] == 1)
  245. {
  246. MBProxycords[i][MBProxymine]=0;
  247. MBProxycords[i][MBMineX]=0.0;
  248. MBProxycords[i][MBMineY]=0.0;
  249. MBProxycords[i][MBMineZ]=0.0;
  250. DestroyObject(MBProxycords[i][MBMineObject]);
  251. }
  252. }
  253. return 0;
  254. }
  255. #endif
Advertisement
Add Comment
Please, Sign In to add comment