SA-MP Forums Archive
Weird Warning. - 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: Weird Warning. (/showthread.php?tid=567927)



Weird Warning. - $Marco$ - 17.03.2015

Hello,
I got a weird warning and I was wondering how I could fix it.

pawn Код:
if(clickedid == Text4[playerid]) // Line 12086
Код:
bare.pwn(12086) : warning 213: tag mismatch
I tried changing it to this:

pawn Код:
if(clickedid == Text4) // Line 12086
Код:
bare.pwn(12086) : error 033: array must be indexed (variable "Text4")
Anyone knows how to solve this?


Re: Weird Warning. - CalvinC - 17.03.2015

Show how you declare Text4.


Re: Weird Warning. - $Marco$ - 17.03.2015

pawn Код:
new PlayerText:Text4[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{

Text4[playerid] = CreatePlayerTextDraw(playerid, 273.000000, 228.000000, "ld_otb2:butnb");
PlayerTextDrawBackgroundColor(playerid, Text4[playerid], 0);
PlayerTextDrawFont(playerid, Text4[playerid], 4);
PlayerTextDrawLetterSize(playerid, Text4[playerid], 0.400000, -1.000000);
PlayerTextDrawColor(playerid, Text4[playerid], 3315350);
PlayerTextDrawSetOutline(playerid, Text4[playerid], 0);
PlayerTextDrawSetProportional(playerid, Text4[playerid], 1);
PlayerTextDrawSetShadow(playerid, Text4[playerid], 1);
PlayerTextDrawUseBox(playerid, Text4[playerid], 1);
PlayerTextDrawBoxColor(playerid, Text4[playerid], 255);
PlayerTextDrawTextSize(playerid, Text4[playerid], 55.000000, 23.000000);
PlayerTextDrawSetSelectable(playerid, Text4[playerid], 1);
}



Re: Weird Warning. - Vince - 17.03.2015

The TAG of clickedid (Text:) does not match the tag of the variable (PlayerText:) hence the warning. You're using the wrong callback.


Re: Weird Warning. - $Marco$ - 17.03.2015

Quote:
Originally Posted by Vince
Посмотреть сообщение
The TAG of clickedid (Text does not match the tag of the variable (PlayerText hence the warning. You're using the wrong callback.
What should I use?

Nevermind I found out myself, thanks!


Re: Weird Warning. - CalvinC - 17.03.2015

Make sure you're using OnPlayerClickPlayerTextDraw, and not just OnPlayerClickTextDraw.