04.02.2013, 08:33
I suggest you to do a debug:
Check your log for values. If they are wrong, you must recheck your code for mistakes
pawn Код:
forward Damage(playerid);
public Damage(playerid)
{
new Float:health;
new veh;
veh = GetPlayerVehicleID(playerid);
GetVehicleHealth(veh, health);
printf("--- DEBUG: Vehicle Health on \"public Damage\": %f", health);
if(IsPlayerInAnyVehicle(playerid))
{
if(health > 800)
{
TextDrawColor(Textdraw13[playerid], 0xFFFFFFFF);
}
else if(health <= 800 && health > 500)
{
TextDrawColor(Textdraw13[playerid], 0xFFFF00FF);
}
else if(health <= 400)
{
TextDrawColor(Textdraw13[playerid], 0xFF0000FF);
}
}
else {
TextDrawColor(Textdraw13[playerid], 0xD3D3D3FF);
}
return 1;
}