AddStaticVehicleEx ID's problem
#1

For some reason, when a vehicle is destroyed and then re-spawned, or just re-spawned, the vehicle ids tend to mix up and variables that store those IDs now have a different ID. For example:

pawn Код:
new TaxiCar;

OnGameModeInit
{
    TaxiCar = AddStaticVehicleEx(taxi car info and spawn info...");
}
Now, I have a check on OnPlayerStateChage, for player entering a taxi car as a passenger, which starts the timer for taxi ride cost. After the car is re-spawned by GTA or destroyed and then re-spawned, TaxiCar variable gets a different ID and the original taxi car has also a different ID. This happens with police and other vehicles, such as private, faction or admin vehicles. Is there a way to fix this somehow? I don't set/reset any variables on OnVehicleDeath or on OnVehicleSpawn, it's basically empty.
Reply
#2

Maybe this;

pawn Код:
new TaxiCar;

OnGameModeInit
{
    TaxiCar = AddStaticVehicleEx(taxi car info and spawn info...); (REMOVED Speech Marks)
}
Never really tried that type of code.
So don't guarantee that it will work. :/
If not, then good luck!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)