26.10.2013, 15:13
I didn't think of that before, you're right about foreach.
Well I created a vehicle with CreateVehicle and respawn_delay to -1. When I exit the vehicle the vehicle does not respawn at all after a while (normal), however I let the car upside down and it got fire. The vehicle was respawned, even if it was created with -1 as respawn delay. Both OnVehicleDeath and OnVehicleSpawn callbacks were called. I think I do know what you were worried about, the thing it says about when a vehicle is in the water the OnVehicleDeath is called, however if you teleport the car or jump (depending on the type of the server) then you can "save" it. And even if the vehicle with -1 as respawn delay be in a water without the driver, both those callbacks are called. If the player is in the vehicle, after the player dies because he ran out of the oxygen, then the vehicle is dying too. And still both callbacks are called.
Thanks for the overwriting thing, I always used 1-2000 for that and 0 was indeed not used at all (though I don't use any array with MAX_VEHICLES anymore).
Well I created a vehicle with CreateVehicle and respawn_delay to -1. When I exit the vehicle the vehicle does not respawn at all after a while (normal), however I let the car upside down and it got fire. The vehicle was respawned, even if it was created with -1 as respawn delay. Both OnVehicleDeath and OnVehicleSpawn callbacks were called. I think I do know what you were worried about, the thing it says about when a vehicle is in the water the OnVehicleDeath is called, however if you teleport the car or jump (depending on the type of the server) then you can "save" it. And even if the vehicle with -1 as respawn delay be in a water without the driver, both those callbacks are called. If the player is in the vehicle, after the player dies because he ran out of the oxygen, then the vehicle is dying too. And still both callbacks are called.
Thanks for the overwriting thing, I always used 1-2000 for that and 0 was indeed not used at all (though I don't use any array with MAX_VEHICLES anymore).