SA-MP Forums Archive
Tag Mismatch - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Tag Mismatch (/showthread.php?tid=370401)



Tag Mismatch - Healian - 19.08.2012

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 ================



Re: Tag Mismatch - Healian - 19.08.2012

Any HELP


Re: Tag Mismatch - Shetch - 19.08.2012

In which line do you get the error?


Re: Tag Mismatch - Jefff - 19.08.2012

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;
}



Re: Tag Mismatch - Healian - 19.08.2012

pawn Код:
return Res;



Re: Tag Mismatch - NinjaChicken - 19.08.2012

change it to return 1


Re: Tag Mismatch - Healian - 19.08.2012

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 ?