[Tutorial] How to make a fire script
#1

Hey guys,

Toady in this tutorial you will learn how to make your own custom fire script, now this is my first ever tutorial so I won't be that good at it. This is a tutorial on how to use the include from this link.

Okay lets start...

Make sure to put at the top of you filterscript the include, if you do not have this include you can get it from here.
Код:
#include <fire2>
Now to create a hand made one and not ones like in that include, so before we do anything make sure to add these codes to your OnGameModeInit() & OnPlayerUpdate(playerid).
OnGameModeInit
Код:
public OnGameModeInit()
{
    f_init();
	return 1;
}
OnPlayerUpdate(playerid)
Код:
public OnPlayerUpdate(playerid)
{
    f_OnPlayerUpdate(playerid);
	return 1;
}
Now to create random fires we will use some timers for this so then you do not have to use commands, so first we need to forward the timer so insert this code some where in your script:
Код:
forward fire1();
Now to make the timer, so put this code in the OnGamemodeInit, make sure to add this under the f_init():
Код:
SetTimer("fire1", 19200, false);
Now to make the fire spawns (NOTE: this fire spawns infront of LSPD):
Код:
public fire1()
{
    AddFire(1530.28, -1691.66, 12.97, 100);
    AddFire(1535.53, -1676.05, 12.97, 100);
    AddFire(1528.93, -1669.97, 12.97, 100);
    AddFire(1532.94, -1662.82, 12.97, 100);
    AddFire(1536.51, -1668.26, 12.97, 100);
    AddFire(1529.57, -1681.05, 12.97, 100);
    AddFire(1526.92, -1658.31, 12.97, 100);
    AddFire(1532.86, -1657.56, 12.97, 100);
}
This is the code for the fire --> AddFire(Float:X, Float:Y, Float:Z, Firehealth);

And all that coding should look like this:
Код:
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Fire script by calzo100
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

#include <a_samp>
#include <fire2>
#if defined FILTERSCRIPT

forward fire1();

public OnFilterScriptInit()
{
	print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
	print("		   Fire Script by calzo100		   ");
	print("			      Has loaded!              ");
	print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}
#endif

public OnGameModeInit()
{
	// fire init
    f_init();
    
    // Timers
    SetTimer("fire1", 19200, false);
	return 1;
}

public OnGameModeExit()
{
	return 1;
}

public OnPlayerUpdate(playerid)
{
    f_OnPlayerUpdate(playerid);
	return 1;
}

// All the fires
public fire1()
{
    AddFire(1530.28, -1691.66, 12.97, 100);
    AddFire(1535.53, -1676.05, 12.97, 100);
    AddFire(1528.93, -1669.97, 12.97, 100);
    AddFire(1532.94, -1662.82, 12.97, 100);
    AddFire(1536.51, -1668.26, 12.97, 100);
    AddFire(1529.57, -1681.05, 12.97, 100);
    AddFire(1526.92, -1658.31, 12.97, 100);
    AddFire(1532.86, -1657.56, 12.97, 100);
}
I hope this has helped you, and enjoy your fire script
Reply
#2

What does this do?Can you post ss please.
Reply
#3

It adds a campfire i think.
Reply
#4

U just say where the code goes? This is not a tutorial!
Reply
#5

Add an explanation to what is doing what.
Reply
#6

Doesnt really explain but then again its alright for noobs if they want it 5/10 and also use the [ pawn ] [/ pawn] tags please
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)