Problem with textdraws
#1

Hello all !

I have timer to show and hide textdraw for all players. Labels are shown for sometime and then they are gone for all players. And I can't get them back if I don't make a gamemode restart.

Код:
public timer()
{
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
		if(gPlayerLogged[i])
                        {
		  TextDrawHideForAll(Pee[i]);
	             TextDrawHideForAll(Hunger[i]);
                        new strt[256];
                        new strd[256];
		  new Pees = PlayerInfo[i][pPee];
		  new Hungers = PlayerInfo[i][pHunger]
		 format(strt,sizeof(strt),"Hunger: ~r~%d",Hungers);
	            Hunger[i] = TextDrawCreate(1.000000, 328.000000,strt);
                       TextDrawBackgroundColor(Hunger[i], 255);
	            TextDrawFont(Hunger[i], 2);
	            TextDrawLetterSize(Hunger[i], 0.500000, 1.000000);
	            TextDrawColor(Hunger[i], 16711935);
	            TextDrawSetOutline(Hunger[i], 1);
	            TextDrawSetProportional(Hunger[i], 1);
	            TextDrawShowForPlayer(i, Hunger[i]);

	            format(strd,sizeof(strd),"Pee: ~g~%d",Pees);
	            Pee[i] = TextDrawCreate(1.000000, 311.000000, strd);
	            TextDrawBackgroundColor(Pee[i], 255);
	            TextDrawFont(Pee[i], 2);
	            TextDrawLetterSize(Pee[i], 0.500000, 1.000000);
	            TextDrawColor(Pee[i], 16711935);
	            TextDrawSetOutline(Pee[i], 1);
	            TextDrawSetProportional(Pee[i], 1);
	            TextDrawShowForPlayer(i, Pee[i]);
             }
         }
	 }
}
Any ideas what is wrong ? (timer is working, textdraws are bugging.)

-Peep
Reply
#2

Is there a function stopping the timer ?
Reply
#3

No there isn't any
Reply
#4

Quote:
Originally Posted by Stigg
Посмотреть сообщение
Is there a function stopping the timer ?
KillTimer

And you use TextDrawHideForAll for player based textdraws

The timer creates each call the textdraws again without deleting it

If the timer repeats the textdraw limit will be reached after some seconds and nothing will be showed
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)