SA-MP Forums Archive
"Ban" CallBack. - 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: "Ban" CallBack. (/showthread.php?tid=596761)



"Ban" CallBack. - norton2 - 22.12.2015

Sometimes not good information extracted from the table "bans". If I did not ban, kick me and tells me that I have.
And when do I have to relog, to work.

OnPlayerConnect:
Код HTML:
 mysql_format(MySQLCon, query, sizeof(query), "SELECT * FROM bans WHERE IP = '%s' OR `Player` = '%e'", playerIP, GetName(playerid));
    mysql_pquery(MySQLCon, query, "OnBanCheck", "d", playerid);
Код HTML:
forward OnBanCheck(playerid);
public OnBanCheck(playerid)
{
    new rows = cache_num_rows(), query[500];
    if(rows)
    {
        SetTimerEx("KickPublic", 50, false, "i", playerid);
        return 1;
    }
    else
    {
        mysql_format(MySQLCon, query, sizeof(query), "SELECT * FROM `players` WHERE `user` = '%e' LIMIT 1", GetName(playerid));
        mysql_pquery(MySQLCon, query, "OnAccountCheck", "d", playerid);
    }
    return 1;
}



Re: "Ban" CallBack. - norton2 - 22.12.2015

Bump.