internal.inc 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690
  1. /*
  2. _ _ _
  3. | | | | | |
  4. | |__| | ___ __ _ __| | ___ _ __
  5. | __ |/ _ \/ _` |/ _` |/ _ \ '__|
  6. | | | | __/ (_| | (_| | __/ |
  7. |_| |_|\___|\__,_|\__,_|\___|_|
  8. Fire system by Fred Heinrich (oneOCT3T)
  9. WARNING: you should not have to edit this file.
  10. Instead, you should be editing the files that use
  11. the functions defined below.
  12. This file contains the internal components of the
  13. fire system.
  14. External files should only be using the above
  15. fire type declarations, or the public functions
  16. defined below.
  17. If there's anything missing, feel free to add it
  18. to the list below.
  19. The aim of this structure is to create a system
  20. such that developers may extend without
  21. editing this file.
  22. San Andreas Role Play 2017
  23. */
  24. #define FIRE_RADIUS_IN_VEHICLE 15.0
  25. #define FIRE_RADIUS_ON_FOOT 4.0
  26. #define MAX_FIRES 200
  27. #define INVALID_FIRE_SLOT MAX_FIRES+1
  28. #define FIRE_SMALL_HEALTH 5
  29. #define FIRE_MED_HEALTH 15
  30. #define FIRE_LARGE_HEALTH 30
  31. enum {
  32. FIRE_CAMP,
  33. FIRE_SMALL,
  34. FIRE_MED,
  35. FIRE_LARGE
  36. }
  37. /* Functions
  38. */
  39. forward IsValidFireType(type);
  40. forward IsValidFire(fid);
  41. forward IsPlayerOnFire(playerid);
  42. forward IsPlayerPuttingOutFire(playerid);
  43. forward IsPlayerInRangeOfFire(playerid, fid, Float:range);
  44. forward IsAFiremen(playerid); //firemen skin?
  45. forward CreateFire(type, Float:x, Float:y, Float:z, Float:offset, vw, int);
  46. forward DestroyFire(fid);
  47. forward GetFireHealth(fid);
  48. forward GetFireVirtualWorld(fid);
  49. forward GetFireInterior(fid);
  50. forward GetFirePos(fid, &Float:x, &Float:y, &Float:z);
  51. forward GetFireOwner(fid);
  52. forward GetFireType(fid);
  53. forward GetFirePoolSize();
  54. forward SetFireHealth(fid, health);
  55. forward SetFireVirtualWorld(fid, vw);
  56. forward SetFireOwner(fid, playerid);
  57. forward SetPlayerOnFire(playerid);
  58. forward RemovePlayerFire(playerid);
  59. forward GetPlayerClosestFire(playerid);
  60. /* Global variables
  61. */
  62. enum FireInfo {
  63. fireObject,
  64. fireWoodObject,
  65. fireHealth,
  66. fireType,
  67. fireVW,
  68. fireInt,
  69. fireOwner
  70. }
  71. /* fire internal core related vars */
  72. static Fires[MAX_FIRES][FireInfo];
  73. /* player putting out fires vars */
  74. //max fires that may be put out at once by a single player
  75. #define MAX_PUTOUT 5
  76. static PlayerPuttingOutFire[MAX_PLAYERS][MAX_PUTOUT+1];
  77. static FireTimer[MAX_PLAYERS][MAX_PUTOUT+1];
  78. //how many fires player is putting out
  79. static puttingoutSlots[MAX_PLAYERS];
  80. //aim assist
  81. new Text:aim_hud;
  82. new Text:aim_hud_green;
  83. /* player on fire vars */
  84. //remaining time on fire
  85. new pFireTime[MAX_PLAYERS];
  86. new pFireObject[MAX_PLAYERS] = {INVALID_OBJECT_ID, ...};
  87. /*
  88. ______ _ _
  89. | ____| | | (_)
  90. | |__ _ _ _ __ ___| |_ _ ___ _ __ ___
  91. | __| | | | '_ \ / __| __| |/ _ \| '_ \/ __|
  92. | | | |_| | | | | (__| |_| | (_) | | | \__ \
  93. |_| \__,_|_| |_|\___|\__|_|\___/|_| |_|___/
  94. */
  95. //Initalize some arrays, aim assist
  96. Hook:Fire_OnGameModeInit() {
  97. for(new i; i < MAX_PLAYERS; i++) {
  98. for(new j; j < MAX_PUTOUT; j++) {
  99. PlayerPuttingOutFire[i][j] = INVALID_FIRE_SLOT;
  100. }
  101. }
  102. //Putting out HUD
  103. aim_hud = TextDrawCreate(314.000000, 207.000000, "X");
  104. TextDrawBackgroundColor(aim_hud, 255);
  105. TextDrawFont(aim_hud, 1);
  106. TextDrawLetterSize(aim_hud, 0.500000, 1.399999);
  107. TextDrawColor(aim_hud, 0xFF000044);
  108. TextDrawSetOutline(aim_hud, 0);
  109. TextDrawSetProportional(aim_hud, 1);
  110. TextDrawSetShadow(aim_hud, 0);
  111. TextDrawSetSelectable(aim_hud, 0);
  112. aim_hud_green = TextDrawCreate(314.000000, 207.000000, "X");
  113. TextDrawBackgroundColor(aim_hud_green, 255);
  114. TextDrawFont(aim_hud_green, 1);
  115. TextDrawLetterSize(aim_hud_green, 0.500000, 1.399999);
  116. TextDrawColor(aim_hud_green, 0x00FF0044);
  117. TextDrawSetOutline(aim_hud_green, 0);
  118. TextDrawSetProportional(aim_hud_green, 1);
  119. TextDrawSetShadow(aim_hud_green, 0);
  120. TextDrawSetSelectable(aim_hud_green, 0);
  121. return 1;
  122. }
  123. /*
  124. GETTERS:
  125. --------
  126. only store getters here.
  127. Getters are functions that
  128. allows a developer to access
  129. internal variables.
  130. */
  131. public GetFireOwner(fid) {
  132. if(!IsValidFire(fid))
  133. return INVALID_PLAYER_ID;
  134. return Fires[fid][fireOwner];
  135. }
  136. public GetFireType(fid) {
  137. return Fires[fid][fireType];
  138. }
  139. public GetFireHealth(fid) {
  140. return Fires[fid][fireHealth];
  141. }
  142. public GetFireVirtualWorld(fid) {
  143. return Fires[fid][fireVW];
  144. }
  145. public GetFireInterior(fid) {
  146. return Fires[fid][fireInt];
  147. }
  148. public GetFirePos(fid, &Float:x, &Float:y, &Float:z) {
  149. GetDynamicObjectPos(Fires[fid][fireObject], x, y, z);
  150. return;
  151. }
  152. public GetFirePoolSize() {
  153. return MAX_FIRES;
  154. }
  155. /*
  156. SETTERS:
  157. --------
  158. Setters allows a developer
  159. to set internal variables.
  160. */
  161. public SetFireOwner(fid, playerid) {
  162. Fires[fid][fireOwner] = playerid;
  163. }
  164. public SetFireHealth(fid, health) {
  165. if(IsValidFire(fid)) {
  166. if( health <= 0 ) {
  167. DestroyFire(fid);
  168. }
  169. else
  170. Fires[fid][fireHealth] = health;
  171. return 1;
  172. }
  173. return 0;
  174. }
  175. /*
  176. Checking Related Functions
  177. --------------------------
  178. Only store checking related functions here,
  179. that is to be accessiable outside of this file.
  180. */
  181. public IsValidFireType(type) {
  182. if(type == FIRE_SMALL || type == FIRE_MED || type == FIRE_LARGE) return true;
  183. return false;
  184. }
  185. public IsValidFire(fid) {
  186. if(fid == INVALID_FIRE_SLOT) return false;
  187. if(!Fires[fid][fireObject]) return false;
  188. return true;
  189. }
  190. public IsPlayerPuttingOutFire(playerid) {
  191. return puttingoutSlots[playerid];
  192. }
  193. public IsPlayerOnFire(playerid) {
  194. return IsValidObject(pFireObject[playerid]) && pFireTime[playerid];
  195. }
  196. public IsPlayerInRangeOfFire(playerid, fid, Float:range) {
  197. new vw = GetPlayerVirtualWorld(playerid);
  198. new int = GetPlayerInterior(playerid);
  199. new Float: fx, Float:fy, Float:fz;
  200. GetFirePos(fid, fx, fy, fz);
  201. if( vw == GetFireVirtualWorld(fid) ) {
  202. if( int == GetFireInterior(fid) ) {
  203. if( IsPlayerInRangeOfPoint(playerid, range, fx, fy, fz ) ) {
  204. return true;
  205. }
  206. }
  207. }
  208. return false;
  209. }
  210. /*
  211. Creating/Destroying fires
  212. -------------------------
  213. Only related functions please.
  214. */
  215. public CreateFire(type, Float:x, Float:y, Float:z, Float:offset, vw, int) {
  216. new i = GetFreeFireSlot();
  217. if( i != INVALID_FIRE_SLOT ) {
  218. switch(type) {
  219. case FIRE_CAMP: {
  220. Fires[i][fireObject] = CreateDynamicObject( 18688, x, y, (z + offset), 0.0, 0.0, 0.0, vw, int );
  221. Fires[i][fireWoodObject] = CreateDynamicObject(841, x, y, (z + offset + 1.5), 0.0, 0.0, 0.0);
  222. Fires[i][fireHealth] = FIRE_SMALL_HEALTH;
  223. Fires[i][fireType] = FIRE_SMALL;
  224. }
  225. case FIRE_SMALL: {
  226. Fires[i][fireObject] = CreateDynamicObject( 18688, x, y, (z + offset), 0.0, 0.0, 0.0, vw, int );
  227. Fires[i][fireHealth] = FIRE_SMALL_HEALTH;
  228. Fires[i][fireType] = FIRE_SMALL;
  229. }
  230. case FIRE_MED: {
  231. Fires[i][fireObject] = CreateDynamicObject( 18692, x, y, (z + offset), 0.0, 0.0, 0.0, vw, int );
  232. Fires[i][fireHealth] = FIRE_MED_HEALTH;
  233. Fires[i][fireType] = FIRE_MED;
  234. }
  235. case FIRE_LARGE: {
  236. Fires[i][fireObject] = CreateDynamicObject( 18691, x, y, (z + offset), 0.0, 0.0, 0.0, vw, int );
  237. Fires[i][fireHealth] = FIRE_LARGE_HEALTH;
  238. Fires[i][fireType] = FIRE_LARGE;
  239. }
  240. }
  241. //Invalid fire type provided.
  242. if(!IsValidFire(i)) return INVALID_FIRE_SLOT;
  243. Fires[i][fireVW] = vw;
  244. Fires[i][fireInt] = int;
  245. Fires[i][fireOwner] = INVALID_PLAYER_ID;
  246. return i;
  247. }
  248. printf("FIRE WARNING: max fires has been reached !");
  249. return INVALID_FIRE_SLOT;
  250. }
  251. public DestroyFire(fid) {
  252. if( !( IsValidFire(fid) ) ) {
  253. printf("FIRE WARNING: destroying invalid fire ID.");
  254. return 0;
  255. }
  256. if( Fires[fid][fireObject] ) DestroyDynamicObjectEx( Fires[fid][fireObject] );
  257. if( Fires[fid][fireWoodObject] ) DestroyDynamicObjectEx( Fires[fid][fireWoodObject] );
  258. for( new i; FireInfo:i < FireInfo; i++ ) {
  259. Fires[fid][FireInfo:i] = 0;
  260. }
  261. return 1;
  262. }
  263. /*
  264. DANGER:
  265. -------
  266. You are entering the deep internal area.
  267. Only adjust things here, if you know
  268. what you're doing!
  269. */
  270. static Float:Get3DDistance( Float:x, Float:y, Float:z, Float:x2, Float:y2, Float:z2 ) {
  271. return floatsqroot( floatpower(x - x2, 2) + floatpower(y - y2, 2) + floatpower(z - z2, 2) );
  272. }
  273. public GetPlayerClosestFire( playerid ) {
  274. new
  275. Float:x, Float:y, Float:z, Float:dist = 99999.0,
  276. Float:px, Float:py, Float:pz, fid;
  277. GetPlayerPos( playerid, px, py, pz );
  278. for( new i; i < GetFirePoolSize(); i++ ) {
  279. if( i >= MAX_FIRES - 1 ) break;
  280. if( IsValidFire(i) ) {
  281. GetFirePos(i, x, y, z);
  282. new Float: cmpDist = Get3DDistance( x, y, z, px, py, pz );
  283. if( cmpDist < dist || i == INVALID_FIRE_SLOT ) {
  284. dist = cmpDist;
  285. fid = i;
  286. }
  287. }
  288. }
  289. return fid;
  290. }
  291. GetFreeFireSlot() {
  292. for(new i; i < MAX_FIRES; i++)
  293. {
  294. if(!IsValidFire(i)) {
  295. return i;
  296. }
  297. }
  298. return INVALID_FIRE_SLOT;
  299. }
  300. /*
  301. If the player is burning (on fire)...
  302. */
  303. //is player inside a fire or is on fire?
  304. OnFirePlayerSecondSync( playerid ) {
  305. new
  306. Float:fx, Float:fy, Float:fz, Float:radius;
  307. if(IsAFiremen(playerid)) {
  308. if(IsPlayerOnFire(playerid)) RemovePlayerFire(playerid);
  309. return 1;
  310. }
  311. //bikes or onfoot may catch fire
  312. new biking = IsABike(GetPlayerVehicleID(playerid));
  313. if(IsPlayerInAnyVehicle(playerid) && !biking) {
  314. if(IsPlayerOnFire(playerid)) RemovePlayerFire(playerid);
  315. return 1;
  316. }
  317. if(IsPlayerOnFire(playerid)) {
  318. OnPlayerBurn( playerid );
  319. return 1;
  320. }
  321. //set the player on fire
  322. for( new i; GetFirePoolSize() > i; i++ ) {
  323. if( IsValidFire(i) ) {
  324. //radius player must be within
  325. new type = GetFireType(i);
  326. if( type == FIRE_SMALL ) continue; //cancel camp fires from lighting players on fire
  327. if( type == FIRE_MED ) radius = 1.5;
  328. if( type == FIRE_LARGE ) radius = 2.5;
  329. GetFirePos(i, fx, fy, fz);
  330. if( GetFireVirtualWorld(i) != GetPlayerVirtualWorld( playerid ) ) continue;
  331. if( GetFireInterior(i) != GetPlayerInterior(playerid) ) continue;
  332. if( IsPlayerInRangeOfPoint( playerid, radius, fx, fy, fz + 1 ) ) {
  333. SetPlayerOnFire(playerid); //set the player on fire
  334. return 1;
  335. }
  336. }
  337. }
  338. return 1;
  339. }
  340. /*
  341. Setting players on fire...
  342. ------------------------
  343. Again, Internal.
  344. */
  345. public RemovePlayerFire(playerid) {
  346. DestroyObject( pFireObject[playerid] );
  347. HideBloodForPlayer(playerid);
  348. pFireObject[playerid] = INVALID_OBJECT_ID;
  349. pFireTime[playerid] = 0;
  350. return 1;
  351. }
  352. //set the player on fire
  353. public SetPlayerOnFire(playerid) {
  354. if(PlayerInfo[playerid][pAdmin] > 1 && PlayerInfo[playerid][pStealthed] != 1) return 1;
  355. if(IsPlayerOnFire(playerid)) return 1;
  356. pFireObject[playerid] = CreateObject(18688, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
  357. AttachObjectToPlayer( pFireObject[playerid], playerid, 0.0, 0.0, -1.5, 0.0, 0.0, 0.0 );
  358. pFireTime[playerid] = 10;
  359. ShowBloodForPlayer(playerid, 4, 2.0);
  360. SetPlayerArmedWeapon( playerid, 0 );
  361. return 1;
  362. }
  363. //fire damage effect on players
  364. //Only called if the player is on fire
  365. static OnPlayerBurn( playerid ) {
  366. if( gPlayerLogged[playerid] != 1 ) return 1;
  367. //is swimming?
  368. if( GetPlayerAnimationIndex( playerid ) ) {
  369. new animlib[40], animname[40];
  370. GetAnimationName( GetPlayerAnimationIndex(playerid), animlib, 40, animname, 40 );
  371. if( strcmp( animlib, "SWIM", true ) == 0) {
  372. pFireTime[playerid] = 0;
  373. RemovePlayerFire(playerid);
  374. HideBloodForPlayer(playerid);
  375. }
  376. }
  377. //effects
  378. pFireTime[playerid] -= 1;
  379. //new Float:health;
  380. //GetPlayerHealth(playerid, health);
  381. //SetPlayerHealth(playerid, health - 2 );
  382. if(pFireTime[playerid] <= 0) {
  383. RemovePlayerFire(playerid);
  384. }
  385. return 1;
  386. }
  387. //Illegal actions while burning...
  388. Hook:Burn_OnPlayerChangeWeapon( playerid, oldweapon, newweapon ) {
  389. if(IsPlayerOnFire(playerid))
  390. SetPlayerArmedWeapon( playerid, 0 );
  391. return 1;
  392. }
  393. Hook:Burn_OnPlayerEnterVehicle( playerid, vehicleid, ispassenger ) {
  394. if(IsPlayerOnFire(playerid))
  395. ClearAnimations( playerid );
  396. return 1;
  397. }
  398. //Putting the player out?
  399. Hook:Burn_OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart) {
  400. if( !IsPlayerOnFire(playerid) ) return 1;
  401. if( weaponid == 42 ) { //fire ext
  402. RemovePlayerFire(playerid);
  403. return 0; //return 0 to stop Fire Est issuing damage
  404. }
  405. return 1;
  406. }
  407. Hook:Burn_OnPlayerDisconnect(playerid, reason) {
  408. if(IsPlayerOnFire(playerid)) {
  409. RemovePlayerFire(playerid);
  410. }
  411. return 1;
  412. }
  413. Hook:Burn_OnPlayerDeath(playerid, killerid, reason) {
  414. if(IsPlayerOnFire(playerid)) {
  415. RemovePlayerFire(playerid);
  416. }
  417. return 1;
  418. }
  419. /*
  420. Ways of putting out fire
  421. --------------------------
  422. Again, Internal.
  423. */
  424. // Using fire truck/estingisher to put it out
  425. //Checks for an empty slot in the queue then sets a timer function for the helper function, OnPlayerPutOutFireEx
  426. // puttingOutSlots is already checked in its parent callee.
  427. static OnPlayerPutOutFire(playerid, fid, Float:offset, time, Float:fx, Float:fy, Float:fz) {
  428. //It's important the queue is maintained at all times.
  429. if(!IsValidFire(fid)) return 1;
  430. for(new i; i < MAX_PUTOUT; i++) {
  431. if(PlayerPuttingOutFire[playerid][i] == fid) {
  432. return 0;
  433. }
  434. }
  435. for(new i; i < MAX_PUTOUT; i++) {
  436. if(!FireTimer[playerid][i]) {
  437. FireTimer[playerid][i] = SetTimerEx("OnPlayerPutOutFireEx", time, true, "ifffii", playerid, fx, fy, fz+offset, fid, i);
  438. PlayerPuttingOutFire[playerid][i] = fid;
  439. puttingoutSlots[playerid]++;
  440. break;
  441. }
  442. }
  443. return 1;
  444. }
  445. //Helper function - INTERNAL, highly recommended not touching this unless you know mathematics.
  446. forward OnPlayerPutOutFireEx(playerid, Float:fx, Float:fy, Float:fz, fid, queueid);
  447. public OnPlayerPutOutFireEx(playerid, Float:fx, Float:fy, Float:fz, fid, queueid) {
  448. new
  449. Float:camx, Float:camy, Float:camz,
  450. Float:camvx, Float:camvy, Float:camvz,
  451. Float:fcx, Float:fcy, Float:fcz,
  452. Float:fire_distance,
  453. keys, updown, leftright;
  454. GetPlayerKeys(playerid, keys, updown, leftright);
  455. if(keys & KEY_FIRE) {
  456. GetPlayerCameraFrontVector(playerid, camvx, camvy, camvz); //third dimensional camera look at vectors
  457. GetPlayerCameraPos(playerid, camx, camy, camz); //existing camera position to use with vectors
  458. fire_distance = Get3DDistance( camx, camy, camz, fx, fy, fz );
  459. fcx = camvx * fire_distance + camx;
  460. fcy = camvy * fire_distance + camy;
  461. fcz = camvz * fire_distance + camz;
  462. new Float: camDistToFire = Get3DDistance( fcx, fcy, fcz, fx, fy, fz );
  463. if( camDistToFire < 1.3) {
  464. new firehealth = GetFireHealth(fid) -5;
  465. TextDrawShowForPlayer(playerid, aim_hud_green);
  466. SetFireHealth(fid, firehealth);
  467. if(firehealth <= 0) {
  468. KillTimer( FireTimer[playerid][queueid] );
  469. FireTimer[playerid][queueid] = 0;
  470. PlayerPuttingOutFire[playerid][queueid] = INVALID_FIRE_SLOT;
  471. puttingoutSlots[playerid]--;
  472. //no longer aiming at destroyed fire
  473. if(!puttingoutSlots[playerid]) {
  474. TextDrawHideForPlayer(playerid, aim_hud_green);
  475. }
  476. }
  477. return 1;
  478. }
  479. }
  480. else {
  481. KillTimer( FireTimer[playerid][queueid] );
  482. FireTimer[playerid][queueid] = 0;
  483. PlayerPuttingOutFire[playerid][queueid] = INVALID_FIRE_SLOT;
  484. puttingoutSlots[playerid]--;
  485. //no longer firing
  486. TextDrawHideForPlayer(playerid, aim_hud);
  487. }
  488. //player didn't manage to reduce fire health
  489. TextDrawHideForPlayer(playerid, aim_hud_green);
  490. return 1;
  491. }
  492. stock IsAFiremen(playerid) {
  493. new skin = GetPlayerSkin(playerid);
  494. if( skin == 277 || skin == 278 || skin == 279) return 1;
  495. return 0;
  496. }
  497. //The trigger for putting out fire
  498. Hook:Fire_OnPlayerKeyStateChange(playerid, newkeys, oldkeys) {
  499. if(HOLDING(KEY_FIRE)) {
  500. if(puttingoutSlots[playerid] == MAX_PUTOUT) return 1;
  501. new Float:fire_radius;
  502. new Float:offset = 2.0;
  503. new time = 2000;
  504. if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) {
  505. new weapon = GetPlayerWeapon(playerid);
  506. if(weapon != 42) return 1;
  507. fire_radius = FIRE_RADIUS_ON_FOOT;
  508. }
  509. else if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {
  510. if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 407) return 1;
  511. fire_radius = FIRE_RADIUS_IN_VEHICLE;
  512. offset = 2.5; //vector fix
  513. time = 1000; //puts out fire quicker
  514. }
  515. else return 1;
  516. if(!puttingoutSlots[playerid]) {
  517. TextDrawShowForPlayer(playerid, aim_hud);
  518. }
  519. new Float:fx, Float:fy, Float:fz;
  520. for(new i; i < GetFirePoolSize(); i++) {
  521. //if(GetFireType(i) == FIRE_SMALL) continue;
  522. if(GetFireVirtualWorld(i) != GetPlayerVirtualWorld(playerid)) continue;
  523. if(GetFireInterior(i) != GetPlayerInterior(playerid)) continue;
  524. GetFirePos(i, fx, fy, fz);
  525. if(IsPlayerInRangeOfPoint(playerid, fire_radius, fx, fy, fz) ) {
  526. OnPlayerPutOutFire(playerid, i, offset, time, fx, fy, fz);
  527. }
  528. }
  529. }
  530. else {
  531. TextDrawHideForPlayer(playerid, aim_hud);
  532. }
  533. return 1;
  534. }
  535. #include "inc\fire_system\commands\putout.inc"
  536. #include "inc\fire_system\commands\create.inc"
  537. #include "inc\fire_system\camp.inc"