Vehicle Health Bar Not Working
#1

Hey, I made a Vehicle Health bar, and it is not working.

pawn Код:
public SpeedAndHealth(playerid)
{
    new VehID = GetPlayerVehicleID(playerid), Float:Health;
    new VehHel = GetVehicleHealth(VehID,Health);
    if(IsPlayerInAnyVehicle(playerid))
    {
        if(VehHel == 1000){TextDrawSetString(RDHealth[playerid],"~g~----------");}
        if(VehHel <= 990 && VehHel > 900){TextDrawSetString(RDHealth[playerid],"~g~---------~y~-");}
        if(VehHel <= 900 && VehHel > 800){TextDrawSetString(RDHealth[playerid],"~g~--------~y~-~r~-");}
        if(VehHel <= 800 && VehHel > 700){TextDrawSetString(RDHealth[playerid],"~g~-------~y~-~r~--");}
        if(VehHel <= 700 && VehHel > 600){TextDrawSetString(RDHealth[playerid],"~g~------~y~-~r~---");}
        if(VehHel <= 600 && VehHel > 500){TextDrawSetString(RDHealth[playerid],"~g~-----~y~-~r~----");}
        if(VehHel <= 500 && VehHel > 400){TextDrawSetString(RDHealth[playerid],"~g~----~y~-~r~-----");}
        if(VehHel <= 400 && VehHel > 300){TextDrawSetString(RDHealth[playerid],"~g~---~y~-~r~------");}
        if(VehHel <= 300 && VehHel > 200){TextDrawSetString(RDHealth[playerid],"~g~--~y~-~r~-------");}
        if(VehHel <= 200 && VehHel > 100){TextDrawSetString(RDHealth[playerid],"~g~-~y~-~r~--------");}
        if(VehHel <= 100 && VehHel > 0){TextDrawSetString(RDHealth[playerid],"~y~-~r~---------");}
        if(VehHel == 0){TextDrawSetString(RDHealth[playerid],"~r~----------");}
    }
    return 1;
}
The problem is, is that it stays at:
pawn Код:
if(VehHel <= 100 && VehHel > 0){TextDrawSetString(RDHealth[playerid],"~y~-~r~---------");}
The Timer works because I have a Speed-o-meter that works by showing Number Mph (Example: 59 Mph) added into that public that works. (Took it out of it in the post because it is unnessecary.)

The Timer looks like this: Added Onto (OnPlayerEnterVehicle)
pawn Код:
SpeedAndHealthTimer[playerid] = SetTimerEx("SpeedAndHealth",1000,1,"i",playerid);
I have no Idea what could be going wrong to be honest.

Too put it short and simple: The Bar is staying at what should be if the vehicle is at health 100 to 0. Even though the vehicle is at full health (1000).

Thanks for reading my problem.
Reply


Messages In This Thread
Vehicle Health Bar Not Working - by miokie - 12.12.2009, 12:28
Re: Vehicle Health Bar Not Working - by Deat_Itself - 12.12.2009, 12:32
Re: Vehicle Health Bar Not Working - by miokie - 12.12.2009, 12:36
Re: Vehicle Health Bar Not Working - by Deat_Itself - 12.12.2009, 12:40
Re: Vehicle Health Bar Not Working - by Nero_3D - 12.12.2009, 13:02
Re: Vehicle Health Bar Not Working - by miokie - 12.12.2009, 13:11

Forum Jump:


Users browsing this thread: 3 Guest(s)