Vehicle with infinite health + StartRecordingPlayerData
#10

Quote:
Originally Posted by leonardo1434
Посмотреть сообщение
wouldn't be better just repair the vehicle each time is damaged? do this, or make a simple settimer.

pawn Код:
public OnVehicleDamageStatusUpdate(vehicleid, playerid)
{
    RepairVehicle(npcvehicle);
    return 1;
}
Thanks leonardo1434,

I do use RepairVehicle for the visual repair, but it sets the vehicle health to 1000, not enough to survive explosions. Hence my reason for using SetVehicleHealth straight afterwards.

I am actually repairing/setting health of vehicles using both the OnVehicleDamageStatusUpdate callback and a looping timer. The callback gives instant repair, but no protection when a car flips over and settles on its roof. The looping timer ensures flipped cars will not explode, giving players time to use any of the escape methods available on the server.

I must say that your feedback made me smile because I am usually a bit of a coding-loner, so knowing that I am doing it in a generally acceptable way is good to know!

Thanks again hansen111 for your advice and clarification on how explosions impact vehicles.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)