SA-MP Forums Archive
textdraws warning 213: tag mismatch - 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: textdraws warning 213: tag mismatch (/showthread.php?tid=567896)



textdraws warning 213: tag mismatch - Boyka96 - 17.03.2015

Hii, I'm trying to work with textdraws (first time) and as I expected I need your help
so the title says everything.


Код:
public ShowTds(tdid, playerid)
{
	switch(tdid)
	{
	    case 1:
	    {
		TextDrawShowForPlayer(playerid, TDEditor_PTD[playerid][0]);//warnings start from this line
    		TextDrawShowForPlayer(playerid, TDEditor_PTD[playerid][1]);
    		TextDrawShowForPlayer(playerid, TDEditor_PTD[playerid][2]);
    		TextDrawShowForPlayer(playerid, TDEditor_PTD[playerid][3]);
    		TextDrawShowForPlayer(playerid, TDEditor_PTD[playerid][4]);
    		TextDrawShowForPlayer(playerid, TDEditor_PTD[playerid][5]);
    		TextDrawShowForPlayer(playerid, TDEditor_PTD[playerid][6]);
    		TextDrawShowForPlayer(playerid, TDEditor_PTD[playerid][7]);
    		TextDrawShowForPlayer(playerid, TDEditor_PTD[playerid][8]);
    		TextDrawShowForPlayer(playerid, TDEditor_PTD[playerid][9]);
    		TextDrawShowForPlayer(playerid, TDEditor_PTD[playerid][10]);
    		TextDrawShowForPlayer(playerid, TDEditor_PTD[playerid][11]);
    		TextDrawShowForPlayer(playerid, TDEditor_PTD[playerid][12]);
    		TextDrawShowForPlayer(playerid, TDEditor_PTD[playerid][13]);
    		TextDrawShowForPlayer(playerid, TDEditor_PTD[playerid][14]);
     		TextDrawShowForPlayer(playerid, TDEditor_PTD[playerid][15]);
     		TextDrawShowForPlayer(playerid, TDEditor_PTD[playerid][16]);//and ends here ofcourse
	     }
	}
}
thanks in advance


Re: textdraws warning 213: tag mismatch - ReD_HunTeR - 17.03.2015

show us variables..


Re: textdraws warning 213: tag mismatch - CalvinC - 17.03.2015

Show where you declare and assign the array.


Re: textdraws warning 213: tag mismatch - De4dpOol - 17.03.2015

You need to create the variable like:

pawn Код:
new PlayerText:TDEditor_PTD[MAX_PLAYERS][17];
Also instead of using one line for showing 1 textdraw, you can use loop:

pawn Код:
for(new i = 0; i < 17; i++)//looping
{
    TextDrawShowForPlayer(playerid, TDEditor_PTD[playerid][i]);
}



Re: textdraws warning 213: tag mismatch - Boyka96 - 17.03.2015

here is my array:

Код:
new PlayerText:TDEditor_PTD[MAX_PLAYERS][17];
I dont think there is a problem in the textdraws creation as I used TDEditor for that ..

Quote:
Originally Posted by De4dpOol
Посмотреть сообщение
You need to create the variable like:

pawn Код:
new PlayerText:TDEditor_PTD[MAX_PLAYERS][17];
Also instead of using one line for showing 1 textdraw, you can use loop:

pawn Код:
for(new i = 0; i < 17; i++)//looping
{
    TextDrawShowForPlayer(playerid, TDEditor_PTD[playerid][i]);
}
using a loop or doing it line by line is the same no ?


Re: textdraws warning 213: tag mismatch - Konstantinos - 17.03.2015

Take a look at the example in the wiki: https://sampwiki.blast.hk/wiki/TextDrawShowForPlayer

It uses global textdraw for it and you declared the array with player-textdraw. You have to use either global or player textdraws (for both declaring part and functions) and before you make up your decision on which one, you may read the tip is given to the link above.

Quote:
Originally Posted by Boyka96
Посмотреть сообщение
using a loop or doing it line by line is the same no ?
It is.


Re: textdraws warning 213: tag mismatch - De4dpOol - 17.03.2015

if you are using;
pawn Код:
new PlayerText:
//than use PlayerTextDrawShow
if you are using;
pawn Код:
new Text:
//use TextDrawShowForPlayer
EDIT: you also have to create them in different way see CreatePlayerTextDraw and TextDrawCreate for more info.


Re: textdraws warning 213: tag mismatch - Boyka96 - 17.03.2015

thanks De4dpOol and Konstantinos
+rep both
De4dpOol that was the tip I was looking for