Creating Fires
#1

Ok, I've been working on this for a while. But how do you make an explosion happen several times in a row, randomly. Please I need help, this is just to puzzling for me.
Reply
#2

pawn Код:
public RandomExplosion(Float: x, Float: y, Float: z, type, Float: radius, Dist) // Dist = Maximum distance from centre point for explosion
{
    CreateExplosion(x + (random(Dist*2+1)-Dist), y + (random(Dist*2+1)-Dist), z, type, radius)
    return 1;
}
Something like that?

Could set up a for loop to set up a bunch of timers...

pawn Код:
for(new x=0; x < 10; x++)
{
    SetTimerEx("RandomExplosion", 1000*x, 0, "fffifi", 596,1584.2898,-1671.6333,5.6145, 3, 5.0, 5);
}
Reply
#3

Ok, Thanks.
Reply
#4

ok i modified it a little, removing some errors, this is what i got:
Код:
public CreateExplosion(2667.524, 1246.180, 55.478, 2, 100);
{
    SetTimerEx("CreateExplosion", 1000*x, 20, "fffifi", 596, 2667.524, 1246.180, 55.479, 3, 5.0, 5);
}
This is the Error I still get:
error 021: symbol already defined: "CreateExplosion"

How do you fix?
Reply
#5

Change the name of the public to "RandomExplosion"


PS: 1000 posts
Reply
#6

Don't adjust my code. That will fix it.
Reply
#7

I did that, and insterted my info and got like 3 errors.
Reply
#8

Got his now as Errors:
C:\Users\Corbin\Documents\LH-RP\filterscripts\Explosion1.pwn(233) : error 010: invalid function or declaration
C:\Users\Corbin\Documents\LH-RP\filterscripts\Explosion1.pwn(234) : error 055: start of function body without function header
Reply
#9

Quote:
Originally Posted by MrDeath
Посмотреть сообщение
Change the name of the public to "RandomExplosion"


PS: 1000 posts
Off-Topic : Grжжtz
Reply
#10

pawn Код:
public RandomExplosion(Float: x, Float: y, Float: z, type, Float: radius, Dist) // Dist = Maximum distance from centre point for explosion
{
    CreateExplosion(x + (random(Dist*2+1)-Dist), y + (random(Dist*2+1)-Dist), z, type, radius)
    return 1;
}
pawn Код:
for(new x=0; x < 10; x++)
{
    SetTimerEx("RandomExplosion", 1000*x, 0, "fffifi", 596,1584.2898,-1671.6333,5.6145, 3, 5.0, 5);
}
This is the correct code. The for loop goes inside of wherever it is required.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)