Textdraw problem - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Textdraw problem (
/showthread.php?tid=513977)
Textdraw problem -
Splitho - 19.05.2014
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...
Re: Textdraw problem -
JFF - 19.05.2014
You should use PlayerTextdraw
instead of textdraw
Re : Textdraw problem -
Splitho - 19.05.2014
Sure about that ?
Re: Re : Textdraw problem -
JFF - 19.05.2014
Quote:
Originally Posted by Splitho
Sure about that ?
|
Yes textdraw = one main textdraw for everyone
playertextdraw = one textdraw for each player