SA-MP Forums Archive
Problem with textdraws - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Problem with textdraws (/showthread.php?tid=245427)



Problem with textdraws - Peep - 31.03.2011

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


Re: Problem with textdraws - Stigg - 31.03.2011

Is there a function stopping the timer ?


Re: Problem with textdraws - Peep - 31.03.2011

No there isn't any


AW: Problem with textdraws - Nero_3D - 31.03.2011

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