SA-MP Forums Archive
Delete all 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: Delete all objects.. (/showthread.php?tid=600751)



Delete all objects.. - ProRakNet - 12.02.2016

Hi, How do I delete all at once ? Thanks..
PHP код:
VehModelObject[0] = CreateObject(188090.101402.54382, -1.32190,   0.00000, -90.0000090.00000);
VehModelObject[1] = CreateObject(188090.101807.44782, -4.32190,   0.00000, -90.0000090.00000);
VehModelObject[2] = CreateObject(188090.101704.84382, -3.32190,   0.00000, -90.0000090.00000);
etc



Re: Delete all objects.. - Joron - 12.02.2016

What u mean delete them? delete the code ?


Re: Delete all objects.. - ProRakNet - 12.02.2016

Quote:
Originally Posted by Joron
Посмотреть сообщение
What u mean delete them? delete the code ?
DestroyObject and at one time all object VehModelObject[0]... [30] how can I do ? Sorry English.


Re: Delete all objects.. - Joron - 12.02.2016

Just backspace and delete them?


Re: Delete all objects.. - ProRakNet - 12.02.2016

Quote:
Originally Posted by Joron
Посмотреть сообщение
Just backspace and delete them?
Not stable.

Did you deleted with a single function?


Re: Delete all objects.. - AmigaBlizzard - 13.02.2016

A simple for-loop should do it just fine:
PHP код:
for (new isizeof(VehModelObject); i++)
{
    
DestroyObject(VehModelObject[i]);
    
VehModelObject[i] = 0// Don't forget to NULL the array, otherwise you could get weird results if you did it again after creating new objects




Re: Delete all objects.. - ProRakNet - 14.02.2016

Quote:
Originally Posted by AmigaBlizzard
Посмотреть сообщение
A simple for-loop should do it just fine:
PHP код:
for (new isizeof(VehModelObject); i++)
{
    
DestroyObject(VehModelObject[i]);
    
VehModelObject[i] = 0// Don't forget to NULL the array, otherwise you could get weird results if you did it again after creating new objects

Thanks..