Ban check problem!
#1

Hello,

When ever someone is banned and they try to join it will just give them

Joining Game.. bla bla


then it says its restarting , and ofc that is not what it supposed to say. It's supposed to say that they are banned ect.

Here is the code!

pawn Код:
format(bancheck, sizeof(bancheck),"Users/Bans/%s.ban",playersip);

    for(new i = 0; i < MAX_PLAYERS; i++)
    if(dini_Exists(bancheck))
    {
        ClearChatbox(playerid, 10);

        if(!strcmp(dini_Get(bancheck,"BanName"),plname,true))
        {
            SendClientMessage(playerid, COLOR_LIGHTBLUE,"This Nickname is banned from the server.");
            format(msg2,sizeof(msg2),"Banned by %s",dini_Get(bancheck,"BannedBy"));
            SendClientMessage(playerid, COLOR_WHITE,msg2);
            format(msg2,sizeof(msg2),"Ban issued on %s",dini_Get(bancheck,"BanDate"));
            SendClientMessage(playerid, COLOR_WHITE,msg2);
            format(msg2,sizeof(msg2),"Banned for %s",dini_Get(bancheck,"BanReason"));
            SendClientMessage(playerid, COLOR_WHITE,msg2);

            format(msg2,sizeof(msg2),"[ADMIN]: %s (%d) was kicked by Smithy for ban evading",plname,playerid);
            SendAdminMessage(COLOR_RED,msg2);

            format(msg2,sizeof(msg2),"(%d/%d/%d) [%d:%d:%d] %s Has been kicked by the anticheat for Possible Ban Evading",d,m,y,h,mi,s,plname);
            KickLog(msg2);

            OnPlayerUpdateEx(playerid);
            SetTimerEx("KickPlayerOut",500,false,"i",playerid);
            return 1;
        }
        else
        {
            SendClientMessage(playerid, COLOR_LIGHTBLUE,"This IP is banned from the server.");
            format(msg2,sizeof(msg2),"Banned by %s",dini_Get(bancheck,"BannedBy"));
            SendClientMessage(playerid, COLOR_WHITE,msg2);
            format(msg2,sizeof(msg2),"Ban issued on %s",dini_Get(bancheck,"BanDate"));
            SendClientMessage(playerid, COLOR_WHITE,msg2);
            format(msg2,sizeof(msg2),"Banned for %s",dini_Get(bancheck,"BanReason"));
            SendClientMessage(playerid, COLOR_WHITE,msg2);
            format(msg2,sizeof(msg2),"Name of the account Banned on the ip %s: %s",playersip, dini_Get(bancheck,"BanName"));
            SendClientMessage(playerid, COLOR_WHITE,msg2);

            format(msg2,sizeof(msg2),"[ADMIN]: %s (%d) was kicked by Smithy for ban evading",plname,playerid);
            SendAdminMessage(COLOR_RED,msg2);

            format(msg2,sizeof(msg2),"(%d/%d/%d) [%d:%d:%d] %s Has been kicked by the anticheat for Possible Ban Evading",d,m,y,h,mi,s,plname);
            KickLog(msg2);

            format(msg2,sizeof(msg2),"Users/%s.ini",plname);
            if(dini_Exists(msg2))
            {
                dini_IntSet(msg2,"Banned",1);
            }

            OnPlayerUpdateEx(playerid);
            SetTimerEx("KickPlayerOut",500,false,"i",playerid);
            return 1;
        }
    }

    format(bancheck, sizeof(bancheck),"Users/Bans/%s.ban",playersip);// Add tab in this line to align with the next line
    if(dini_Exists(bancheck))
    {
        if(dini_Int(bancheck,"Banned") == 1)
        {
            ClearChatbox(playerid, 10);

            SendClientMessage(playerid, COLOR_LIGHTRED,"This nickname is banned from this server.");
            SendClientMessage(playerid, COLOR_LIGHTRED,"If you wish to be unbanned please visit our website at www.uk-rp.co.uk");
            SendClientMessage(playerid, COLOR_LIGHTRED,"Ban evading will result in a permanent range ban.");
            format(msg2,sizeof(msg2),"AdmCmd: %s(%d) was kicked for ban evading.",plname,playerid);
            SendAdminMessage(COLOR_LIGHTRED,msg2);
            format(msg2,sizeof(msg2),"AdmCmd: IP %s has been added to the ban list by Smithy",playersip);
            SendAdminMessage(COLOR_WHITE,msg2);

            format(msg2,sizeof(msg2),"(%d/%d/%d) [%d:%d:%d] %s Has been kicked by the anticheat for Possible Ban Evading",d,m,y,h,mi,s,plname);
            KickLog(msg2);
            SetTimerEx("ScriptBan",500,false,"iis",playerid,999,"Ban Evading");
            return 0;
        }
   }
Reply
#2

i've been trying to fix it for hours, still it does not work!
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)