Explosion to object
#1

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
Reply
#2

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
Reply
#3

ye i know but but i dont know how to combinate this 3 thing
Reply
#4

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)