A little help with textdraws.
#4

Using a loop is quite unnecessary in this case. This is all you need to do:

Put this on top of your script under other variables:
Код:
new PlayerText:Health[MAX_PLAYERS];
OnPlayerConnect:
Код:
Health[playerid] = CreatePlayerTextDraw(playerid, 8.000000, 430.000000, "HP 100%");
PlayerTextDrawBackgroundColor(playerid, Health[playerid], 16711935);
PlayerTextDrawFont(playerid, Health[playerid], 3);
PlayerTextDrawLetterSize(playerid, Health[playerid], 0.700000, 1.800000);
PlayerTextDrawColor(playerid, Health[playerid], 712256255);
PlayerTextDrawSetOutline(playerid, Health[playerid], 1);
PlayerTextDrawSetProportional(playerid, Health[playerid], 1);
PlayerTextDrawHide(playerid, Health[playerid]); // hide the textdraw
OnPlayerSpawn:
Код:
PlayerTextDrawShow(playerid, Health[playerid]); // show the textdraw
OnPlayerUpdate or any other looped player timer:
Код:
new String[32], Float:hp;
GetPlayerHealth(playerid, hp);
format(String, sizeof(String), "HP: %0.1f", hp);
PlayerTextDrawSetString(playerid, Health[playerid], String);
Reply


Messages In This Thread
A little help with textdraws. - by ivndosos - 17.01.2018, 14:23
Re: A little help with textdraws. - by Daveosss - 17.01.2018, 14:46
Re: A little help with textdraws. - by ivndosos - 17.01.2018, 14:56
Re: A little help with textdraws. - by Daveosss - 17.01.2018, 15:24
Re: A little help with textdraws. - by ivndosos - 17.01.2018, 15:53
Re: A little help with textdraws. - by Daveosss - 17.01.2018, 16:05

Forum Jump:


Users browsing this thread: 1 Guest(s)