Vehicle IDs cross
#4

Quote:
Originally Posted by PowerPC603
Посмотреть сообщение
For a park command, create enough backup variables inside your function to hold all data about your current vehicle, like position, rotation, color, tunings, ...

Let's assume your vehicle had vehicleid 5.

Then destroy the vehicle and cleanup your data (set it to 0) in the array where the vehicle was stored (index 5 of your vinfo array).

Then re-create a new one at the new position where you want to park it using CreateVehicle.
You will be given a new vehicleid, let's assume it's 3 now.

Then store the temporary data from your backup variables into index 3 of your vinfo array.



You could also keep the data at index 5, destroy the vehicle, re-create it using data from index 5, then copy the data from index 5 to index 3 and finally clear all data at index 5.
Well, I wanted it to always be at 5, to attach objects to vehicles and things. I've figured it out, instead of destroying and re creating the car on park, it updates the spawn position, then, towing the vehicle repairs and teleports. Seems to work just fine, and solve the problem
Reply


Messages In This Thread
Vehicle IDs cross - by TakeiT - 24.01.2015, 16:37
Re: Vehicle IDs cross - by Dignity - 24.01.2015, 16:41
Re: Vehicle IDs cross - by PowerPC603 - 24.01.2015, 17:20
Re: Vehicle IDs cross - by TakeiT - 25.01.2015, 13:56

Forum Jump:


Users browsing this thread: 1 Guest(s)