Getting mistmatch warnings on an IF statement.
#1

I have no idea why, but I am getting some mismatch warnings on these two lines in my code:

PHP код:
CMD:admins(playeridparams[])
{
    new 
onlinestring[128];
       if(!
IsPlayerLoggedIn(playerid)) return SendClientMessage(playeridCOLOR_GREY"You need to login first before using any command.");
    foreach(
Playeri)
    {
        if(
PlayerInfo[i][pHelper])
        {
            
online ++;
        }
    }
    
format(stringsizeof(string), "|_____Bone County RolePlay Administrator Team_____|");
    
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
    foreach(
Playeri)
    {
        if(!
aDuty[i] == && PlayerInfo[i][pAdmin]) //Mismatch Warning 1
        
{
            
format(stringsizeof(string), " %s %s  status: Roleplaying "RPALN(i), RPN(i));
            
SendClientMessage(playeridCOLOR_DARKREDstring);
        }
        if(!
aDuty[i] == && PlayerInfo[i][pAdmin]) //Mismatch Warning 2
        
{
            
format(stringsizeof(string), " %s %s  status: On duty "RPALN(i), RPN(i));
            
SendClientMessage(playeridCOLOR_DARKREDstring);
        }
    }
    return 
1;

Would appreciate the help, thanks!
Reply
#2

pawn Код:
if(!aDuty[i] == 1
This cause you tag mismatch, read https://sampwiki.blast.hk/wiki/Control_Structures
Reply
#3

Remove ! from aDuty. You cannot check if it is 0 using ! and if it is 1 or 2 at the same time. It expects none but finds bool tag.
Reply
#4

Quote:
Originally Posted by Calisthenics
Посмотреть сообщение
Remove ! from aDuty. You cannot check if it is 0 using ! and if it is 1 or 2 at the same time. It expects none but finds bool tag.
That fixed it, thank you very much.
I feel so dumb not seeing that problem now, lol.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)