Guest User

RMarkersv2[Streamed]

a guest
Oct 18th, 2010
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.07 KB | None | 0 0
  1. /*------------------------------------------------------------------------------
  2. Rmarkers Created by Killa[DGZ]
  3. RMarkers Use Fallout's Object Streamer Created by: Fallout v0.5
  4. Special thanks to fallout for permission to use his Streamer
  5. Double-O-Icons by Double-O-Seven for file size reduction from 1Mb to 156K?,
  6. and i have no idea what else it does but it seems works better with it!
  7. ------------------------------------------------------------------------------*/
  8. #define FILTERSCRIPT
  9.  
  10. #include <a_samp>
  11. #include <Double-O-Icons> // < dont ask why this is here but leave it
  12.  
  13. #define GREY 0xAFAFAFAA
  14. #define RED 0xAA3333AA
  15.  
  16. #if defined FILTERSCRIPT
  17.  
  18. #define F_MAX_OBJECTS 1000
  19. #define UpdateTime 300 //update time in ms (milliseconds).
  20. #define ObjectsToStream 300
  21. #define StreamRange 350.0
  22. #pragma dynamic 30000
  23. #define MAX_REDMARKERS 1000
  24. #define MAX_FLASHMARKERS 1000
  25.  
  26. forward F_ObjectUpdate(bool:DontCheckDistance);
  27. forward F_StartUpdate();
  28.  
  29. enum redSpot
  30. {
  31. Redmarker,
  32. Float:redmX,
  33. Float:redmY,
  34. Float:redmZ,
  35. rmObject,
  36. };
  37. new Markcord[MAX_REDMARKERS][redSpot];
  38.  
  39. enum flashSpot
  40. {
  41. Flashmarker,
  42. Float:flamX,
  43. Float:flamY,
  44. Float:flamZ,
  45. flObject,
  46. };
  47. new Markcords[MAX_FLASHMARKERS][flashSpot];
  48.  
  49. enum OInfo
  50. {
  51. ModelID,
  52. ObjectID[MAX_PLAYERS],
  53. Float:ox,
  54. Float:oy,
  55. Float:oz,
  56. Float:orox,
  57. Float:oroy,
  58. Float:oroz,
  59. Float:ovdist,
  60. bool:ObjectCreated[MAX_PLAYERS],
  61. };
  62. new ObjectInfo[F_MAX_OBJECTS][OInfo];
  63. new bool:ObjectUpdatetRunning;
  64. new bool:CantCreateMore;
  65. new bool:RefreshObjects[MAX_PLAYERS];
  66. new Float:OldX[MAX_PLAYERS], Float:OldY[MAX_PLAYERS], Float:OldZ[MAX_PLAYERS];
  67.  
  68. public OnFilterScriptInit()
  69. {
  70. print("\n--------------------------------------");
  71. print(" RMarkers By Killa[DGZ] ");
  72. print("--------------------------------------\n");
  73. return 1;
  74. }
  75.  
  76. public OnFilterScriptExit()
  77. {
  78. return 1;
  79. }
  80.  
  81. public OnPlayerConnect(playerid)
  82. {
  83. SendClientMessage(playerid, RED,"* RMarkers, Type: /markerhelp for more info *");
  84. return 1;
  85. }
  86.  
  87. public OnPlayerCommandText(playerid, cmdtext[])
  88. {
  89. if (strcmp(cmdtext,"/markerhelp",true) == 0)
  90. {
  91. SendClientMessage(playerid, RED," * Red Markers *");
  92. SendClientMessage(playerid, GREY,"* Type: /redmarker or /rm to place a red marker *");
  93. SendClientMessage(playerid, GREY,"* Type: /deleteclosestredmarker or /dcrm to delete the red marker closest to you *");
  94. SendClientMessage(playerid, GREY,"* Type: /deleteallredmarkers or /dallrm to delete all red markers *");
  95. SendClientMessage(playerid, RED," * Flash Markers *");
  96. SendClientMessage(playerid, GREY,"* Type: /flashmarker or /fm to place a flash marker *");
  97. SendClientMessage(playerid, GREY,"* Type: /deleteclosestflashmarker or /dcfm to delete the flash marker closest to you *");
  98. SendClientMessage(playerid, GREY,"* Type: /deleteallflashmarkers or /dallfm to delete all flash markers *");
  99. SendClientMessage(playerid, GREY,"* Type: /markercredits for the Filterscript credits *");
  100. return 1;
  101. }
  102. if (strcmp(cmdtext,"/markercredits",true) == 0)
  103. {
  104. SendClientMessage(playerid, RED," * Marker Credits *");
  105. SendClientMessage(playerid, GREY,"* RMarkers Was Created By Killa[DGZ] 16-09-2010 *");
  106. SendClientMessage(playerid, GREY,"* This [FS] uses Fallout's Object Streamer Created by Fallout *");
  107. SendClientMessage(playerid, GREY,"* This [FS] uses Double-O-Icons by Double-O-Seven *");
  108. return 1;
  109. }
  110. if(strcmp(cmdtext, "/redmarker", true) == 0 || strcmp(cmdtext, "/rm", true) == 0)
  111. {
  112. new Float:plocx,Float:plocy,Float:plocz;
  113. GetPlayerPos(playerid, plocx, plocy, plocz);
  114. CreateRMarker(plocx,plocy,plocz);
  115. return 1;
  116. }
  117. if(strcmp(cmdtext, "/deleteclosestredmarker", true) == 0 || strcmp(cmdtext, "/dcrm", true) == 0)
  118. {
  119. DeleteClosestRMarker(playerid);
  120. return 1;
  121. }
  122. if(strcmp(cmdtext, "/deleteallredmarkers", true) == 0 || strcmp(cmdtext, "/dallrm", true) == 0)
  123. {
  124. DeleteAllRMarker();
  125. return 1;
  126. }
  127. if(strcmp(cmdtext, "/flashmarker", true) == 0 || strcmp(cmdtext, "/fm", true) == 0)
  128. {
  129. new Float:plocx,Float:plocy,Float:plocz;
  130. GetPlayerPos(playerid, plocx, plocy, plocz);
  131. CreateFMarker(plocx,plocy,plocz);
  132. return 1;
  133. }
  134. if(strcmp(cmdtext, "/deleteclosestflashmarker", true) == 0 || strcmp(cmdtext, "/dcfm", true) == 0)
  135. {
  136. DeleteClosestFMarker(playerid);
  137. return 1;
  138. }
  139. if(strcmp(cmdtext, "/deleteallflashmarkers", true) == 0 || strcmp(cmdtext, "/dallfm", true) == 0)
  140. {
  141. DeleteAllFMarker();
  142. return 1;
  143. }
  144. return 0;
  145. }
  146.  
  147. public F_StartUpdate()
  148. {
  149. SetTimer("F_ObjectUpdate", UpdateTime, 1);
  150. }
  151.  
  152. stock F_CreateObject(modelid, Float:x, Float:y, Float:z, Float:rox, Float:roy, Float:roz, Float:vdist=0.0)
  153. {
  154. if(ObjectUpdatetRunning == false)
  155. {
  156. SetTimer("F_StartUpdate", F_MAX_OBJECTS/2, 0);
  157. ObjectUpdatetRunning = true;
  158. }
  159.  
  160. new objectid;
  161.  
  162. if(CantCreateMore == false)
  163. {
  164. for(new i; i<F_MAX_OBJECTS; i++)
  165. {
  166. if(i == F_MAX_OBJECTS-1)
  167. {
  168. printf("Only the first %i objects could be created - object limit exceeded.", F_MAX_OBJECTS);
  169. CantCreateMore = true;
  170. }
  171. if(ObjectInfo[i][ModelID] == 0)
  172. {
  173. objectid = i;
  174. break;
  175. }
  176. }
  177. }
  178. else
  179. {
  180. return -1;
  181. }
  182.  
  183. if(modelid == 0)
  184. {
  185. printf("Invalid modelid for object %i", objectid);
  186. return -1;
  187. }
  188.  
  189. ObjectInfo[objectid][ModelID] = modelid;
  190. ObjectInfo[objectid][ox] = x;
  191. ObjectInfo[objectid][oy] = y;
  192. ObjectInfo[objectid][oz] = z;
  193. ObjectInfo[objectid][orox] = rox;
  194. ObjectInfo[objectid][oroy] = roy;
  195. ObjectInfo[objectid][oroz] = roz;
  196. ObjectInfo[objectid][ovdist] = vdist;
  197. return objectid;
  198. }
  199.  
  200. stock F_IsValidObject(objectid)
  201. {
  202. if(ObjectInfo[objectid][ModelID] == 0 || objectid == -1)
  203. {
  204. return 0;
  205. }
  206. return 1;
  207. }
  208.  
  209. stock F_DestroyObject(objectid)
  210. {
  211. if(F_IsValidObject(objectid))
  212. {
  213. for(new playerid; playerid<MAX_PLAYERS; playerid++)
  214. {
  215. if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid) && ObjectInfo[objectid][ObjectCreated][playerid] == true)
  216. {
  217. DestroyPlayerObject(playerid, ObjectInfo[objectid][ObjectID][playerid]);
  218. ObjectInfo[objectid][ObjectCreated][playerid] = false;
  219. }
  220. }
  221. ObjectInfo[objectid][ModelID] = 0;
  222. return 1;
  223. }
  224. return 0;
  225. }
  226.  
  227. stock F_MoveObject(objectid, Float:x, Float:y, Float:z, Float:speed)
  228. {
  229. if(F_IsValidObject(objectid))
  230. {
  231. new time;
  232. for(new playerid; playerid<MAX_PLAYERS; playerid++)
  233. {
  234. if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid) && ObjectInfo[objectid][ObjectCreated][playerid] == true)
  235. {
  236. time = MovePlayerObject(playerid, ObjectInfo[objectid][ObjectID][playerid], x, y, z, speed);
  237. }
  238. }
  239. return time;
  240. }
  241. return 0;
  242. }
  243.  
  244. stock F_StopObject(objectid)
  245. {
  246. if(F_IsValidObject(objectid))
  247. {
  248. for(new playerid; playerid<MAX_PLAYERS; playerid++)
  249. {
  250. if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid) && ObjectInfo[objectid][ObjectCreated][playerid] == true)
  251. {
  252. StopPlayerObject(playerid, ObjectInfo[objectid][ObjectID][playerid]);
  253. }
  254. }
  255. return 1;
  256. }
  257. return 0;
  258. }
  259.  
  260. stock F_SetObjectPos(objectid, Float:x, Float:y, Float:z)
  261. {
  262. if(F_IsValidObject(objectid))
  263. {
  264. ObjectInfo[objectid][ox] = x;
  265. ObjectInfo[objectid][oy] = y;
  266. ObjectInfo[objectid][oz] = z;
  267. for(new playerid; playerid<MAX_PLAYERS; playerid++)
  268. {
  269. if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid) && ObjectInfo[objectid][ObjectCreated][playerid] == true)
  270. {
  271. SetPlayerObjectPos(playerid, ObjectInfo[objectid][ObjectID][playerid], x, y, z);
  272. }
  273. }
  274. return 1;
  275. }
  276. return 0;
  277. }
  278.  
  279. stock F_GetObjectPos(objectid, &Float:x, &Float:y, &Float:z)
  280. {
  281. if(F_IsValidObject(objectid))
  282. {
  283. x = ObjectInfo[objectid][ox];
  284. y = ObjectInfo[objectid][oy];
  285. z = ObjectInfo[objectid][oz];
  286. return 1;
  287. }
  288. else
  289. {
  290. return 0;
  291. }
  292. }
  293.  
  294. stock F_SetObjectRot(objectid, Float:rox, Float:roy, Float:roz)
  295. {
  296. if(F_IsValidObject(objectid))
  297. {
  298. ObjectInfo[objectid][orox] = rox;
  299. ObjectInfo[objectid][oroy] = roy;
  300. ObjectInfo[objectid][oroz] = roz;
  301. for(new playerid; playerid<MAX_PLAYERS; playerid++)
  302. {
  303. if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid) && ObjectInfo[objectid][ObjectCreated][playerid] == true)
  304. {
  305. SetPlayerObjectRot(playerid, ObjectInfo[objectid][ObjectID][playerid], rox, roy, roz);
  306. }
  307. }
  308. return 1;
  309. }
  310. return 0;
  311. }
  312.  
  313. stock F_GetObjectRot(objectid, &Float:rox, &Float:roy, &Float:roz)
  314. {
  315. if(F_IsValidObject(objectid))
  316. {
  317. rox = ObjectInfo[objectid][orox];
  318. roy = ObjectInfo[objectid][oroy];
  319. roz = ObjectInfo[objectid][oroz];
  320. return 1;
  321. }
  322. else
  323. {
  324. return 0;
  325. }
  326. }
  327.  
  328. stock F_RefreshObjects(playerid)
  329. {
  330. if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
  331. {
  332. RefreshObjects[playerid] = true;
  333. new Float:x, Float:y, Float:z;
  334. GetPlayerPos(playerid, x, y, z);
  335. F_PlayerObjectUpdate(playerid, x, y, z);
  336. return 1;
  337. }
  338. return 0;
  339. }
  340.  
  341. stock F_Streamer_OnPlayerConnect(playerid)
  342. {
  343. for(new objectid; objectid<F_MAX_OBJECTS; objectid++)
  344. {
  345. ObjectInfo[objectid][ObjectCreated][playerid] = false;
  346. }
  347. OldX[playerid] = 999999999.99;
  348. OldY[playerid] = 999999999.99;
  349. OldZ[playerid] = 999999999.99;
  350. RefreshObjects[playerid] = false;
  351. return 1;
  352. }
  353.  
  354. public F_ObjectUpdate(bool:DontCheckDistance)
  355. {
  356. new Float:ObjDistance[F_MAX_OBJECTS];
  357. new Closest[ObjectsToStream];
  358. new ObjectArr[F_MAX_OBJECTS];
  359. new nr;
  360. new bool:Firstloop;
  361. new bool:DontDestroy[F_MAX_OBJECTS];
  362.  
  363. for(new playerid; playerid<MAX_PLAYERS; playerid++)
  364. {
  365. if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
  366. {
  367. if(!IsPlayerInRangeOfPoint(playerid, 1.0, OldX[playerid], OldY[playerid], OldZ[playerid]) || DontCheckDistance)
  368. {
  369. GetPlayerPos(playerid, OldX[playerid], OldY[playerid], OldZ[playerid]);
  370.  
  371. nr = 0;
  372. for(new objectid; objectid<F_MAX_OBJECTS; objectid++)
  373. {
  374. if(F_IsValidObject(objectid))
  375. {
  376. ObjDistance[objectid] = floatsqroot(floatpower(floatsub(ObjectInfo[objectid][ox],OldX[playerid]),2)+floatpower(floatsub(ObjectInfo[objectid][oy],OldY[playerid]),2)+floatpower(floatsub(ObjectInfo[objectid][oz],OldZ[playerid]),2));
  377. if(floatcmp(ObjDistance[objectid], StreamRange) == -1)
  378. {
  379. ObjectArr[nr] = objectid;
  380. nr++;
  381. }
  382. }
  383. }
  384.  
  385. Closest = "";
  386.  
  387. if(nr > ObjectsToStream)
  388. {
  389. for(new loop; loop<ObjectsToStream; loop++)
  390. {
  391. Firstloop = true;
  392. for(new objectid; objectid<nr; objectid++)
  393. {
  394. if((ObjDistance[ObjectArr[objectid]] != 999999999.99) && ((floatcmp(ObjDistance[ObjectArr[objectid]], ObjDistance[Closest[loop]]) == -1) || Firstloop))
  395. {
  396. Firstloop = false;
  397. Closest[loop] = ObjectArr[objectid];
  398. }
  399. }
  400. ObjDistance[Closest[loop]] = 999999999.99;
  401. }
  402. }
  403. else
  404. {
  405. for(new objectid; objectid<nr; objectid++)
  406. {
  407. Closest[objectid] = ObjectArr[objectid];
  408. }
  409. }
  410.  
  411. for(new objectid; objectid<F_MAX_OBJECTS; objectid++) { DontDestroy[objectid] = false; }
  412. for(new objectid; objectid<ObjectsToStream && objectid<nr; objectid++)
  413. {
  414. DontDestroy[Closest[objectid]] = true;
  415. }
  416.  
  417. for(new objectid; objectid<F_MAX_OBJECTS; objectid++)
  418. {
  419. if(ObjectInfo[objectid][ObjectCreated][playerid] == true && DontDestroy[objectid] == false)
  420. {
  421. DestroyPlayerObject(playerid, ObjectInfo[objectid][ObjectID][playerid]);
  422. ObjectInfo[objectid][ObjectCreated][playerid] = false;
  423. }
  424. }
  425.  
  426. for(new loop; loop<ObjectsToStream && loop<nr; loop++)
  427. {
  428. if(ObjectInfo[Closest[loop]][ObjectCreated][playerid] == false)
  429. {
  430. ObjectInfo[Closest[loop]][ObjectID][playerid] = CreatePlayerObject(playerid, ObjectInfo[Closest[loop]][ModelID], ObjectInfo[Closest[loop]][ox], ObjectInfo[Closest[loop]][oy], ObjectInfo[Closest[loop]][oz], ObjectInfo[Closest[loop]][orox], ObjectInfo[Closest[loop]][oroy], ObjectInfo[Closest[loop]][oroz], ObjectInfo[Closest[loop]][ovdist]);
  431. ObjectInfo[Closest[loop]][ObjectCreated][playerid] = true;
  432. }
  433. }
  434. }
  435. }
  436. }
  437. }
  438.  
  439. stock F_ObjectUpdateForAll()
  440. {
  441. F_ObjectUpdate(true);
  442. }
  443.  
  444. stock F_PlayerObjectUpdate(playerid, Float:x, Float:y, Float:z)
  445. {
  446. if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
  447. {
  448. OldX[playerid] = x;
  449. OldY[playerid] = y;
  450. OldZ[playerid] = z;
  451.  
  452. new nr;
  453. new Float:ObjDistance[F_MAX_OBJECTS];
  454. new ObjectArr[F_MAX_OBJECTS];
  455. for(new objectid; objectid<F_MAX_OBJECTS; objectid++)
  456. {
  457. if(F_IsValidObject(objectid))
  458. {
  459. ObjDistance[objectid] = floatsqroot(floatpower(floatsub(ObjectInfo[objectid][ox],x),2)+floatpower(floatsub(ObjectInfo[objectid][oy],y),2)+floatpower(floatsub(ObjectInfo[objectid][oz],z),2));
  460. if(floatcmp(ObjDistance[objectid], StreamRange) == -1)
  461. {
  462. ObjectArr[nr] = objectid;
  463. nr++;
  464. }
  465. }
  466. }
  467.  
  468. new Closest[ObjectsToStream];
  469.  
  470. if(nr > ObjectsToStream)
  471. {
  472. for(new loop; loop<ObjectsToStream; loop++)
  473. {
  474. new bool:Firstloop = true;
  475. for(new objectid; objectid<nr; objectid++)
  476. {
  477. if((ObjDistance[ObjectArr[objectid]] != 999999999.99) && ((floatcmp(ObjDistance[ObjectArr[objectid]], ObjDistance[Closest[loop]]) == -1) || Firstloop))
  478. {
  479. Firstloop = false;
  480. Closest[loop] = ObjectArr[objectid];
  481. }
  482. }
  483. ObjDistance[Closest[loop]] = 999999999.99;
  484. }
  485. }
  486. else
  487. {
  488. for(new objectid; objectid<nr; objectid++)
  489. {
  490. Closest[objectid] = ObjectArr[objectid];
  491. }
  492. }
  493.  
  494. new bool:DontDestroy[F_MAX_OBJECTS];
  495. for(new objectid; objectid<ObjectsToStream && objectid<nr; objectid++)
  496. {
  497. DontDestroy[Closest[objectid]] = true;
  498. }
  499.  
  500. for(new objectid; objectid<F_MAX_OBJECTS; objectid++)
  501. {
  502. if(ObjectInfo[objectid][ObjectCreated][playerid] == true && (DontDestroy[objectid] == false || RefreshObjects[playerid] == true))
  503. {
  504. DestroyPlayerObject(playerid, ObjectInfo[objectid][ObjectID][playerid]);
  505. ObjectInfo[objectid][ObjectCreated][playerid] = false;
  506. }
  507. }
  508. RefreshObjects[playerid] = false;
  509.  
  510. for(new loop; loop<ObjectsToStream && loop<nr; loop++)
  511. {
  512. if(ObjectInfo[Closest[loop]][ObjectCreated][playerid] == false)
  513. {
  514. ObjectInfo[Closest[loop]][ObjectID][playerid] = CreatePlayerObject(playerid, ObjectInfo[Closest[loop]][ModelID], ObjectInfo[Closest[loop]][ox], ObjectInfo[Closest[loop]][oy], ObjectInfo[Closest[loop]][oz], ObjectInfo[Closest[loop]][orox], ObjectInfo[Closest[loop]][oroy], ObjectInfo[Closest[loop]][oroz], ObjectInfo[Closest[loop]][ovdist]);
  515. ObjectInfo[Closest[loop]][ObjectCreated][playerid] = true;
  516. }
  517. }
  518. }
  519. }
  520. #define SetPlayerPos F_SetPlayerPos
  521. stock F_SetPlayerPos(playerid, Float:x, Float:y, Float:z)
  522. {
  523. F_PlayerObjectUpdate(playerid, x, y, z);
  524. SetPlayerPos(playerid, x, y, z);
  525. }
  526.  
  527. stock CreateRMarker(Float:x,Float:y,Float:z)
  528. {
  529. for(new i = 0; i < sizeof(Markcord); i++)
  530. {
  531. if(Markcord[i][Redmarker] == 0)
  532. {
  533. Markcord[i][Redmarker]=1;
  534. Markcord[i][redmX]=x;
  535. Markcord[i][redmY]=y;
  536. Markcord[i][redmZ]=z-0.7;
  537. Markcord[i][rmObject] = F_CreateObject(1213, x, y, z-1.0,0,0,300);//red marker
  538. return 1;
  539. }
  540. }
  541. return 0;
  542. }
  543.  
  544. stock DeleteAllRMarker()
  545. {
  546. for(new i = 0; i < sizeof(Markcord); i++)
  547. {
  548. if(Markcord[i][Redmarker] == 1)
  549. {
  550. Markcord[i][Redmarker]=0;
  551. Markcord[i][redmX]=0.0;
  552. Markcord[i][redmY]=0.0;
  553. Markcord[i][redmZ]=0.0;
  554. F_DestroyObject(Markcord[i][rmObject]);
  555. }
  556. }
  557. return 0;
  558. }
  559.  
  560. stock DeleteClosestRMarker(playerid)
  561. {
  562. for(new i = 0; i < sizeof(Markcord); i++)
  563. {
  564. if(IsPlayerInRangeOfPoint(playerid, 2.0, Markcord[i][redmX], Markcord[i][redmY], Markcord[i][redmZ]))
  565. {
  566. if(Markcord[i][Redmarker] == 1)
  567. {
  568. Markcord[i][Redmarker]=0;
  569. Markcord[i][redmX]=0.0;
  570. Markcord[i][redmY]=0.0;
  571. Markcord[i][redmZ]=0.0;
  572. F_DestroyObject(Markcord[i][rmObject]);
  573. return 1;
  574. }
  575. }
  576. }
  577. return 0;
  578. }
  579.  
  580. stock CreateFMarker(Float:x,Float:y,Float:z)
  581. {
  582. for(new i = 0; i < sizeof(Markcords); i++)
  583. {
  584. if(Markcords[i][Flashmarker] == 0)
  585. {
  586. Markcords[i][Flashmarker]=1;
  587. Markcords[i][flamX]=x;
  588. Markcords[i][flamY]=y;
  589. Markcords[i][flamZ]=z-0.7;
  590. Markcords[i][flObject] = F_CreateObject(3526, x, y, z-1.05,0,0,300);//flashing marker
  591. return 1;
  592. }
  593. }
  594. return 0;
  595. }
  596.  
  597. stock DeleteAllFMarker()
  598. {
  599. for(new i = 0; i < sizeof(Markcords); i++)
  600. {
  601. if(Markcords[i][Flashmarker] == 1)
  602. {
  603. Markcords[i][Flashmarker]=0;
  604. Markcords[i][flamX]=0.0;
  605. Markcords[i][flamY]=0.0;
  606. Markcords[i][flamZ]=0.0;
  607. F_DestroyObject(Markcords[i][flObject]);
  608. }
  609. }
  610. return 0;
  611. }
  612.  
  613. stock DeleteClosestFMarker(playerid)
  614. {
  615. for(new i = 0; i < sizeof(Markcords); i++)
  616. {
  617. if(IsPlayerInRangeOfPoint(playerid, 2.0, Markcords[i][flamX], Markcords[i][flamY], Markcords[i][flamZ]))
  618. {
  619. if(Markcords[i][Flashmarker] == 1)
  620. {
  621. Markcords[i][Flashmarker]=0;
  622. Markcords[i][flamX]=0.0;
  623. Markcords[i][flamY]=0.0;
  624. Markcords[i][flamZ]=0.0;
  625. F_DestroyObject(Markcords[i][flObject]);
  626. return 1;
  627. }
  628. }
  629. }
  630. return 0;
  631. }
  632. #endif
Add Comment
Please, Sign In to add comment