Guest User

RMarkersv2[NonStreamed]

a guest
Oct 18th, 2010
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.20 KB | None | 0 0
  1. /*------------------------------------------------------------------------------
  2. Rmarkers Created by Killa[DGZ]
  3. ------------------------------------------------------------------------------*/
  4. #define FILTERSCRIPT
  5.  
  6. #include <a_samp>
  7.  
  8. #define GREY 0xAFAFAFAA
  9. #define RED 0xAA3333AA
  10.  
  11. #if defined FILTERSCRIPT
  12.  
  13. #define MAX_REDMARKERS 100
  14. #define MAX_FLASHMARKERS 100
  15.  
  16. enum redSpot
  17. {
  18. Redmarker,
  19. Float:redmX,
  20. Float:redmY,
  21. Float:redmZ,
  22. rmObject,
  23. };
  24. new Markcord[MAX_REDMARKERS][redSpot];
  25.  
  26. enum flashSpot
  27. {
  28. Flashmarker,
  29. Float:flamX,
  30. Float:flamY,
  31. Float:flamZ,
  32. flObject,
  33. };
  34. new Markcords[MAX_FLASHMARKERS][flashSpot];
  35.  
  36. public OnFilterScriptInit()
  37. {
  38. print("\n--------------------------------------");
  39. print(" RMarkers By Killa[DGZ] ");
  40. print("--------------------------------------\n");
  41. return 1;
  42. }
  43.  
  44. public OnFilterScriptExit()
  45. {
  46. return 1;
  47. }
  48.  
  49. public OnPlayerConnect(playerid)
  50. {
  51. SendClientMessage(playerid, RED,"* RMarkers, Type: /markerhelp for more info *");
  52. return 1;
  53. }
  54.  
  55. public OnPlayerCommandText(playerid, cmdtext[])
  56. {
  57. if (strcmp(cmdtext,"/markerhelp",true) == 0)
  58. {
  59. SendClientMessage(playerid, RED," * Red Markers *");
  60. SendClientMessage(playerid, GREY,"* Type: /redmarker or /rm to place a red marker *");
  61. SendClientMessage(playerid, GREY,"* Type: /deleteclosestredmarker or /dcrm to delete the red marker closest to you *");
  62. SendClientMessage(playerid, GREY,"* Type: /deleteallredmarkers or /dallrm to delete all markers *");
  63. SendClientMessage(playerid, RED," * Flash Markers *");
  64. SendClientMessage(playerid, GREY,"* Type: /flashmarker or /fm to place a flash marker *");
  65. SendClientMessage(playerid, GREY,"* Type: /deleteclosestflashmarker or /dcfm to delete the flash marker closest to you *");
  66. SendClientMessage(playerid, GREY,"* Type: /deleteallflashmarkers or /dallfm to delete all flash markers *");
  67. SendClientMessage(playerid, GREY,"* Type: /markercredits for the Filterscript credits *");
  68. return 1;
  69. }
  70. if (strcmp(cmdtext,"/markercredits",true) == 0)
  71. {
  72. SendClientMessage(playerid, RED," * Marker Credits *");
  73. SendClientMessage(playerid, GREY,"* RMarkers Was Created By Killa[DGZ] 16-09-2010 *");
  74. return 1;
  75. }
  76. if(strcmp(cmdtext, "/redmarker", true) == 0 || strcmp(cmdtext, "/rm", true) == 0)
  77. {
  78. new Float:plocx,Float:plocy,Float:plocz;
  79. GetPlayerPos(playerid, plocx, plocy, plocz);
  80. CreateRMarker(plocx,plocy,plocz);
  81. return 1;
  82. }
  83. if(strcmp(cmdtext, "/deleteclosestredmarker", true) == 0 || strcmp(cmdtext, "/dcrm", true) == 0)
  84. {
  85. DeleteClosestRMarker(playerid);
  86. return 1;
  87. }
  88. if(strcmp(cmdtext, "/deleteallredmarkers", true) == 0 || strcmp(cmdtext, "/dallrm", true) == 0)
  89. {
  90. DeleteAllRMarker();
  91. return 1;
  92. }
  93. if(strcmp(cmdtext, "/flashmarker", true) == 0 || strcmp(cmdtext, "/fm", true) == 0)
  94. {
  95. new Float:plocx,Float:plocy,Float:plocz;
  96. GetPlayerPos(playerid, plocx, plocy, plocz);
  97. CreateFMarker(plocx,plocy,plocz);
  98. return 1;
  99. }
  100. if(strcmp(cmdtext, "/deleteclosestflashmarker", true) == 0 || strcmp(cmdtext, "/dcfm", true) == 0)
  101. {
  102. DeleteClosestFMarker(playerid);
  103. return 1;
  104. }
  105. if(strcmp(cmdtext, "/deleteallflashmarkers", true) == 0 || strcmp(cmdtext, "/dallfm", true) == 0)
  106. {
  107. DeleteAllFMarker();
  108. return 1;
  109. }
  110. return 0;
  111. }
  112.  
  113. stock CreateRMarker(Float:x,Float:y,Float:z)
  114. {
  115. for(new i = 0; i < sizeof(Markcord); i++)
  116. {
  117. if(Markcord[i][Redmarker] == 0)
  118. {
  119. Markcord[i][Redmarker]=1;
  120. Markcord[i][redmX]=x;
  121. Markcord[i][redmY]=y;
  122. Markcord[i][redmZ]=z-0.7;
  123. Markcord[i][rmObject] = CreateObject(1213, x, y, z-1.0,0,0,300);//Red marker
  124. return 1;
  125. }
  126. }
  127. return 0;
  128. }
  129.  
  130. stock DeleteAllRMarker()
  131. {
  132. for(new i = 0; i < sizeof(Markcord); i++)
  133. {
  134. if(Markcord[i][Redmarker] == 1)
  135. {
  136. Markcord[i][Redmarker]=0;
  137. Markcord[i][redmX]=0.0;
  138. Markcord[i][redmY]=0.0;
  139. Markcord[i][redmZ]=0.0;
  140. DestroyObject(Markcord[i][rmObject]);
  141. }
  142. }
  143. return 0;
  144. }
  145.  
  146. stock DeleteClosestRMarker(playerid)
  147. {
  148. for(new i = 0; i < sizeof(Markcord); i++)
  149. {
  150. if(IsPlayerInRangeOfPoint(playerid, 2.0, Markcord[i][redmX], Markcord[i][redmY], Markcord[i][redmZ]))
  151. {
  152. if(Markcord[i][Redmarker] == 1)
  153. {
  154. Markcord[i][Redmarker]=0;
  155. Markcord[i][redmX]=0.0;
  156. Markcord[i][redmY]=0.0;
  157. Markcord[i][redmZ]=0.0;
  158. DestroyObject(Markcord[i][rmObject]);
  159. return 1;
  160. }
  161. }
  162. }
  163. return 0;
  164. }
  165.  
  166. stock CreateFMarker(Float:x,Float:y,Float:z)
  167. {
  168. for(new i = 0; i < sizeof(Markcords); i++)
  169. {
  170. if(Markcords[i][Flashmarker] == 0)
  171. {
  172. Markcords[i][Flashmarker]=1;
  173. Markcords[i][flamX]=x;
  174. Markcords[i][flamY]=y;
  175. Markcords[i][flamZ]=z-0.7;
  176. Markcords[i][flObject] = CreateObject(3526, x, y, z-1.05,0,15.3409,300);//flashing marker
  177. return 1;
  178. }
  179. }
  180. return 0;
  181. }
  182.  
  183. stock DeleteAllFMarker()
  184. {
  185. for(new i = 0; i < sizeof(Markcords); i++)
  186. {
  187. if(Markcords[i][Flashmarker] == 1)
  188. {
  189. Markcords[i][Flashmarker]=0;
  190. Markcords[i][flamX]=0.0;
  191. Markcords[i][flamY]=0.0;
  192. Markcords[i][flamZ]=0.0;
  193. DestroyObject(Markcords[i][flObject]);
  194. }
  195. }
  196. return 0;
  197. }
  198.  
  199. stock DeleteClosestFMarker(playerid)
  200. {
  201. for(new i = 0; i < sizeof(Markcords); i++)
  202. {
  203. if(IsPlayerInRangeOfPoint(playerid, 2.0, Markcords[i][flamX], Markcords[i][flamY], Markcords[i][flamZ]))
  204. {
  205. if(Markcords[i][Flashmarker] == 1)
  206. {
  207. Markcords[i][Flashmarker]=0;
  208. Markcords[i][flamX]=0.0;
  209. Markcords[i][flamY]=0.0;
  210. Markcords[i][flamZ]=0.0;
  211. DestroyObject(Markcords[i][flObject]);
  212. return 1;
  213. }
  214. }
  215. }
  216. return 0;
  217. }
  218. #endif
Add Comment
Please, Sign In to add comment