26.10.2013, 14:24
Before I start, may I ask why do you use the same name twice?
No, there are only those 3 functions you used for vehicle creation. I only tested it with CreateVehicle and when a vehicle re-spawns, it gets the same vehicleid as it had before being set to respawn or its death. Honestly, removing the vehicleid from the iterator when OnVehicleDeath is called is pointless unless you destroy the vehicle when that callback is called (like some do). Otherwise, removing and re-adding (in OnVehicleSpawn) the vehicle is useless. The vehicleids are only overwritten when a vehicle was destroyed and a new one was created, not on respawn.
Last one, is the declaration of CarInfo since it's 1-2000 and 0 is not used, wouldn't it be MAX_VEHICLES + 1? Because I've the feeling it'll give index out of bounds for accessing element at index 2000 past array upper bound 1999.
pawn Код:
CarInfo[MAX_VEHICLES]
Iterator:CarInfo<MAX_VEHICLES>
Last one, is the declaration of CarInfo since it's 1-2000 and 0 is not used, wouldn't it be MAX_VEHICLES + 1? Because I've the feeling it'll give index out of bounds for accessing element at index 2000 past array upper bound 1999.