[HELP]Ban System
#1

Right now I am trying to design a ban system in which it will show the reason why the player was banned and all of that. My problem is that now when I check to see if a player is banned it won't show the login dialog. Here's the code...
pawn Код:
public OnPlayerConnect(playerid)
{
    new banfile[64];
    format(banfile, sizeof(banfile),"SArcr/Users/Bans/%s.ban",GetPlayerIp(playerid, PlayerName(playerid), 32));
    if(dini_Exists(banfile))
    {
        if(!strcmp(dini_Get(banfile, "BanName"), PlayerName(playerid), true))
        {
            new banmsg[128];
            SendClientMessage(playerid, COLOR_ADMIN, "This player name has been banned from [Sarcr]");
            format(banmsg, sizeof(banmsg), "Date of Ban: %s", dUser(PlayerName(playerid)).("BanDate"));
            SendClientMessage(playerid, COLOR_ADMIN, banmsg);
            format(banmsg, sizeof(banmsg), "Time of Ban: %s", dUser(PlayerName(playerid)).("BanTime"));
            SendClientMessage(playerid, COLOR_ADMIN, banmsg);
            format(banmsg, sizeof(banmsg), "Banned By: %s", dUser(PlayerName(playerid)).("BannedBy"));
            SendClientMessage(playerid, COLOR_ADMIN, banmsg);
            format(banmsg, sizeof(banmsg), "Banned For: %s", dUser(PlayerName(playerid)).("BanReason"));
            SendClientMessage(playerid, COLOR_ADMIN, banmsg);
            SendClientMessage(playerid, COLOR_ADMIN, "If you feel that this ban is a mistake, please make an appeal at www.sa-rcr.com");
            Kick(playerid);
        }
        else
        {
            new banmsg[128];
            SendClientMessage(playerid, COLOR_ADMIN, "This IP Address has been banned from [Sarcr]");
            format(banmsg, sizeof(banmsg), "Date of Ban: %s", dUser(PlayerName(playerid)).("BanDate"));
            SendClientMessage(playerid, COLOR_ADMIN, banmsg);
            format(banmsg, sizeof(banmsg), "Time of Ban: %s", dUser(PlayerName(playerid)).("BanTime"));
            SendClientMessage(playerid, COLOR_ADMIN, banmsg);
            format(banmsg, sizeof(banmsg), "Banned By: %s", dUser(PlayerName(playerid)).("BannedBy"));
            SendClientMessage(playerid, COLOR_ADMIN, banmsg);
            format(banmsg, sizeof(banmsg), "Banned For: %s", dUser(PlayerName(playerid)).("BanReason"));
            SendClientMessage(playerid, COLOR_ADMIN, banmsg);
            SendClientMessage(playerid, COLOR_ADMIN, "If you feel that this ban is a mistake, please make an appeal at www.sa-rcr.com");
            Kick(playerid);
        }
    }
    format(banfile, sizeof(banfile), USER_FILE_PATH, PlayerName(playerid));
    if(dini_Exists(banfile))
    {
        if(dUserINT(banfile).("Banned") == 1)
        {
            new banmsg[128];
            SendClientMessage(playerid, COLOR_ADMIN, "This player name has been banned from [Sarcr]");
            format(banmsg, sizeof(banmsg), "Date of Ban: %s", dUser(PlayerName(playerid)).("BanDate"));
            SendClientMessage(playerid, COLOR_ADMIN, banmsg);
            format(banmsg, sizeof(banmsg), "Time of Ban: %s", dUser(PlayerName(playerid)).("BanTime"));
            SendClientMessage(playerid, COLOR_ADMIN, banmsg);
            format(banmsg, sizeof(banmsg), "Banned By: %s", dUser(PlayerName(playerid)).("BannedBy"));
            SendClientMessage(playerid, COLOR_ADMIN, banmsg);
            format(banmsg, sizeof(banmsg), "Banned For: %s", dUser(PlayerName(playerid)).("BanReason"));
            SendClientMessage(playerid, COLOR_ADMIN, banmsg);
            SendClientMessage(playerid, COLOR_ADMIN, "If you feel that this ban is a mistake, please make an appeal at www.sa-rcr.com");
            Kick(playerid);
        }
    }
    if(udb_Exists(banfile))
    {
        SendClientMessage(playerid,COLOR_ERROR,"This player name has already been registered. Please login before you spawn.");
        ShowLoginScreen(playerid);
    }
    else
    {
        SendClientMessage(playerid,COLOR_ERROR,"This player name has not been registered. You must register before playing on [Sarcr].");
        ShowRegisterScreen(playerid);
    }
        // other stuff...
        return 1;
}
Reply


Messages In This Thread
[HELP]Ban System - by PCheriyan007 - 14.07.2011, 17:32
Re: [HELP]Ban System - by PCheriyan007 - 17.07.2011, 02:36
Re: [HELP]Ban System - by Lorenc_ - 17.07.2011, 02:41
Re: [HELP]Ban System - by PCheriyan007 - 17.07.2011, 03:22

Forum Jump:


Users browsing this thread: 5 Guest(s)