annoying warning
#1

pawn Код:
if (strcmp("/setofficer", cmdtext, true, 10) == 0)
    {
    new name[MAX_PLAYER_NAME+1], string[128+MAX_PLAYER_NAME+1], string2[128], name2[MAX_PLAYER_NAME+1];
    new tmp[128];  tmp  = strtok(cmdtext,idx);
    new tmp2[128];  tmp2  = strtok(cmdtext,idx);
    if(!strlen(tmp))
    {
                SendClientMessage(playerid, GRAY, " /setrank [ playerid ] [ rank ]");
                return 1;
    }
    if(!strlen(tmp2))
    {
                SendClientMessage(playerid, GRAY, "/setrank [ playerid ] [ rank ]");
                return 1;
    }
    new otherid = strval(tmp);
    new rank = strval(tmp2);
    if(PlayerData[i][LSPDRank] == 11 && PlayerData[otherid][rank] == 11)
    {
    GetPlayerName(playerid, name, sizeof(name));
    GetPlayerName(otherid, name2, sizeof(name2));
    format(string, sizeof(string), "[LSPD] Co-Chief %s has set your police rank to Police Chief.", name);
    format(string2, sizeof(string2), "[LSPD] You have set [ %s ] police rank to Police Chief. ", name2);
    SendClientMessage(otherid,GRAY,string);
    SendClientMessage(i,GRAY,string2);
    PlayerData[otherid][LSPDRank] = 11;
    return 1;
    }
    else{
    SendClientMessage(i, GRAY, "You must be a LSPD Chief / Co-Chief to use this command !");
    }
    return 1;
}
Can someone tell me what's wrong with this ?

if(PlayerData[i][LSPDRank] == 11 && PlayerData[otherid][rank] == 11)

tag mismatch warning
Reply
#2

maybe a better tab can solve this? or my eyes are bilnd and i cant see the problem
Reply
#3

what is "i", it is not defined in that code
Reply
#4

for(new i = 0; i < MAX_PLAYERS; i++)
Reply
#5

ok but i can't see in the code that loop


change [i] to [playerid]
Reply
#6

C:\Users\Cristian\Downloads\samp03e_svr_R2_win32\p awno\swag.pwn(251) : warning 213: tag mismatch
C:\Users\Cristian\Downloads\samp03e_svr_R2_win32\p awno\swag.pwn(262) : warning 213: tag mismatch


pawn Код:
if(PlayerData[playerid][LSPDRank] >= 11 && PlayerData[otherid][Police] >= 11)

pawn Код:
else if(PlayerData[playerid][LSPDRank] >= 10 && PlayerData[otherid][Police] >= 11)
Reply
#7

Are both "LSPDRank" and "Police" integers?
Reply
#8

LSPDRank is a enum Info.

pawn Код:
new Police = strval(tmp2);
new tmp2[128];  tmp2  = strtok(cmdtext,idx);
The problem is with Police, if i set any other rank it will compile correctly.
Reply
#9

So ?
Reply
#10

i think you should make it

pawn Код:
if(PlayerData[playerid][LSPDRank] >= 11 return PlayerData[otherid][Police] >= 11)
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)