Tag Mismatch
#1

I have created that code to return the Secret Question of a player on calling it

pawn Код:
stock getPlayerSecret(playerid)
{
    new
        Query[ 384 ],
        DBResult: Result,
        pName[ MAX_PLAYER_NAME ],
        Res[ 50 ]
    ;
    GetPlayerName(playerid, pName, sizeof(pName));
    format(Query, sizeof(Query), "SELECT SQ FROM `Accounts` WHERE `NAME` = '%s' COLLATE NOCASE", pName);
    Result = db_query(DATABASE, Query);
    format(Res, sizeof(Res), "%s", Result);
   
    return Res;
}
but i got this warning
pawn Код:
Current directory: C:\Users\Healian\Desktop\SA-MP\samp03e_svr_R2_win32\gamemodes
ARole.pwn(1690) : warning 213: tag mismatch
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Warning.
================ READY ================
Reply
#2

Any HELP
Reply
#3

In which line do you get the error?
Reply
#4

pawn Код:
stock getPlayerSecret(playerid)
{
    new
        Query[ 128 ],
        DBResult: Result,
        pName[ MAX_PLAYER_NAME ],
        Res[ 50 ]
        ;
    GetPlayerName(playerid, pName, sizeof(pName));
    format(Query, sizeof(Query), "SELECT SQ FROM `Accounts` WHERE `NAME` = '%s' COLLATE NOCASE LIMIT 1;", pName);
    Result = db_query(DATABASE, Query);
    db_get_field_assoc(Result, "SQ", Res, sizeof(Res));
    db_free_result(Result);
    return Res;
}
Reply
#5

pawn Код:
return Res;
Reply
#6

change it to return 1
Reply
#7

Jefff : Thank you very very very very much this one worked +REP for you and for Shetch

but a small question why used
db_free_result(Result);

even though new "Result" is created every time the function is executed ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)