Warning 213: Tag Mismatch !
#1

I have enums and i want to set value to them as normal i tried to do this

pawn Code:
new Float:x, Float:y, Float:z;

GetPlayerPos(playerid, x, y, z);

pInfo[playerid][pX] = x;
pInfo[playerid][pY] = y;
pInfo[playerid][pZ] = z;
but i get this warning on compiling

pawn Code:
Current directory: C:\Users\Healian\Desktop\SA-MP\samp03e_svr_R2_win32\gamemodes
ARole.pwn(1109) : warning 213: tag mismatch
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Warnings.
================ READY ================
Reply
#2

Quote:
Originally Posted by Healian
View Post
I have enums and i want to set value to them as normal i tried to do this

pawn Code:
new Float:x, Float:y, Float:z;

GetPlayerPos(playerid, x, y, z);

pInfo[playerid][pX] = x;
pInfo[playerid][pY] = y;
pInfo[playerid][pZ] = z;
but i get this warning on compiling

pawn Code:
Current directory: C:\Users\Healian\Desktop\SA-MP\samp03e_svr_R2_win32\gamemodes
ARole.pwn(1109) : warning 213: tag mismatch
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Warnings.
================ READY ================
Do you have pX, pY and pZ in an enum you've made?
Reply
#3

yea here is the code

pawn Code:
enum pINF
{
    prSTEP,
    pSQ,
    pSA,
    pIP,
    pRDATE,
    pADMINLVL,
    pVIPLVL,
    pPLAYERRANK,
    pWANTEDLVL,
        pSCORE,
        pMONEY,
        pKILLS,
        pDEATHS,
    pX,
    pY,
    pZ,
    pINTERIOR,
    pWORLD,
    pHEALTH,
    pARMOR,
    pSKIN,
    pWEAP1,
    pWEAP1A,
    pWEAP2,
    pWEAP2A,
    pWEAP3,
    pWEAP3A,
    pWEAP4,
    pWEAP4A,
    pWEAP5,
    pWEAP5A,
    pWEAP6,
    pWEAP6A,
    pVEHI1,
    pVEHI2,
    pVEHI3,
    pVEHI4,
    pVEHI5,
    pJAILED,
    pJAILTIME,
    pWARNINGS,
    pMUTED,
    pCOLOR
};

new pInfo[MAX_PLAYERS][pINF];
Reply
#4

pX must be Float:
Reply
#5

mmm but i made all the saving and retrieving code as pX not a Float what should i do now

when i make them Floats i get the warnings in another areas in the code
Reply
#6

Just add Float: before px, py and pz...
Reply
#7

i know but i get another warnings when i convert them to floats cuz i have a SQLLITE Update query which take the value from the pX,pY,pZ and saves to the database
Reply
#8

Quote:
Originally Posted by Healian
View Post
i know but i get another warnings when i convert them to floats cuz i have a SQLLITE Update query which take the value from the pX,pY,pZ and saves to the database
it should be:

pawn Code:
Float:pX,
Float:pY,
Float:pZ,
Show us the warnings?
Reply
#9

mmm What about this when i made them Floats the warnings goes there

pawn Code:
format(Query, sizeof(Query), "UPDATE `PersonalInfo` SET PLAYERRANK = '%d', WANTEDLEVEL = '%d', SCORE = '%d', CASH = '%d', KILLS = '%d', DEATHS = '%d', X = '%d', Y = '%d', Z = '%d', INTERIOR = '%d', WORLD = '%d', HEALTH = '%d', ARMOR = '%d', SKIN = '%d' WHERE `NAME` = '%s'", DB_Escape(pInfo[playerid][pPLAYERRANK]),
                                                                                                                                                                                                                                                                                       DB_Escape(pInfo[playerid][pWANTEDLVL]),
                                                                                                                                                                                                                                                                                       DB_Escape(pInfo[playerid][pSCORE]),
                                                                                                                                                                                                                                                                                       DB_Escape(pInfo[playerid][pMONEY]),
                                                                                                                                                                                                                                                                                       DB_Escape(pInfo[playerid][pKILLS]),
                                                                                                                                                                                                                                                                                       DB_Escape(pInfo[playerid][pDEATHS]),
                                                                                                                                                                                                                                                                                       DB_Escape(pInfo[playerid][pX]),
                                                                                                                                                                                                                                                                                       DB_Escape(pInfo[playerid][pY]),
                                                                                                                                                                                                                                                                                       DB_Escape(pInfo[playerid][pZ]),
                                                                                                                                                                                                                                                                                       DB_Escape(pInfo[playerid][pINTERIOR]),
                                                                                                                                                                                                                                                                                       DB_Escape(pInfo[playerid][pWORLD]),
                                                                                                                                                                                                                                                                                       DB_Escape(pInfo[playerid][pHEALTH]),
                                                                                                                                                                                                                                                                                       DB_Escape(pInfo[playerid][pARMOR]),
                                                                                                                                                                                                                                                                                       DB_Escape(pInfo[playerid][pSKIN]),
                                                                                                                                                                                                                                                                                       DB_Escape(pName));
Reply
#10

Then change the type of the corresponding fields on your db and instead of %d use %f
Reply
#11

Quote:
Originally Posted by DreamOnIt
View Post
The change the type of the corresponding fields on your db
now save the float as a float not "%d" and see if it get's fix. use "%f" instead of "%d".
Reply
#12

i tried to change the %d to %s and %f but same warnings
Reply
#13

Quote:
Originally Posted by Healian
View Post
i tried to change the %d to %s and %f but same warnings
Show what warnings you get?
Reply
#14

Not %s, %f! And px, py and pz must be tagged Float:
You MUST do that :P
Reply
#15

pawn Code:
ARole.pwn(817 -- 823) : warning 213: tag mismatch
ARole.pwn(817 -- 824) : warning 213: tag mismatch
ARole.pwn(817 -- 825) : warning 213: tag mismatch
ARole.pwn(817 -- 828) : warning 213: tag mismatch
ARole.pwn(817 -- 829) : warning 213: tag mismatch
SAME

Quote:
Originally Posted by DreamOnIt
View Post
Not %s, %f! And px, py and pz must be tagged Float:
You MUST do that :P
I already tagged them as floats in the enum so the first warnings disappeared but the warnings gone to my data abse saving code as i told

Snippet from enums after i added float to them

pawn Code:
Float:pX,
    Float:pY,
    Float:pZ,
    pINTERIOR,
    pWORLD,
    Float:pHEALTH,
    Float:pARMOR,
Reply
#16

Quote:
Originally Posted by DreamOnIt
View Post
Not %s, %f! And px, py and pz must be tagged Float:
You MUST do that :P
He did it and now if he want to save a float he must use %f ...

Quote:

ARole.pwn(817 -- 823) : warning 213: tag mismatch
ARole.pwn(817 -- 824) : warning 213: tag mismatch
ARole.pwn(817 -- 825) : warning 213: tag mismatch
ARole.pwn(817 -- 82 : warning 213: tag mismatch
ARole.pwn(817 -- 829) : warning 213: tag mismatch

LINES?
Reply
#17

the pX,pY,pZ are the errors at first, and pawn can't show all errors at same time.
So change them to FloatX,FloatY,FloatZ
and the compile, show me the lines+errors
Reply
#18

I ALREADY Changed the pX,pY,pZ in enums to FloatX,FloatY,FloatZ

and here is my lines which get the warnings now

pawn Code:
format(Query, sizeof(Query), "UPDATE `PersonalInfo` SET PLAYERRANK = '%d', WANTEDLEVEL = '%d', SCORE = '%d', CASH = '%d', KILLS = '%d', DEATHS = '%d', X = '%d', Y = '%d', Z = '%d', INTERIOR = '%d', WORLD = '%d', HEALTH = '%d', ARMOR = '%d', SKIN = '%d' WHERE `NAME` = '%s'", DB_Escape(pInfo[playerid][pPLAYERRANK]),
                                                                                                                                                                                                                                                                                       DB_Escape(pInfo[playerid][pWANTEDLVL]),
                                                                                                                                                                                                                                                                                       DB_Escape(pInfo[playerid][pSCORE]),
                                                                                                                                                                                                                                                                                       DB_Escape(pInfo[playerid][pMONEY]),
                                                                                                                                                                                                                                                                                       DB_Escape(pInfo[playerid][pKILLS]),
                                                                                                                                                                                                                                                                                       DB_Escape(pInfo[playerid][pDEATHS]),
                                                                                                                                                                                                                                                                                       DB_Escape(pInfo[playerid][pX]),
                                                                                                                                                                                                                                                                                       DB_Escape(pInfo[playerid][pY]),
                                                                                                                                                                                                                                                                                       DB_Escape(pInfo[playerid][pZ]),
                                                                                                                                                                                                                                                                                       DB_Escape(pInfo[playerid][pINTERIOR]),
                                                                                                                                                                                                                                                                                       DB_Escape(pInfo[playerid][pWORLD]),
                                                                                                                                                                                                                                                                                       DB_Escape(pInfo[playerid][pHEALTH]),
                                                                                                                                                                                                                                                                                       DB_Escape(pInfo[playerid][pARMOR]),
                                                                                                                                                                                                                                                                                       DB_Escape(pInfo[playerid][pSKIN]),
                                                                                                                                                                                                                                                                                       DB_Escape(pName));
WARNINGS
pawn Code:
Current directory: C:\Users\Healian\Desktop\SA-MP\samp03e_svr_R2_win32\gamemodes
ARole.pwn(815 -- 821) : warning 213: tag mismatch
ARole.pwn(815 -- 822) : warning 213: tag mismatch
ARole.pwn(815 -- 823) : warning 213: tag mismatch
ARole.pwn(815 -- 826) : warning 213: tag mismatch
ARole.pwn(815 -- 827) : warning 213: tag mismatch
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


5 Warnings.
================ READY ================
Note : i tried to change the %d in the query to %f with no luck


My Enums after edit [fixed the first warnings that i opened the thread for but got the new warnings that i represented above ]

pawn Code:
enum pINF
{
    prSTEP,
    pSQ,
    pSA,
    pIP,
    pRDATE,
    pADMINLVL,
    pVIPLVL,
    pPLAYERRANK,
    pWANTEDLVL,
    pSCORE,
    pMONEY,
    pKILLS,
    pDEATHS,
    Float:pX,
    Float:pY,
    Float:pZ,
    pINTERIOR,
    pWORLD,
    Float:pHEALTH,
    Float:pARMOR,
    pSKIN,
    pWEAP1,
    pWEAP1A,
    pWEAP2,
    pWEAP2A,
    pWEAP3,
    pWEAP3A,
    pWEAP4,
    pWEAP4A,
    pWEAP5,
    pWEAP5A,
    pWEAP6,
    pWEAP6A,
    pVEHI1,
    pVEHI2,
    pVEHI3,
    pVEHI4,
    pVEHI5,
    pJAILED,
    pJAILTIME,
    pWARNINGS,
    pMUTED,
    pCOLOR
};

new pInfo[MAX_PLAYERS][pINF];
Reply
#19

Quote:
Originally Posted by Healian
View Post
I have enums and i want to set value to them as normal i tried to do this

pawn Code:
new Float:x, Float:y, Float:z;

GetPlayerPos(playerid, x, y, z);

pInfo[playerid][pX] = x;
pInfo[playerid][pY] = y;
pInfo[playerid][pZ] = z;
but i get this warning on compiling

pawn Code:
Current directory: C:\Users\Healian\Desktop\SA-MP\samp03e_svr_R2_win32\gamemodes
ARole.pwn(1109) : warning 213: tag mismatch
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Warnings.
================ READY ================
pawn Code:
GetPlayerPos(playerid, pInfo[playerid][pX], pInfo[playerid][pY], pInfo[playerid][pZ]);
Much simpler, not really necessary to create three new variables when they aren't needed.


You could always use floatstr to convert it from a string back to a float (the query result when loading).

Also..You don't need DB_Escape when dealing with things non user input most of the time. All it's doing is slowing down your query.
Reply
#20

you talked about my first problem i thank you very much but my problem now gone to the DB query


HERE :
Quote:
Originally Posted by Healian
View Post
I ALREADY Changed the pX,pY,pZ in enums to FloatX,FloatY,FloatZ

and here is my lines which get the warnings now

pawn Code:
format(Query, sizeof(Query), "UPDATE `PersonalInfo` SET PLAYERRANK = '%d', WANTEDLEVEL = '%d', SCORE = '%d', CASH = '%d', KILLS = '%d', DEATHS = '%d', X = '%d', Y = '%d', Z = '%d', INTERIOR = '%d', WORLD = '%d', HEALTH = '%d', ARMOR = '%d', SKIN = '%d' WHERE `NAME` = '%s'", DB_Escape(pInfo[playerid][pPLAYERRANK]),
                                                                                                                                                                                                                                                                                       DB_Escape(pInfo[playerid][pWANTEDLVL]),
                                                                                                                                                                                                                                                                                       DB_Escape(pInfo[playerid][pSCORE]),
                                                                                                                                                                                                                                                                                       DB_Escape(pInfo[playerid][pMONEY]),
                                                                                                                                                                                                                                                                                       DB_Escape(pInfo[playerid][pKILLS]),
                                                                                                                                                                                                                                                                                       DB_Escape(pInfo[playerid][pDEATHS]),
                                                                                                                                                                                                                                                                                       DB_Escape(pInfo[playerid][pX]),
                                                                                                                                                                                                                                                                                       DB_Escape(pInfo[playerid][pY]),
                                                                                                                                                                                                                                                                                       DB_Escape(pInfo[playerid][pZ]),
                                                                                                                                                                                                                                                                                       DB_Escape(pInfo[playerid][pINTERIOR]),
                                                                                                                                                                                                                                                                                       DB_Escape(pInfo[playerid][pWORLD]),
                                                                                                                                                                                                                                                                                       DB_Escape(pInfo[playerid][pHEALTH]),
                                                                                                                                                                                                                                                                                       DB_Escape(pInfo[playerid][pARMOR]),
                                                                                                                                                                                                                                                                                       DB_Escape(pInfo[playerid][pSKIN]),
                                                                                                                                                                                                                                                                                       DB_Escape(pName));
WARNINGS
pawn Code:
Current directory: C:\Users\Healian\Desktop\SA-MP\samp03e_svr_R2_win32\gamemodes
ARole.pwn(815 -- 821) : warning 213: tag mismatch
ARole.pwn(815 -- 822) : warning 213: tag mismatch
ARole.pwn(815 -- 823) : warning 213: tag mismatch
ARole.pwn(815 -- 826) : warning 213: tag mismatch
ARole.pwn(815 -- 827) : warning 213: tag mismatch
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


5 Warnings.
================ READY ================
Note : i tried to change the %d in the query to %f with no luck


My Enums after edit [fixed the first warnings that i opened the thread for but got the new warnings that i represented above ]

pawn Code:
enum pINF
{
    prSTEP,
    pSQ,
    pSA,
    pIP,
    pRDATE,
    pADMINLVL,
    pVIPLVL,
    pPLAYERRANK,
    pWANTEDLVL,
    pSCORE,
    pMONEY,
    pKILLS,
    pDEATHS,
    Float:pX,
    Float:pY,
    Float:pZ,
    pINTERIOR,
    pWORLD,
    Float:pHEALTH,
    Float:pARMOR,
    pSKIN,
    pWEAP1,
    pWEAP1A,
    pWEAP2,
    pWEAP2A,
    pWEAP3,
    pWEAP3A,
    pWEAP4,
    pWEAP4A,
    pWEAP5,
    pWEAP5A,
    pWEAP6,
    pWEAP6A,
    pVEHI1,
    pVEHI2,
    pVEHI3,
    pVEHI4,
    pVEHI5,
    pJAILED,
    pJAILTIME,
    pWARNINGS,
    pMUTED,
    pCOLOR
};

new pInfo[MAX_PLAYERS][pINF];
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)