[Tutorial] MySQL Threaded queries with y_inline
#18

pawn Code:
stock IsPlayerRegistered(playerid)
{
    printf("CALLED BY ID : %d", playerid);
   
    new query[128];
    mysql_format(mysql, query, sizeof(query), "SELECT * FROM `PLAYERS` WHERE `USERNAME` = '%e' LIMIT 1", PlayerName(playerid));
    mysql_pquery(mysql, query, "OnPlayerAccountCheck", "dd", playerid, pData[playerid][P_MYSQL_RACE_CHECK]);
    printf("%s", query);

    inline OnPlayerAccountCheck(check)
    {
        if (check != pData[playerid][P_MYSQL_RACE_CHECK])
            return KickPlayer(playerid, "MySQL race occured, please reconnect!");

        if (cache_num_rows() > 0)
        {
            cache_get_field_content(0, "PASSWORD", pData[playerid][P_PASSWORD], mysql, 129);

            ShowPlayerCustomDialog(playerid, 2);
            BitFlag_On(fData[playerid], P_REGISTERED);
        }
        else
        {
            ShowPlayerCustomDialog(playerid, 1);

            SendClientMessage(playerid, 0xA6D8A6FF, "New player? /help /rules /cmds");
            GivePlayerMoney(playerid, 3000);
            pData[playerid][P_MONEY] = 3000;

            BitFlag_Off(fData[playerid], P_REGISTERED);
        }
    }
   
    mysql_tquery_inline(mysql, query, using inline OnPlayerAccountCheck, "d", pData[playerid][P_MYSQL_RACE_CHECK]);
    return 1;
}
This code does not get executed after /rcon gmx. It works every time the server is online except when you use gmx.

I spent like 20 minutes to find the issue which pissed me off.
Reply


Messages In This Thread
MySQL Threaded queries with y_inline - by Jay_ - 03.12.2014, 22:26
Re: MySQL Threaded queries with y_inline - by PT - 04.12.2014, 08:53
Re: MySQL Threaded queries with y_inline - by Lordzy - 04.12.2014, 13:02
Re: MySQL Threaded queries with y_inline - by Kaperstone - 04.12.2014, 13:26
Re: MySQL Threaded queries with y_inline - by maddinat0r - 04.12.2014, 14:48
Re: MySQL Threaded queries with y_inline - by iReacheR - 04.12.2014, 15:38
Re: MySQL Threaded queries with y_inline - by Lordzy - 04.12.2014, 15:59
Re: MySQL Threaded queries with y_inline - by Jay_ - 04.12.2014, 16:02
Re: MySQL Threaded queries with y_inline - by Jay_ - 08.12.2014, 10:44
Re: MySQL Threaded queries with y_inline - by rickisme - 08.12.2014, 19:19
Re: MySQL Threaded queries with y_inline - by maddinat0r - 09.12.2014, 14:53
Re: MySQL Threaded queries with y_inline - by rickisme - 10.12.2014, 15:06
Re: MySQL Threaded queries with y_inline - by iReacheR - 14.01.2015, 22:46
Re: MySQL Threaded queries with y_inline - by PaulDinam - 15.01.2015, 09:40
Re: MySQL Threaded queries with y_inline - by im - 15.01.2015, 12:02
Re: MySQL Threaded queries with y_inline - by maddinat0r - 17.01.2015, 13:08
Re: MySQL Threaded queries with y_inline - by andyandyy8 - 14.02.2015, 20:33
Re: MySQL Threaded queries with y_inline - by Cypress - 22.02.2015, 22:26
Re: MySQL Threaded queries with y_inline - by kurta999 - 12.01.2017, 23:11
Re: MySQL Threaded queries with y_inline - by renatog - 12.01.2017, 23:40
Re: MySQL Threaded queries with y_inline - by Yaa - 22.01.2017, 18:03

Forum Jump:


Users browsing this thread: 3 Guest(s)