TextDrawSetString Warnings
#1

PHP код:
new inviteridstrt[256]; 
PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    new 
str[121+MAX_PLAYER_NAME];
    new 
iname[MAX_PLAYER_NAME]; new name[MAX_PLAYER_NAME];
    
GetPlayerName(inviteridinamesizeof(iname));
    
GetPlayerName(playeridnamesizeof(name));
    
    if(
dialogid == 99)
    {
        if(
response)
        {
            
format(strsizeof(str), "%s has join your squad."name);
            
SendClientMessage(inviteridCol_Greystr);
            
InSquad[playerid] = 1;
            
format(strt,sizeof(strt),"~b~%s"iname);
            
TextDrawSetString(TDEditor_PTD[playerid][2], strt);
            
format(strt,sizeof(strt),"~b~%s"name);
            
TextDrawSetString(TDEditor_PTD[playerid][3], strt);
            
PlayerTextDrawShow(playeridTDEditor_PTD[playerid][0]);
            
PlayerTextDrawShow(playeridTDEditor_PTD[playerid][2]);
            
PlayerTextDrawShow(playeridTDEditor_PTD[playerid][1]);
            
PlayerTextDrawShow(playeridTDEditor_PTD[playerid][3]);
            
            
PlayerTextDrawShow(inviteridTDEditor_PTD[playerid][0]);
            
PlayerTextDrawShow(inviteridTDEditor_PTD[playerid][2]);
            
PlayerTextDrawShow(inviteridTDEditor_PTD[playerid][1]);
            
PlayerTextDrawShow(inviteridTDEditor_PTD[playerid][3]);
        }
        else
        {
            
format(strsizeof(str), "%s has deny your squad invitation."name);
            
SendClientMessage(inviteridCol_Greystr);
        }
    }
    return 
1;

Код:
E:\SA-MP Server Scripts\[S]uper\gamemodes\[S]uper2.pwn(739) : warning 213: tag mismatch
E:\SA-MP Server Scripts\[S]uper\gamemodes\[S]uper2.pwn(741) : warning 213: tag mismatch
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Warnings.
Quote:

Line 739- TextDrawSetString(TDEditor_PTD[playerid][2], strt);
Line 741- TextDrawSetString(TDEditor_PTD[playerid][3], strt);

Why am I getting tag mismatches? Help me please.

btw for inviterid its suppose to be the id of the player whos inviting the other player, but it doesn't look like it can anybody tell me what I did wrong?
Reply
#2

You got a tag mismatch there because you need to use PlayerTextDrawSetString, the PlayerText version of TextDrawSetString.

For the other problem, what exactly doesn't work with the ID?
Reply
#3

Quote:
Originally Posted by NaS
Посмотреть сообщение
You got a tag mismatch there because you need to use PlayerTextDrawSetString, the PlayerText version of TextDrawSetString.

For the other problem, what exactly doesn't work with the ID?
Ohhhhhh, wow I feel so stupid, thank you, and for the second thing, when I tested it worked fine.
Reply
#4

Quote:
Originally Posted by Heroleo911003
Посмотреть сообщение
PHP код:
new inviteridstrt[256]; 
PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    new 
str[121+MAX_PLAYER_NAME];
    new 
iname[MAX_PLAYER_NAME]; new name[MAX_PLAYER_NAME];
    
GetPlayerName(inviteridinamesizeof(iname));
    
GetPlayerName(playeridnamesizeof(name));
    
    if(
dialogid == 99)
    {
        if(
response)
        {
            
format(strsizeof(str), "%s has join your squad."name);
            
SendClientMessage(inviteridCol_Greystr);
            
InSquad[playerid] = 1;
            
format(strt,sizeof(strt),"~b~%s"iname);
            
TextDrawSetString(TDEditor_PTD[playerid][2], strt);
            
format(strt,sizeof(strt),"~b~%s"name);
            
TextDrawSetString(TDEditor_PTD[playerid][3], strt);
            
PlayerTextDrawShow(playeridTDEditor_PTD[playerid][0]);
            
PlayerTextDrawShow(playeridTDEditor_PTD[playerid][2]);
            
PlayerTextDrawShow(playeridTDEditor_PTD[playerid][1]);
            
PlayerTextDrawShow(playeridTDEditor_PTD[playerid][3]);
            
            
PlayerTextDrawShow(inviteridTDEditor_PTD[playerid][0]);
            
PlayerTextDrawShow(inviteridTDEditor_PTD[playerid][2]);
            
PlayerTextDrawShow(inviteridTDEditor_PTD[playerid][1]);
            
PlayerTextDrawShow(inviteridTDEditor_PTD[playerid][3]);
        }
        else
        {
            
format(strsizeof(str), "%s has deny your squad invitation."name);
            
SendClientMessage(inviteridCol_Greystr);
        }
    }
    return 
1;

Код:
E:\SA-MP Server Scripts\[S]uper\gamemodes\[S]uper2.pwn(739) : warning 213: tag mismatch
E:\SA-MP Server Scripts\[S]uper\gamemodes\[S]uper2.pwn(741) : warning 213: tag mismatch
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Warnings.
Why am I getting tag mismatches? Help me please.

btw for inviterid its suppose to be the id of the player whos inviting the other player, but it doesn't look like it can anybody tell me what I did wrong?
I also got this problem but it`s still works fine, try to check the amx file if its have (KB) if not well its not working..
Reply
#5

Quote:
Originally Posted by KingSenpai
Посмотреть сообщение
I also got this problem but it`s still works fine, try to check the amx file if its have (KB) if not well its not working..
That is because tag mismatch is a warning and not an error. It will always compile (which means nothing).

But the actual problem here wasn't the tag mismatch, but that the wrong function was used (which, as a result, caused a tag mismatch warning). So in this case, it would NOT have worked just because it compiled.

You cannot assume something might work just because it worked for you once. A plain tag mismatch is not causing any errors, but it may not be the actual problem (just like here).
Reply
#6

Quote:
Originally Posted by KingSenpai
Посмотреть сообщение
I also got this problem but it`s still works fine, try to check the amx file if its have (KB) if not well its not working..
Yeah, its fixed already
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)