SA-MP Forums Archive
Making loop bomb explosions - 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: Making loop bomb explosions (/showthread.php?tid=163381)



Making loop bomb explosions - Snoopdog - 27.07.2010

Hi guys,

Soz if there is a post about this but the search system kinda suckz

Could some body be kind enough to make a tut on how to make loop explosions for me or send me to another topic? Thanks alot guys

and please dont just copy and paste the search url its just dry and immature


Re: Making loop bomb explosions - Snoopdog - 27.07.2010

Any one?


Re: Making loop bomb explosions - Conroy - 27.07.2010

Put the explosion in a public function and use a timer to call it.

pawn Код:
//Top of the script
forward Explosion(Float:X, Float:Y, Float:Z, type, Float:radius);
pawn Код:
//Outside other public functions
public Explosion(Float:X, Float:Y, Float:Z, type, Float:radius)
{
    CreateExplosion(X, Y, Z, type, radius);
    return 1;
}
pawn Код:
//In a command. This will create 3 explosions with a 1 second interval between them.
CreateExplosion(Float:X, Float:Y, Float:Z, type, Float:radius); //Replace them with the appropriate information
SetTimerEx("Explosion", 1000, false, "fffdf", Float:X, Float:Y, Float:Z, type, Float:radius); //Again, replace the same variables
SetTimerEx("Explosion", 2000, false, "fffdf", Float:X, Float:Y, Float:Z, type, Float:radius); //Again, replace the same variables



Re: Making loop bomb explosions - Snoopdog - 28.07.2010

ok i am completley confused with that, could you/someone else do a step by step tut it would be greatlty appresiated


Re: Making loop bomb explosions - mastasquizy - 28.07.2010

Quote:
Originally Posted by Snoopdog
Посмотреть сообщение
ok i am completley confused with that, could you/someone else do a step by step tut it would be greatlty appresiated
I'm not seeing how he didn't go step-by-step already....getting the notion that your a new scripter.......


Re: Making loop bomb explosions - Snoopdog - 29.07.2010

Anyone else?


Re: Making loop bomb explosions - VictorMartinez - 29.07.2010

new explosionsleft = 3;

public CreateExplosions()
{
if(explosionsleft != 0)
{
CreateExplosions(playerid,...);
SetTimer(...) //make it do it again
explosionsleft--;
}
else if(explosionsleft == 0)
{
KillTimer(...);
explosionsleft = 3;
}
return 1;
}


Re: Making loop bomb explosions - Conroy - 29.07.2010

Carlton, FOR statements are done within a second, so that is probably the worst way to make the loop.


Re: Making loop bomb explosions - Carlton - 29.07.2010

Quote:
Originally Posted by Conroy
Посмотреть сообщение
Carlton, FOR statements are done within a second, so that is probably the worst way to make the loop.
A loop are "for" or "while" statements. He asked for a loop, I gave him a loop.


Re: Making loop bomb explosions - Snoopdog - 29.07.2010

Ok, thank you guys heaps for you contributions but could someone actually make me a tut please like step by step or redirect me to one, Again i do appreciate your contributions but i need a tutorial