01.09.2018, 20:46
i want a code that when car reaches 400 health so engine automatic offs.
public OnVehicleDamageStatusUpdate(vehicleid, playerid)
{
new Float:hp
GetVehicleHealth(vehicleid, hp);
if(hp <= 400)
{
//turn off engine code here
}
return 1;
}
public OnVehicleDamageStatusUpdate(vehicleid, playerid)
{
new Float:hp, vehicleid = GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleHealth(vehicleid, hp);
if(hp <= 400)
{
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective);
}
return 1;
}
Exactly, as Lokii says.
We will make it easier for you. PHP код:
|