textdraws warning 213: tag mismatch
#1

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
Reply
#2

show us variables..
Reply
#3

Show where you declare and assign the array.
Reply
#4

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]);
}
Reply
#5

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 ?
Reply
#6

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.
Reply
#7

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.
Reply
#8

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


Forum Jump:


Users browsing this thread: 1 Guest(s)