Textdraw problem
#1

I made it so when a player spawns a textdraw with the number of the player his/her deaths appears.
It should dissapear when the player dies and it should re-appear when the player spawns again ( so it updates )
However, the textdraw does not dissapear and it'll just create a new one over the old one.

OnPlayerSpawn

Code:
 	new deathstring[30];
	format(deathstring, sizeof(deathstring), "Deaths: %d", PlayerInfo[playerid][pDeaths]);
 	Textdraw7[playerid] = TextDrawCreate(500.000000, 142.000000, deathstring);
	TextDrawBackgroundColor(Textdraw7[playerid], 255);
	TextDrawFont(Textdraw7[playerid], 1);
	TextDrawLetterSize(Textdraw7[playerid], 0.490000, 2.000000);
	TextDrawColor(Textdraw7[playerid], -16776961);
	TextDrawSetOutline(Textdraw7[playerid], 0);
	TextDrawSetProportional(Textdraw7[playerid], 1);
	TextDrawSetShadow(Textdraw7[playerid], 1);
	TextDrawShowForPlayer(playerid, Textdraw7[playerid]);
Works fine



OnPlayerDeath

Code:
	TextDrawHideForPlayer(playerid, Textdraw7[playerid]);
	TextDrawDestroy(Textdraw7[playerid]);
Nothing happens when this gets called.

I hope somebody can help me ;d
Thanks,
Shred.
Reply
#2

You can just use the function
TextDrawSetString
No need to hide, destroy, re-create it. Just change the string, and you're done
Reply
#3

It worked! Thanks alot
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)