30.08.2014, 15:53
how to make health n armour textdraw can any one give me any tutorial or any filterscript
#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);
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);
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;
}