how to make health n armour textdraw
#5

On top your scripts
pawn Код:
#define          CheckTimer           100 //The time to check for AP/HP change (1000 = 1s) >> Better leave it 100 <<
new Text:DigiHP;
new Text:DigiAP;
forward Updater(playerid);
Ongamemodeinit your scripts
pawn Код:
DigiHP = TextDrawCreate(566.000000, 68.000000, "100");
        TextDrawBackgroundColor(DigiHP, -1);
        TextDrawFont(DigiHP, 1);
        TextDrawLetterSize(DigiHP, 0.350000, 0.599999);
        TextDrawColor(DigiHP, 255);
        TextDrawSetOutline(DigiHP, 1);
        TextDrawSetProportional(DigiHP, 1);
       
        //AP Textdraw
        DigiAP = TextDrawCreate(566.000000, 47.000000, "100");
        TextDrawBackgroundColor(DigiAP, -1);
        TextDrawFont(DigiAP, 1);
        TextDrawLetterSize(DigiAP, 0.349999, 0.599999);
        TextDrawColor(DigiAP, 255);
        TextDrawSetOutline(DigiAP, 1);
        TextDrawSetProportional(DigiAP, 1);

       SetTimer("Updater", CheckTimer, true);
pawn Код:
public Updater(playerid)
{
        //HP Check
        new Float:Health, hstr[500];
        GetPlayerHealth(playerid, Health);
        format(hstr, sizeof(hstr), "%.0f", Health);
        TextDrawSetString(DigiHP, hstr);
        TextDrawShowForPlayer(playerid, DigiHP);
       
        //AP Check
        new Float:Armour, astr[500];
        GetPlayerArmour(playerid, Armour);
        if(Armour >= 1)
        {
            format(astr, sizeof(astr), "%.0f", Armour);
                TextDrawSetString(DigiAP, astr);
                TextDrawShowForPlayer(playerid, DigiHP);
            TextDrawShowForPlayer(playerid, DigiAP);
        }
        else
        {
            TextDrawHideForPlayer(playerid, DigiAP);
        }
        return 1;
}
Full script at http://pastebin.com/qeHyHVh5
Reply


Messages In This Thread
how to make health n armour textdraw - by ScripteRNaBEEL - 30.08.2014, 15:53
Re: how to make health n armour textdraw - by PAF - 30.08.2014, 16:00
Re: how to make health n armour textdraw - by ScripteRNaBEEL - 30.08.2014, 16:02
Re: how to make health n armour textdraw - by PAF - 30.08.2014, 16:08
Re: how to make health n armour textdraw - by Shinta307 - 30.08.2014, 16:12

Forum Jump:


Users browsing this thread: 4 Guest(s)