Tag mismatch, Cached variables [MySQL]
#1

Hey guys, I'm trying to make an offline admin removal CMD, and I wan't to verify if the account exists and the account admin level is lower than the command performer

This is the warning:
PHP код:
D:\MySQL\gamemodes\ALRP.pwn(27442) : warning 213tag mismatch 
This is the CMD:
PHP код:
CMD:oremoveadmin(playeridparams[])
{
    new 
playerb[32], string[128], query[248], Cache:result;
       if(!
IsPlayerLoggedIn(playerid) || PlayerInfo[playerid][pAsshole] == 1) return SendClientMessage(playeridCOLOR_GREY"You are not allowed to use this command.");
    if(
PlayerInfo[playerid][pAdmin] < 7) return SendClientMessage(playeridCOLOR_GREY"You are not authorized to use this command.");
    if(
sscanf(params"s[32]s[128]"playerbparams)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /oremoveadmin [playername] [confirm]");
    if(
RPIDFN(playerb) != INVALID_PLAYER_ID) return SendClientMessage(playeridCOLOR_GREY"Player is connected to the server, use /makeadmin instead.");
    
mysql_format(mysqlquerysizeof(query), "SELECT `Admin` FROM `users` WHERE `Name` = '%e' LIMIT 1"playerb);
    
result mysql_tquery(mysqlquery);
    if(
cache_get_row_count(mysql))
    {
        new 
adminlevel;
        
adminlevel cache_get_row_int(00mysql);
        if(
PlayerInfo[playerid][pAdmin] < adminlevel) return SendClientMessage(playeridCOLOR_GREY"Player has a higher admin level than you.");
         
mysql_format(mysqlquerysizeof(query), "UPDATE `users` SET `Admin`='0', `AdminAccount`='0' WHERE `Name`='%e' LIMIT 1"playerb);
         
mysql_tquery(mysqlquery);
    }
    else return 
SendClientMessage(playeridCOLOR_GREY"Player name not found");
    
cache_delete(result);
    
format(stringsizeof(string), "AdmWarn: %s has been offline removed from the Administrators team by %s"playerbRPN(playerid));
    
SendAdminMessage(COLOR_DARKRED1string);
    return 
1;

This is the line:
PHP код:
result mysql_tquery(mysqlquery); 
Note: It's my first time using cached variables instead of callback, Let me know if you have any tips

Thanks.
Reply
#2

To use this mode you must use mysql_query, not mysql_tquery.
Reply
#3

Quote:
Originally Posted by aoEXE
Посмотреть сообщение
To use this mode you must use mysql_query, not mysql_tquery.
Works, thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)