SA-MP Forums Archive
DestroyVehicle and code - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: DestroyVehicle and code (/showthread.php?tid=166915)



DestroyVehicle and code - ombre - 10.08.2010

Hi,

I see a lot code for to destroy a car:

RemovePlayerFromVehicle
DestroyVehicle(vehicleid);

Before maybe there are a lot crash but now it's useful no?

And

DestroyVehicle(vehicleid);
SetVehicleToRespawn(vehicleid);

What's the utility?


Re: DestroyVehicle and code - [HUN]Jaki - 10.08.2010

DestroyVehicle() removes the car from the server, so there will be no vehicle with "vehicleid".
If you want to blow the car up, use SetVehicleHealth();

Also, you can use DestroyVehicle to destroy vehicles created with CreateVehicle only.


Re: DestroyVehicle and code - ombre - 13.08.2010

ya i know, but it's not my question


Re: DestroyVehicle and code - Claude - 13.08.2010

SetVehicleToRespawn(); sets the vehicle back to the restored location (e.g. AddStaticVehicle and CreateVehicle) while DestroyVehicle(); completely removes it
So your question is: Is it useful or not? That depends on the character of your script, if it is a rp server, or tdm, then I prefer using SetVehicleToRespawn();, else I prefer DestroyVehicle(); (or if your server has a car spawn menu)