Destroy Object
#1

Hee all,

I was wondering, if i destroy an object. Should i redifine it to 0 like:

DestroyObject(Spikestrip[playerid][0]);
Spikestrip[playerid][0] = 0;

To prevent objects from mixing up when i recreate them?
Or could i just destroy it and recreate it without any possible troubles?

Thanks in advance,

Jop9888
Reply
#2

The DestroyObject native does not, indeed, reset the variable value. In some cases, where your system depends on reading values from the array, you should do that. If you code, however, does not check if the Spikestrip value is set for the player, that won't be necessary.

Something makes me assume that it does check the value before creating an object though, so you're better of doing it.
Reply
#3

Thanks mate, i remember my script failing with createvehicle because i forgot to redefine it's constants to 0. Didn't want it to happen to me with createobject also
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)