Commands out of sync; you can't run this command now
#8

pawn Код:
new WhiteListed[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    new string[90];
    Format(string, "SELECT `pName` FROM `whitelist` WHERE `pName` = '%s' LIMIT 1", pName(playerid));
    mysql_query(string, THREAD_WHITELIST, playerid);
   
    serverInfoUpdate(true);
    if(isPlayerWhiteListed(playerid))
    {
        //code
    }
    return 1;
}

public OnQueryFinish(query[], resultid, extraid, connectionHandle)
{
    switch(resultid)
    {
        case THREAD_WHITELIST:
        {
            mysql_store_result();
            if(IsPlayerConnected(playerid) && mysql_num_rows() != 0)
            {
                WhiteListed[playerid] = 1;
            }
            else
            {
                WhiteListed[playerid] = 0;
            }
            mysql_free_result();
        }
    }
    return true;
}

stock isPlayerWhiteListed(playerid)
{
    if(WhiteListed[playerid] == 1) return true;
    return false;
}
Reply


Messages In This Thread
Commands out of sync; you can't run this command now - by Unknown123 - 16.12.2011, 12:25
Re: Commands out of sync; you can't run this command now - by BlackWolf120 - 16.12.2011, 12:43
Re: Commands out of sync; you can't run this command now - by Unknown123 - 16.12.2011, 12:49
Re: Commands out of sync; you can't run this command now - by BlackWolf120 - 16.12.2011, 13:26
Re: Commands out of sync; you can't run this command now - by Unknown123 - 16.12.2011, 13:47
Re: Commands out of sync; you can't run this command now - by BlackWolf120 - 16.12.2011, 13:51
Re: Commands out of sync; you can't run this command now - by Unknown123 - 16.12.2011, 14:02
Re: Commands out of sync; you can't run this command now - by Laronic - 16.12.2011, 15:04

Forum Jump:


Users browsing this thread: 4 Guest(s)