Posts: 267
Threads: 64
Joined: Jul 2010
Reputation:
0
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?
Posts: 59
Threads: 1
Joined: Jul 2010
Reputation:
0
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.
Posts: 267
Threads: 64
Joined: Jul 2010
Reputation:
0
ya i know, but it's not my question
Posts: 246
Threads: 13
Joined: Aug 2010
Reputation:
0
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)