18.02.2015, 14:48
That system is not perfect, and it's one of issues you'll face. You can monkey-patch this by creating some hidden vehicles to fill the id gaps, and then remove them so you can reclaim vehicle id for new cars. Better solution is to not rely on constantess of the vehicle id. Keep additional value - unique index - of a vehicle, and operate on that value instead. Only drawback would be that you couldn't use value of GetPlayerVehicleID directly, but you'd have to store meta data like
pawn Код:
new VehicleIndexes[MAX_VEHICLES] = { 0, ... };
//Load vehicle with unique index 8
new newcarid = CreateVehicle(...);
VehicleIndexes[newcarid] = Value of your unique index.