SA-MP Forums Archive
Destroy object which is attached to vehicle. - 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: Destroy object which is attached to vehicle. (/showthread.php?tid=484547)



Destroy object which is attached to vehicle. - audriuxxx - 31.12.2013

Hi,

Can i destroy a object which was created, and attached to vehicle?


Re: Destroy object which is attached to vehicle. - Konstantinos - 31.12.2013

Yes, by destroying the object normally with DestroyObject (or DestroyDynamicObject for Incognito's streamer).

However, you need to store the object IDs to an array (2D array for vehicleid and objectid).


Re: Destroy object which is attached to vehicle. - audriuxxx - 31.12.2013

I don't want to create a new thread, i want to ask, when i create a vehicle with AddStaticVehicle or CreateVehicle, callback OnVehicleSpawn get called?


Re: Destroy object which is attached to vehicle. - Konstantinos - 31.12.2013

OnVehicleSpawn gets called when a vehicle that was created with CreateVehicle or AddStaticVehicleEx has respawned. AddStaticVehicle function doesn't have respawn delay.