Tag mismatch warning on strcmp lines
#1

pawn Код:
if(!strcmp(PlayerInfo[playerid][pInv1],"empty",1)) PlayerInfo[playerid][pInv1] = item;
I have about 90 other lines like this one, all giving out tag mismatch warnings and I can't figure out why. InvX is a string in my player enum and 'item' in this instance is also a string. All of the same size (32 chars).

These other uses are giving out the same warning:
pawn Код:
if(!strcmp(PlayerInfo[playerid][pInv7],"empty",1)) sc++;
pawn Код:
else if(!strcmp(PlayerInfo[playerid][pInv12],"empty",1)) return 12;
I've tried several things and can't seem to shake the warnings away. And I've expanded the braces to make something like this:
pawn Код:
if(!strcmp(PlayerInfo[playerid][pInv1],"empty",1))
{
    PlayerInfo[playerid][pInv1] = item;
}
so I know that the problem is somewhere in the strcmp function and not where I set the inventory item.
Reply
#2

enum isn't a string. It's a integer.

pawn Код:
enum LOL
{
    let, // Supposed to be 1?
    me, // Supposed to be 2?
    do,
    a,
    little,
    test
}

// Supposing that LetMeDo[playerid][let] = 1; is the same that LetMeDo[playerid][1] = 1;

new LetMeDo[MAX_PLAYERS][LOL];

Now Let, me, do, a, little, test are all INTEGERS.
Reply
#3

Quote:
Originally Posted by arakuta
Посмотреть сообщение
enum isn't a string. It's a integer.

pawn Код:
enum LOL
{
    let, // Supposed to be 1?
    me, // Supposed to be 2?
    do,
    a,
    little,
    test
}

// Supposing that LetMeDo[playerid][let] = 1; is the same that LetMeDo[playerid][1] = 1;

new LetMeDo[MAX_PLAYERS][LOL];

Now Let, me, do, a, little, test are all INTEGERS.
In your example yes. But,
pawn Код:
enum pInfo
{
    pSkin,
    pAdmin,
    pJob,
    pLevel,
    pCash,
    pCashInBank,
    Float:pLastX,
    Float:pLastY,
    Float:pLastZ,
    pLastVW,
    pLastInterior,
    pBanned,
    pWarns,
    pBizID,
    pHouseID,
    pVehicleID1,
    pVehicleID2,
    pVehicleID3,
    pCurrentVKey,
    pSpawnPoint,
    pRentingHouseID,
    pLastDiscReason,
    pPlayerXP,
    pDonationTokens,
    pForumName[32],
    pInv1[32],
    pInv2[32],
    pInv3[32],
    pInv4[32],
    pInv5[32],
    pInv6[32],
    pInv7[32],
    pInv8[32],
    pInv9[32],
    pInv10[32],
    pInv11[32],
    pInv12[32],
    pBoughtBag
}
new PlayerInfo[MAX_PLAYERS][pInfo];
ForumName and the inventory slots in my script are not.
Reply
#4

Can you give us the whole function of that snippet ?
Reply
#5

The first example comes from this:
pawn Код:
stock BuyItemForPlayer(playerid,itemlistid)
{
    new item[32];
    format(item,sizeof(item),"%s",GetItemNameFromShopList(itemlistid));
    if(PlayerInfo[playerid][pBoughtBag] == 0) {
        if(!strcmp(PlayerInfo[playerid][pInv1],"empty",1)) PlayerInfo[playerid][pInv1] = item;
        else if(!strcmp(PlayerInfo[playerid][pInv2],"empty",1)) PlayerInfo[playerid][pInv2] = item;
        else if(!strcmp(PlayerInfo[playerid][pInv3],"empty",1)) PlayerInfo[playerid][pInv3] = item;
        else if(!strcmp(PlayerInfo[playerid][pInv4],"empty",1)) PlayerInfo[playerid][pInv4] = item;
        else if(!strcmp(PlayerInfo[playerid][pInv5],"empty",1)) PlayerInfo[playerid][pInv5] = item;
        else if(!strcmp(PlayerInfo[playerid][pInv6],"empty",1)) PlayerInfo[playerid][pInv6] = item;
        else if(!strcmp(PlayerInfo[playerid][pInv7],"empty",1)) PlayerInfo[playerid][pInv7] = item;
        else if(!strcmp(PlayerInfo[playerid][pInv8],"empty",1)) PlayerInfo[playerid][pInv8] = item;
    }
    else if(PlayerInfo[playerid][pBoughtBag] == 1) {
        if(!strcmp(PlayerInfo[playerid][pInv1],"empty",1)) PlayerInfo[playerid][pInv1] = item;
        else if(!strcmp(PlayerInfo[playerid][pInv2],"empty",1)) PlayerInfo[playerid][pInv2] = item;
        else if(!strcmp(PlayerInfo[playerid][pInv3],"empty",1)) PlayerInfo[playerid][pInv3] = item;
        else if(!strcmp(PlayerInfo[playerid][pInv4],"empty",1)) PlayerInfo[playerid][pInv4] = item;
        else if(!strcmp(PlayerInfo[playerid][pInv5],"empty",1)) PlayerInfo[playerid][pInv5] = item;
        else if(!strcmp(PlayerInfo[playerid][pInv6],"empty",1)) PlayerInfo[playerid][pInv6] = item;
        else if(!strcmp(PlayerInfo[playerid][pInv7],"empty",1)) PlayerInfo[playerid][pInv7] = item;
        else if(!strcmp(PlayerInfo[playerid][pInv8],"empty",1)) PlayerInfo[playerid][pInv8] = item;
        else if(!strcmp(PlayerInfo[playerid][pInv9],"empty",1)) PlayerInfo[playerid][pInv9] = item;
        else if(!strcmp(PlayerInfo[playerid][pInv10],"empty",1)) PlayerInfo[playerid][pInv10] = item;
    }
    else if(PlayerInfo[playerid][pBoughtBag] == 2) {
        if(!strcmp(PlayerInfo[playerid][pInv1],"empty",1)) PlayerInfo[playerid][pInv1] = item;
        else if(!strcmp(PlayerInfo[playerid][pInv2],"empty",1)) PlayerInfo[playerid][pInv2] = item;
        else if(!strcmp(PlayerInfo[playerid][pInv3],"empty",1)) PlayerInfo[playerid][pInv3] = item;
        else if(!strcmp(PlayerInfo[playerid][pInv4],"empty",1)) PlayerInfo[playerid][pInv4] = item;
        else if(!strcmp(PlayerInfo[playerid][pInv5],"empty",1)) PlayerInfo[playerid][pInv5] = item;
        else if(!strcmp(PlayerInfo[playerid][pInv6],"empty",1)) PlayerInfo[playerid][pInv6] = item;
        else if(!strcmp(PlayerInfo[playerid][pInv7],"empty",1)) PlayerInfo[playerid][pInv7] = item;
        else if(!strcmp(PlayerInfo[playerid][pInv8],"empty",1)) PlayerInfo[playerid][pInv8] = item;
        else if(!strcmp(PlayerInfo[playerid][pInv9],"empty",1)) PlayerInfo[playerid][pInv9] = item;
        else if(!strcmp(PlayerInfo[playerid][pInv10],"empty",1)) PlayerInfo[playerid][pInv10] = item;
        else if(!strcmp(PlayerInfo[playerid][pInv11],"empty",1)) PlayerInfo[playerid][pInv11] = item;
        else if(!strcmp(PlayerInfo[playerid][pInv12],"empty",1)) PlayerInfo[playerid][pInv12] = item;
    }
    return 1;
}
Reply
#6

Anyone else? The script is working fine, but the warnings will not go away.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)