How to delete all objects onfsexit?
#1

How would you destroy all objects onfsexit?

I have an array with 115 objects assigned to it, how, possibly would i delete them with a loop?

I tried

pawn Код:
for(new i = 0; i < Rocket[115]; i++)
{
DestroyDynamicObject(Rocket[i]);
}
return1;
but it says the array is out of index bounds.
Reply
#2

pawn Код:
for(new i = 0; i < sizeof(Rocket)-1; i++)
{
    DestroyDynamicObject(Rocket[i]);
}
return 1;
Reply
#3

Quote:
Originally Posted by PotH3Ad
Посмотреть сообщение
pawn Код:
for(new i = 0; i < sizeof(Rocket)-1; i++)
{
    DestroyDynamicObject(Rocket[i]);
}
return 1;
Thanks. Wouldn't -1 on rocket make the loop only delete 0-114?

EDIT:

Code worked, still wondering about that question.
Reply
#4

-1 means all

like in incognito's streamer -1 for playerid -1 means all playerids
Reply
#5

Ah, didn't know that, thank you.
Reply
#6

Arrays start with 0. (Rocket[0-114])

Quote:
Originally Posted by The Toni
Посмотреть сообщение
Thanks. Wouldn't -1 on rocket make the loop only delete 0-114?
Yea...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)