HP Textdraw Problem
#1

Hey guys,

i have a problem with my TextDraw, i would show the HP for the Player... here is my
Problem. The Problem is, that the number is not the Original Number of the Player and it bugs.

Code:

Код:
new Text:HP1[MAX_PLAYERS];

for(new i=0; i<MAX_PLAYERS; i++)
{
		HP1[i] = TextDrawCreate(558.000000,67.000000,"100%");
		TextDrawSetOutline(HP1[i],1);
		TextDrawLetterSize(HP1[i],0.2000000,0.800000);
		TextDrawAlignment(HP1[i],0);
		TextDrawSetShadow(HP1[i],0);
		TextDrawSetProportional(HP1[i],1);
}

OnPlayerUpdate...

for(new i=0; i<MAX_PLAYERS; i++)
{
  		new Float: hp;
		GetPlayerHealth(i, hp);
		format(mstr,sizeof(mstr),"% .0f hp",hp);
		TextDrawSetString(HP1[i],mstr);
}
Sri for my bad English im From Germany
Reply
#2

i just have a question, if you wanted to make that for a single player, why did you looped it and maked it for all players?
Код:
new Float: hp;
		GetPlayerHealth(playerid, hp);
		format(mstr,sizeof(mstr),"% .0f hp",hp);
		TextDrawSetString(HP1[playerid],mstr);
This must be like this if you want for that to work
Reply
#3

Yeah sri, i was just a little bit confused
But it works now..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)