SA-MP Forums Archive
Remove objects! - 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)
+--- Thread: Remove objects! (/showthread.php?tid=567307)



Remove objects! - cnoopers - 12.03.2015

Is there any way to loop all objects by some ID and delete them?


Re: Remove objects! - Smileys - 12.03.2015

You can't delete all objects, it'll just freeze the client lol...

It's too much to handle, it can't be done.


Re: Remove objects! - CalvinC - 13.03.2015

There's no function to get an object id.
You need to create them, and assign them to an array or variables in order to use them.


Re: Remove objects! - Gammix - 13.03.2015

I dont think so anyone of you know the function:
pawn Код:
IsValidObject(objectid);
Very easy to do so:
pawn Код:
DestroyAllObjects()
{
       for(new i; i < MAX_OBJECTS; ++i)
       {
              if(IsValidObject(i))
              {
                      DestroyObject(i);
               }
       }
}



Re: Remove objects! - CalvinC - 13.03.2015

That destroys all objects, he was asking to destroy objects by the object id.