17.05.2011, 15:56
Hey guys,
Im trying to make a car die if the carhealth is below 350.
It's all working, but when you're in a car & the car health is below 350 nothing will happen. The engine will stop, just when you get out, and back in. Anyone can help me?
Im trying to make a car die if the carhealth is below 350.
It's all working, but when you're in a car & the car health is below 350 nothing will happen. The engine will stop, just when you get out, and back in. Anyone can help me?
pawn Код:
if(newstate == PLAYER_STATE_DRIVER)
{
new vehicleid = GetPlayerVehicleID(playerid);
new Float:chealth;
GetVehicleHealth(vehicleid, chealth);
{
if(chealth < 350.0)
{
SetVehicleParamsEx(vehicleid, false, true, true, true, false, false, false);
TogglePlayerControllable(playerid,0);
SendClientMessage(playerid, orange, "Your engine died. Please call a repairsman to repair it");
return 1;
} else if (GetVehicleHealth(vehicleid, chealth) >350) {
SetVehicleParamsEx(vehicleid, true, false, false, false, false, false, false);
TogglePlayerControllable(playerid, 1);
}
}
return 1;
}