Creating Fires - 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: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Creating Fires (
/showthread.php?tid=183099)
Creating Fires -
Don Lidner - 14.10.2010
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.
Re: Creating Fires -
Austin - 14.10.2010
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);
}
Re: Creating Fires -
Don Lidner - 14.10.2010
Ok, Thanks.
Re: Creating Fires -
Don Lidner - 14.10.2010
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?
Re: Creating Fires -
MrDeath537 - 14.10.2010
Change the name of the public to "RandomExplosion"
PS: 1000 posts
Re: Creating Fires -
Austin - 14.10.2010
Don't adjust my code. That will fix it.
Re: Creating Fires -
Don Lidner - 14.10.2010
I did that, and insterted my info and got like 3 errors.
Re: Creating Fires -
Don Lidner - 14.10.2010
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
Re: Creating Fires -
Cameltoe - 14.10.2010
Quote:
Originally Posted by MrDeath
|
Off-Topic : Grжжtz
Re: Creating Fires -
Austin - 14.10.2010
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.