[Include] Scripted Fire
#1

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
Reply
#2

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?
Reply
#3

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

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

nice! i needed something like this
Reply
#6

Good one.

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

The fire extinguisher then?

Thanks

[ BTW, Where is it spawning? ]
Reply
#7

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
Reply
#8

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

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);
Reply
#10

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?
Reply
#11

Bump, anyone?
Reply
#12

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

for me doesn't work too
Reply
#14

nice work man!
Reply
#15

Look cool, it is cool!

Keep it up!.
Reply
#16

Wow! looks great
Reply
#17

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.
Reply
#18

Can you create a callback

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

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.
Reply
#20

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
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)