Problem with Health TextDraw -
ServerScripter - 18.09.2011
Hi , i want to show to players how Much Health+Armour they have , it will be like a textdraw , and i have no Idea
i will never forgot if you help me .
Re: Problem with Health TextDraw -
Leeo_Perez - 19.09.2011
pawn Код:
#include a_samp
new Text:Textdraw0;
new Float:vida;
forward
coisas(playerid);
public coisas(playerid)
{
vida = GetPlayerHealth(playerid,vida);
new text[20];
format(text,sizeof(text),"~g~Vida: %1.1f",vida);
TextDrawSetString(Textdraw0,text);
TextDrawShowForPlayer(playerid,Textdraw0);
return 1;
}
public OnFilterScriptInit()
{
return 1;
}
public OnPlayerConnect(playerid)
{
Textdraw0 = TextDrawCreate(490.000000, 100.000000, "~r~vida:");
TextDrawBackgroundColor(Textdraw0, 255);
TextDrawFont(Textdraw0, 3);
TextDrawLetterSize(Textdraw0, 0.500000, 1.000000);
TextDrawColor(Textdraw0, -1);
TextDrawSetOutline(Textdraw0, 0);
TextDrawSetProportional(Textdraw0, 1);
TextDrawSetShadow(Textdraw0, 1);
return 1;
}
public OnPlayerSpawn(playerid)
{
coisas(playerid);
return 1;
}
public OnFilterScriptExit()
{
TextDrawHideForAll(Textdraw0);
TextDrawDestroy(Textdraw0);
return 1;
}
in textdraw... change "vida" to health...
Re: Problem with Health TextDraw -
ServerScripter - 19.09.2011
thank you but your code show only 1.1 in health and i was 90 the health stay 1
Re: Problem with Health TextDraw -
Basicz - 19.09.2011
that code wont work, works only for certain players
also i think this one will fix it ( not certain players only problem )
pawn Код:
format(text,sizeof(text),"~g~Vida: %.2f",vida);
Re: Problem with Health TextDraw -
ServerScripter - 19.09.2011
Not Working , it show to me Vida : 1.00 and don't change
Re: Problem with Health TextDraw -
Basicz - 19.09.2011
pawn Код:
public OnPlayerSpawn(playerid)
{
SetTimerEx( "coisas", 100, true, "i", playerid );
return 1;
}
Re: Problem with Health TextDraw -
ServerScripter - 19.09.2011
Not Working this is the Screen :
i have this inside the inculde a_samp :
PHP код:
new Text:Textdraw0;
new Float:vida;
forward
coisas(playerid);
and this :
PHP код:
public coisas(playerid)
{
vida = GetPlayerHealth(playerid,vida);
new text[20];
format(text,sizeof(text),"~g~Health: %.2f",vida);
TextDrawSetString(Textdraw0,text);
TextDrawShowForPlayer(playerid,Textdraw0);
return 1;
}
and :
PHP код:
public OnPlayerConnect(playerid)
{
Textdraw0 = TextDrawCreate(490.000000, 100.000000, "~r~Health:");
TextDrawBackgroundColor(Textdraw0, 255);
TextDrawFont(Textdraw0, 3);
TextDrawLetterSize(Textdraw0, 0.500000, 1.000000);
TextDrawColor(Textdraw0, -1);
TextDrawSetOutline(Textdraw0, 0);
TextDrawSetProportional(Textdraw0, 1);
TextDrawSetShadow(Textdraw0, 1);
and :
PHP код:
public OnPlayerSpawn(playerid)
{
SetTimerEx( "coisas", 100, true, "i", playerid );
PHP код:
public OnFilterScriptExit()
{
TextDrawHideForAll(Textdraw0);
TextDrawDestroy(Textdraw0);
return 1;
}
This is All
(i have Health:1.1 and don't change as you can see )