Posts: 498
Threads: 233
Joined: Aug 2013
Reputation:
0
Vehicle IDs are set when the vehicle is spawned, but what are the things that cause the vehicle id to change other than respawning it?is there any other case where the vehicle id gets changed?
Posts: 319
Threads: 7
Joined: Jul 2012
Reputation:
0
Vehicle id's are assigned when the vehicle is created and never changes as long as it exists.
Even when a vehicle gets destroyed (explodes or driven into water) and it respawns, the id remains the same.
It becomes invalid when you use DestroyVehicle to delete the vehicle from the server and the id will be re-used when it's the first id available when you create a new vehicle.
If the id would change during the existance of a vehicle, the id would mean nothing and you would be unable to control your vehicles properly.
Posts: 498
Threads: 233
Joined: Aug 2013
Reputation:
0
Thank you, another question, since vehicles are set to respawn automatically after dying, how do I prevent it?only by putting a code under onvehiclespawn or ovehicledeath? and how can I change where it spawns automatically?