Colored armour bar textdraw - won't work
#4

You have to use TextDrawHideForPlayer(playerid, ArmourBar[playerid]); before you make any changes on string, so the changes on textdraw string will be showed.

pawn Код:
new Float:Armour;
    GetPlayerArmour(playerid,Armour);
    if(Armour >= 90)
    {
            TextDrawHideForPlayer(playerid, ArmourBar[playerid]);
            TextDrawSetString(ArmourBar[playerid],"..........");
            TextDrawShowForPlayer(playerid,ArmourBar[playerid]);
            return 1;
    }
    if(Armour >= 80)
    {
            TextDrawHideForPlayer(playerid, ArmourBar[playerid]);
            TextDrawSetString(ArmourBar[playerid],".........");
            TextDrawShowForPlayer(playerid,ArmourBar[playerid]);
            return 1;
    }
    if(Armour >= 70)
    {
            TextDrawHideForPlayer(playerid, ArmourBar[playerid]);
            TextDrawSetString(ArmourBar[playerid],"........");
            TextDrawShowForPlayer(playerid,ArmourBar[playerid]);
            return 1;
    }
    if(Armour >= 60)
    {
            TextDrawHideForPlayer(playerid, ArmourBar[playerid]);
            TextDrawSetString(ArmourBar[playerid],".......");
            TextDrawShowForPlayer(playerid,ArmourBar[playerid]);
            return 1;
    }
    if(Armour >= 50)
    {
            TextDrawHideForPlayer(playerid, ArmourBar[playerid]);
            TextDrawSetString(ArmourBar[playerid],"......");
            TextDrawShowForPlayer(playerid,ArmourBar[playerid]);
            return 1;
    }
    if(Armour >= 40)
    {
            TextDrawHideForPlayer(playerid, ArmourBar[playerid]);
            TextDrawSetString(ArmourBar[playerid],".....");
            TextDrawShowForPlayer(playerid,ArmourBar[playerid]);
            return 1;
     }
    if(Armour >= 30)
    {
            TextDrawHideForPlayer(playerid, ArmourBar[playerid]);
            TextDrawSetString(ArmourBar[playerid],"....");
            TextDrawShowForPlayer(playerid,ArmourBar[playerid]);
            return 1;
     }
    if(Armour >= 20)
    {
            TextDrawHideForPlayer(playerid, ArmourBar[playerid]);
            TextDrawSetString(ArmourBar[playerid],"...");
            TextDrawShowForPlayer(playerid,ArmourBar[playerid]);
            return 1;
    }
    if(Armour >= 10)
    {
            TextDrawHideForPlayer(playerid, ArmourBar[playerid]);
            TextDrawSetString(ArmourBar[playerid],"..");
            TextDrawShowForPlayer(playerid,ArmourBar[playerid]);
            return 1;
    }
    if(Armour > 0)
    {
            TextDrawHideForPlayer(playerid, ArmourBar[playerid]);
            TextDrawSetString(ArmourBar[playerid],".");
            TextDrawShowForPlayer(playerid,ArmourBar[playerid]);
            return 1;
    }
    if(Armour = 0)
    {
            TextDrawHideForPlayer(playerid, ArmourBar[playerid]);
            return 1;
    }
You can make the code more simple, I just wrote this to show you the mistake you've made.
Reply


Messages In This Thread
Colored armour bar textdraw - won't work - by Saddin - 09.07.2013, 20:02
Re: Colored armour bar textdraw - won't work - by Misiur - 10.07.2013, 11:06
Re: Colored armour bar textdraw - won't work - by Saddin - 10.07.2013, 11:08
Re: Colored armour bar textdraw - won't work - by Calabresi - 10.07.2013, 11:17
Re: Colored armour bar textdraw - won't work - by Saddin - 10.07.2013, 11:31
Re: Colored armour bar textdraw - won't work - by Misiur - 10.07.2013, 11:38

Forum Jump:


Users browsing this thread: 1 Guest(s)