Textdraw bar facing up problem
#1

ok so well, i'm trying to make a health bar facing up, but going down when the vehicle health goes down.

in this case, it uses lettersize y for up and down, but im stumped.

pawn Код:
pTextInfo[i][pHealthBar] = TextDrawCreate(627.000000, 418.000000, "  ");
    TextDrawBackgroundColor(pTextInfo[i][pHealthBar], 65535);
    TextDrawFont(pTextInfo[i][pHealthBar], 1);
    TextDrawLetterSize(pTextInfo[i][pHealthBar], 0.000000, -8.600000);
    TextDrawColor(pTextInfo[i][pHealthBar], 16711935);
    TextDrawSetOutline(pTextInfo[i][pHealthBar], 1);
    TextDrawSetProportional(pTextInfo[i][pHealthBar], 1);
    TextDrawUseBox(pTextInfo[i][pHealthBar], 1);
    TextDrawBoxColor(pTextInfo[i][pHealthBar], 16384150);
    TextDrawTextSize(pTextInfo[i][pHealthBar], 598.000000, 0.000000);
notice the -8.6 lettersize y

now for the calculations

pawn Код:
public CheckStatus()
{
    foreach(Player,i)
    {
        if(!IsPlayerInAnyVehicle(i)) continue;
        new Float:vHealth;
        GetVehicleHealth(GetPlayerVehicleID(i), vHealth);
        if(vHealth >= 997) TextDrawLetterSize(pTextInfo[i][pHealthBar], 0.000000, -8.600000);
        else TextDrawLetterSize(pTextInfo[i][pHealthBar], 0.000000, /*what here? i tried*/floatadd(-8.600000(floatdiv(vHealth, 115.55)));
        TextDrawShowForPlayer(i, pTextInfo[i][pHealthBar]);
    }
    return 1;
}
but its not moving down correctly): if i lose any health it goes to like 1/4 bar and stays there



Uploaded with ImageShack.us
Reply
#2

Bumpard
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)