24.05.2016, 23:44
Thank you! It works! But would I have to do this every time I want to mess with my dynamic vehicle system or could I just make it so the ID is 'corrected' when they initiate?
Edit: Also, say I have an admin spawned vehicle (different from a dynamic vehicle) that is occupying slot 1. I also have a dynamic vehicle occupying slot 2. If I delete the admin spawned vehicle, and then use the command /editvehicle, my dynamic vehicle will respawn to ID 1. I just tested this in game, but the script still thinks it has ID 2.
Here's my respawn function:
Edit: Also, say I have an admin spawned vehicle (different from a dynamic vehicle) that is occupying slot 1. I also have a dynamic vehicle occupying slot 2. If I delete the admin spawned vehicle, and then use the command /editvehicle, my dynamic vehicle will respawn to ID 1. I just tested this in game, but the script still thinks it has ID 2.
Here's my respawn function:
PHP код:
RespawnVehicle(id)
{
DestroyVehicle(Vehicle[id][VehID]);
if(Vehicle[id][VehiclePos][0] != 0.00000 && Vehicle[id][VehiclePos][1] != 0.00000 && Vehicle[id][VehiclePos][2] != 0.00000)
{
Vehicle[id][VehID] = CreateVehicle(Vehicle[id][Model], Vehicle[id][VehiclePos][0], Vehicle[id][VehiclePos][1], Vehicle[id][VehiclePos][2], Vehicle[id][VehiclePos][3], Vehicle[id][VehicleColour][0], Vehicle[id][VehicleColour][1], -1, Vehicle[id][Siren]);
SetVehicleVirtualWorld(Vehicle[id][VehID], Vehicle[id][VehicleVW]);
LinkVehicleToInterior(Vehicle[id][VehID], Vehicle[id][VehicleInt]);
}
return 1;
}