Ban checking problem
#1

I have a problem with my ban checking codes, sometimes it kicks players for ban evasion (but actually they're not banned) when they connected to the server

What's the problem?

I do ban check on OnPlayerConnect

pawn Код:
GetPlayerIp(playerid, PlayerInfo[playerid][IP], 33);
    format(str, sizeof(str),"[IP]: %s (%d) - %s", GetName(playerid), playerid, PlayerInfo[playerid][IP]);
    SendAdminMessage(GREY, str);
    ResetPlayerCash(playerid);
    ResetPlayerWeapons(playerid);
    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
    if(PlayerInfo[playerid][Banned] == 1)
    {
        new fstr[156];
        format(fstr,sizeof(fstr),"{C0C0C0}[SERVER] {FFFF00}%s (%d) {FFFFFF}has been kicked from the server {FFFF00}- Banned Player",GetName(playerid),playerid);
        SendClientMessageToAll(COLOR_WHITE, fstr);
        ResetPlayerStats(playerid);
        GameTextForPlayer(playerid, "~r~Kicked!", 8000, 5);
        SendClientMessage(playerid, COLOR_ERROR, "You have been kicked from the server because your account is banned! Try to do a ban appeal at skcnr.tk");
        SetTimerEx("KickPlayer", 300, false, "i", playerid);
    }
SOLVED
Reply
#2

pawn Код:
command(ban, playerid, params[])
{
    if(IsPlayerAdmin(playerid))//RCON
    {
        new ID, R[25], string[100];//R = Reason
        new name[MAX_PLAYER_NAME], name2[MAX_PLAYER_NAME];
        if(sscanf(params, "is", ID, R)) return SendClientMessage(playerid, 0xFF0000AA, "USAGE: /ban [ID] [Reason]");                                                    
        {
            if(ID != INVALID_PLAYER_ID)
            {
                SInfo[ID][Banned]=1;//To Make Player Banned When He Connect
                GetPlayerName(playerid, name, sizeof(name));
                GetPlayerName(ID, name2, sizeof(name2));
                format(string, sizeof(string), "%s[%d] has been banned By The Admin %s[%d] - %s", ID,name2, playerid, name, R);
                SendClientMessageToAll(0xFF1493FF, string);
                Kick(ID);
            }
            else SendClientMessage(playerid, 0xFF0000AA, "ID Not Connected.")
try this may it work for you
Reply
#3

I'm not talking about the ban command, I'm talking about the ban check. My ban command is fine though.

Also, it's solved. I placed the ban check under dialog login.
Reply
#4

http://forum.sa-mp.com/showpost.php?...83&postcount=1

try this may it help
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)