Textdraw problem
#1

Ihave a big problem with my textdraw,It's just update the textdraw for the ID:0...I paste my code here,hope someone will help me !

Код:
new Text:Health[MAX_PLAYERS]; // The declaration of the textdraw
Код:
forward vitals(playerid); // My forward for the function
Код:
SetTimer("vitals",1,1); // The timer,It's in GameModeInit
Код:
for(new i = 0; i < MAX_PLAYERS; i++)
    {
    Health[i] = TextDrawCreate(560.000000, 67.000000, "100%");
    TextDrawBackgroundColor(Health[i], 255);
    TextDrawFont(Health[i], 1);
    TextDrawLetterSize(Health[i], 0.219999, 0.899999);
    TextDrawColor(Health[i], -1);
    TextDrawSetOutline(Health[i], 1);
    TextDrawSetProportional(Health[i], 1);
    } // Dans On Game Mode Init
Код:
TextDrawShowForPlayer(playerid, Health[playerid]); // Dans le OnPlayerSpawn
Код:
public vitals(playerid)
{
new string[10];
new Float:pHealth;
new maxhp;
GetPlayerHealth(playerid,pHealth);
if(PlayerInfo[playerid][pRace] == 0)
{
	maxhp = 50 + PlayerInfo[playerid][pEndurance] * 10;
}
if(PlayerInfo[playerid][pRace] == 1)
{
    maxhp = 100 + PlayerInfo[playerid][pEndurance] * 10;
}
format(string, sizeof(string), "%.0f/%d", pHealth,maxhp);
TextDrawSetString(Health[playerid], string);
TextDrawShowForPlayer(playerid, Health[playerid]);
} // The Function who Update the string of the textdraw,it's this who doesn't work..
Thanks in advance...
Reply
#2

You should use PlayerTextdraw

instead of textdraw
Reply
#3

Sure about that ?
Reply
#4

Quote:
Originally Posted by Splitho
Посмотреть сообщение
Sure about that ?
Yes textdraw = one main textdraw for everyone

playertextdraw = one textdraw for each player
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)