SA-MP Forums Archive
Function not working properly both ways. - 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: Function not working properly both ways. (/showthread.php?tid=453040)



Function not working properly both ways. - [WSF]ThA_Devil - 23.07.2013

Hello, I've tried to make a function that will enable / disable all textdraws at once to save space.
but Disabling leaves textdraw id 0 on
Код:
ToggleTextDraws(playerid,bool:toggle)
{
	if(toggle == true)
	{
	    for(new i = 0; i < 8; i++)
		{
		    PlayerTextDrawShow(playerid,Textdraw[playerid][i]);
		}
		SelectTextDraw(playerid, 0xFFFFFFFF);
	} else if(toggle == false) {

	    for(new i = 0; i < 8; i++)
		{
		    PlayerTextDrawHide(playerid,Textdraw[playerid][i]);
		}
		
  		CancelSelectTextDraw(playerid);
	}
}
Creation of textdraw:
Код:
CreateAllTextDraws(playerid)
{
   Textdraw[playerid][0] = CreatePlayerTextDraw(playerid,290.000000, 331.000000, "_");
}