DestroyVehicle and code
#1

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?
Reply
#2

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.
Reply
#3

ya i know, but it's not my question
Reply
#4

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)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)