21.04.2014, 15:29
Hook the functions that create/add a vehicle. An example:
Do the same for AddStaticVehicle and AddStaticVehicleEx too.
And when a vehicle respawns:
pawn Код:
stock HF_CreateVehicle(modelid, Float:x, Float:y, Float:z, Float:angle, color1, color2, respawn_delay)
{
if (modelid == 495) SetVehicleHealth(CreateVehicle(modelid, x, y, z, angle, color1, color2, respawn_delay), 150);
else CreateVehicle(modelid, x, y, z, angle, color1, color2, respawn_delay);
return 1;
}
#if defined _ALS_CreateVehicle
#undef CreateVehicle
#else
#define _ALS_CreateVehicle
#endif
#define CreateVehicle HF_CreateVehicle
And when a vehicle respawns:
pawn Код:
public OnVehicleSpawn(vehicleid)
{
if (GetVehicleModel(vehicleid) == 495) SetVehicleHealth(vehicleid, 150);
return 1;
}