19.05.2014, 02:47
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 !
Thanks in advance...
Код:
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..