SA-MP Forums Archive
Explosion to object - 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: Explosion to object (/showthread.php?tid=162948)



Explosion to object - erdei18 - 25.07.2010

does anyone know how can i add explosion to an object which is moving up and down by script? i want to add explosion / sec


Re: Explosion to object - dice7 - 25.07.2010

Use a repeating one second timer to create explosions on the objects position

https://sampwiki.blast.hk/wiki/SetTimer
https://sampwiki.blast.hk/wiki/GetObjectPos
https://sampwiki.blast.hk/wiki/CreateExplosion


Re: Explosion to object - erdei18 - 25.07.2010

ye i know but but i dont know how to combinate this 3 thing


Re: Explosion to object - Shadow™ - 25.07.2010

Add this at the top of your script, anywhere under #include <a_samp>

pawn Код:
new object; // This is the object which will explode.
Next, we have to create the object and a timer. Add these under OnGameModeInit()

pawn Код:
object = CreateObject(1049,0,0,0,0,0,0); // Obviously, you'll have to change this to suit yourself.
SetTimer("Explosion",10000,1); // Creates a timer for the object to explode in 10 seconds, and repeats it.
Next, add this anywhere in your script under #include <a_samp> - Maybe at the bottom of the script.

pawn Код:
forward Explosion();
public Explosion()
{
    new Float:ObjX,Float:ObjY,Float:ObjZ;
    GetObjectPos(object,ObjX,ObjY,ObjZ); // Gets the position of the object.
    CreateExplosion(ObjX,ObjY,ObjZ,0,25.0); // Creates an explosion at the position we found.
    return 1;
}