SA-MP Forums Archive
[Include] Scripted Fire - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] Scripted Fire (/showthread.php?tid=165299)

Pages: 1 2


Scripted Fire - Sniperwolves - 04.08.2010

Hey everyone,
I just got the idea to create scripted fire yesterday. It's a small script without any timers (just using OnPlayerUpdate);

VIDEO:
[ame]http://www.youtube.com/watch?v=ruznp2DO1Y0[/ame]

Every fire you create got an amount of Health (you can chose how much)
Natives:
Code:
AddFire(Float:X, Float:Y, Float:Z, Firehealth);
DeleteFire(FireID);
DeleteAllFire();
IsValidFire(FireID);
GetClosestFire(playerid);
Installation:
1. Put #include <fire2> on top of your script
2. Put f_init(); in OnGameModeInit() and f_OnPlayerUpdate(playerid); in OnPlayerUpdate(playerid)
3. Create some commands for spawning fire ...

Extra:
You can uncomment #define Labels and #define Healthdown
Labels = 3D Labels above the fire showing it's health
Healthdown = Players and vehicles lose HP if they are near/in the fire

Pastebin link: http://pastebin.com/MJeGjmcR


Have fun


Re: Scripted Fire - Vince - 04.08.2010

That looks great! I'm sure a lot of people will find this very useful.
One downside, though. I believe you cannot extinguish the fire from firetrucks?


Re: Scripted Fire - Sniperwolves - 04.08.2010

im trying to fix that but somehow it only works if the firetruck faces it and not its water :/


Re: Scripted Fire - Mauzen - 04.08.2010

Nice script, I think RP servers could make good use of this.


Re: Scripted Fire - willsuckformoney - 04.08.2010

nice! i needed something like this


Re: Scripted Fire - Falcon Interceptor - 04.08.2010

Good one.

But, how do we extinguish the fires without Fire Truck then?

The fire extinguisher then?

Thanks

[ BTW, Where is it spawning? ]


Re: Scripted Fire - willsuckformoney - 04.08.2010

from the video, it spawns where you type the command at, so basically when you type the command it spawns there or like maybe 1 foot away from your or 2


Re: Scripted Fire - Falcon Interceptor - 04.08.2010

Thanks.
But, what is the command to spawn it?


Re: Scripted Fire - willsuckformoney - 04.08.2010

Thats up to you

pawn Код:
if(strcmp(cmdtext, "/fire" true) == 0)  //strcmp
{
         new Float:X,Float:Y,Float:Z;
         AddFire(Float:X, Float:Y, Float:Z, 1000);
         return 1;
}

CMD:fire(playerid,params[])  //zcmd
{
         new Float:X,Float:Y,Float:Z;
         AddFire(Float:X, Float:Y, Float:Z, 1000);
         return 1;
}

dcmd_fire(playerid,params[])  //dcmd
{
        new Float:X,Float:Y,Float:Z;
         AddFire(Float:X, Float:Y, Float:Z, 1000);
         return 1;
}
//onplayercommandtext for dcmd, not sure for zcmd
dcmd(fire,4,cmdtext);



Re: Scripted Fire - juanrivas - 19.08.2010

I doesnt work for me, I added the command, the include
I Putted f_init(); in OnGameModeInit() and f_OnPlayerUpdate(playerid); in OnPlayerUpdate(playerid)

Then I go ingame and do /fire and nothing appears.

Can Anyone help?


Re: Scripted Fire - juanrivas - 20.08.2010

Bump, anyone?


Re: Scripted Fire - MrDeath537 - 20.08.2010

Nice! . I think a lot of people will use it, it's very usefull.


Re: Scripted Fire - jasonnw666 - 20.08.2010

for me doesn't work too


Re: Scripted Fire - royal_king - 20.08.2010

nice work man!


Re: Scripted Fire - playbox12 - 20.08.2010

Look cool, it is cool!

Keep it up!.


Re: Scripted Fire - Cameltoe - 20.08.2010

Wow! looks great


Re: Scripted Fire - Cr0ssFir3 - 20.08.2010

Quote:
Originally Posted by Sniperwolves
View Post
im trying to fix that but somehow it only works if the firetruck faces it and not its water :/
Check if player is in firetruck.
Check if is camera is locking in fire direction.
And if he is pressing firekey.


Re: Scripted Fire - Las Venturas CNR - 20.08.2010

Can you create a callback

pawn Код:
OnPlayerPutOutFire(playerid);
{
}
return 1;



Re: Scripted Fire - Cameltoe - 20.08.2010

Quote:
Originally Posted by Las Venturas CNR
Посмотреть сообщение
Can you create a callback

pawn Код:
OnPlayerPutOutFire(playerid);
{
}
return 1;
pawn Код:
OnPlayerPutOutFire(playerid);
{
if(!IsValidFire(GetClosestFire(playerid)))
{
return 1;
}
else return 0;
}
Should work, But i Havent tested this, or the script yet so i don't know if it works.


Re: Scripted Fire - juanrivas - 20.08.2010

Quote:
Originally Posted by juanrivas
Посмотреть сообщение
I doesnt work for me, I added the command, the include
I Putted f_init(); in OnGameModeInit() and f_OnPlayerUpdate(playerid); in OnPlayerUpdate(playerid)

Then I go ingame and do /fire and nothing appears.

Can Anyone help?
Anyone can help me