Remove particle when ended - 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: Remove particle when ended (
/showthread.php?tid=269985)
Remove particle when ended -
DaneAMattie - 18.07.2011
Hello people,
So when i create a particle (a non looping one).
it automaticly stops but the particle is actialy still there.
How do i remove the particle right when it ends?
Re: Remove particle when ended -
Donya - 18.07.2011
you have to get all particle time lengths and do like
make a custom createobject and settimerex to destroy the object.
Re: Remove particle when ended -
Mauzen - 18.07.2011
I use to use this:
pawn Код:
forward DestroyObjectPub(objectid);
public DestroyObjectPub(objectid)
{
DestroyObject(objectid);
}
Then, when creating the particle object:
pawn Код:
SetTimerEx("DestroyObjectPub", time, 0, "i"; objectid_of_the_particle_object);
Where "time" is the estimated time the particle effect runs.
You could also combine this in a CreateTimedObject function that automatically creates and removes the object after a given time.