07.03.2010, 21:13
I have this, it will show your car health in a textdraw:
But what I want, is it to show it on percent(%), I've been trying, but I easily failed
Thanks.
pawn Код:
forward Update(playerid);
public Update(playerid)
{
if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new Float:CHealth, veh, s[32];
veh = GetPlayerVehicleID(playerid);
GetVehicleHealth(veh, CHealth);
format(s,32,"Vehicle Health: %f", CHealth/10*10);
TextDrawShowForPlayer(playerid, CHealthtext);
TextDrawSetString(CHealthtext, s);
}
else if(GetPlayerState(playerid == PLAYER_STATE_ONFOOT))
{
TextDrawHideForPlayer(playerid, CHealthtext);
}
}
Thanks.