how to make health n armour textdraw - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: how to make health n armour textdraw (
/showthread.php?tid=534603)
how to make health n armour textdraw -
ScripteRNaBEEL - 30.08.2014
how to make health n armour textdraw can any one give me any tutorial or any filterscript
Re: how to make health n armour textdraw -
PAF - 30.08.2014
any pic that we define you better
Re: how to make health n armour textdraw -
ScripteRNaBEEL - 30.08.2014
No Image Ex. Health: 100% And Armour: 100% i want this in textdraw.
Re: how to make health n armour textdraw -
PAF - 30.08.2014
https://sampforum.blast.hk/showthread.php?tid=241026
Re: how to make health n armour textdraw -
Shinta307 - 30.08.2014
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