other way?
#1

is there a other (shorter) way to do this because it takes long time to load this onplayerconnect
pawn Код:
//OnPlayerConnect
if(isPlayerRangeBanned(playerid))
    {
        if(!isPlayerWhiteListed(playerid))
        {
            new string[59];
            Format(string, "SELECT * FROM `blacklist` WHERE `IP` = '%s'", splitip(PlayerIP(playerid)));
            mysql_query(string, THREAD_RANGEBANNED, playerid);
            SetPVarInt(playerid, "AlreadyBanned", 1);
        }
        else
        {
            new string[80];
            Format(string, "SELECT `pName` FROM `accs` WHERE `pName` = '%s'", PlayerName(playerid));
            mysql_query(string, THREAD_LOGINREGISTER, playerid);
        }
    }
   
    if(isPlayerTempBanned(playerid))
    {
        if(!isPlayerWhiteListed(playerid))
        {
            new string[72];
            Format(string, "SELECT * FROM `bans` WHERE `ipAddress` = '%s' AND `banTime` > '1'", PlayerIP(playerid));
            mysql_query(string, THREAD_TEMPBANNED1, playerid);
            SetPVarInt(playerid, "AlreadyBanned", 1);
        }
        else
        {
            new string[80];
            Format(string, "SELECT `pName` FROM `accs` WHERE `pName` = '%s'", PlayerName(playerid));
            mysql_query(string, THREAD_LOGINREGISTER, playerid);
        }
    }
   
    if(isPlayerBanned(playerid))
    {
        if(!isPlayerWhiteListed(playerid))
        {
            new string[86];
            Format(string, "SELECT * FROM `bans` WHERE `ipAddress` = '%s' AND `banTime` = '0'", PlayerIP(playerid));
            mysql_query(string, THREAD_WHITELISTED, playerid);
            SetPVarInt(playerid, "AlreadyBanned", 1);
        }
        else
        {
            new string[80];
            Format(string, "SELECT `pName` FROM `accs` WHERE `pName` = '%s'", PlayerName(playerid));
            mysql_query(string, THREAD_LOGINREGISTER, playerid);
        }
    }

    if(!isPlayerRangeBanned(playerid) && !isPlayerTempBanned(playerid) && !isPlayerBanned(playerid))
    {
        new string[80];
        if(isPlayerWhiteListed(playerid))
        {
            Format(string, "SELECT `pName` FROM `accs` WHERE `pName` = '%s'", PlayerName(playerid));
        }
        else
        {
            Format(string, "SELECT `pName` FROM `accs` WHERE `pName` = '%s'", PlayerName(playerid));
        }
        mysql_query(string, THREAD_LOGINREGISTER, playerid);
    }
Reply


Messages In This Thread
other way? - by Unknown123 - 27.09.2011, 20:02
Re: other way? - by sleepysnowflake - 27.09.2011, 20:08
Re: other way? - by Unknown123 - 27.09.2011, 20:17
Re: other way? - by sleepysnowflake - 27.09.2011, 20:19
Re: other way? - by Unknown123 - 27.09.2011, 20:31
Re: other way? - by sleepysnowflake - 27.09.2011, 20:35
Re: other way? - by GrimR - 27.09.2011, 20:39

Forum Jump:


Users browsing this thread: 1 Guest(s)