Ban won't work?
#7

Quote:
Originally Posted by SiRbEaSt
Посмотреть сообщение
Try this(easy to edit):
pawn Код:
CMD:ban(playerid, params[])
{
    if(PlayerInfo[playerid][pAdminDuty] == 0) return SendClientMessage(playerid, -1, "You must be on Admin Duty to use this Command!");
    if (PlayerInfo[playerid][pAdmin] >= 2)
    {
        new string[128], giveplayerid, reason[64];
        if(sscanf(params, "us[64]", giveplayerid, reason)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /ban [playerid] [reason]");

        if(IsPlayerConnected(giveplayerid))
        {
            if(PlayerInfo[giveplayerid][pAdmin] > PlayerInfo[playerid][pAdmin])
            {
                format(string, sizeof(string), "AdmCmd: %s has been auto-banned, reason: Trying to /ban a higher admin.", GetPlayerNameEx(playerid));
                ABroadCast(COLOR_YELLOW,string,2);
                PlayerInfo[playerid][pBanned] = 1;
                new ip[32];
                GetPlayerIp(playerid,ip,sizeof(ip));
                AddBan(ip);
                Kick(playerid);
                return 1;
            }
            else
            {
                new year, month,day;
                getdate(year, month, day);
                new playerip[32];
                GetPlayerIp(giveplayerid, playerip, sizeof(playerip));
                format(string, sizeof(string), "AdmCmd: %s(IP:%s) was banned by %s, reason: %s (%d-%d-%d)", GetPlayerNameEx(giveplayerid), playerip, GetPlayerNameEx(playerid), reason,month,day,year);
                Log("logs/ban.log", string);
                format(string, sizeof(string), "AdmCmd: %s was banned by %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
                SendClientMessageToAllEx(COLOR_LIGHTRED, string);
                PlayerInfo[giveplayerid][pBanned] = 1;
                format(PlayerInfo[giveplayerid][pFlag], 128, "");
                new ip[32];
                GetPlayerIp(giveplayerid,ip,sizeof(ip));
                AddBan(ip);
                Kick(giveplayerid);
                return 1;
            }

        }
    }
    else SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
    return 1;
}
Nice copy and paste from the NG*P gamemode mate.
Reply


Messages In This Thread
Ban won't work? - by jNkk - 23.12.2012, 13:59
Re: Ban won't work? - by SiRbEaSt - 23.12.2012, 14:01
Re: Ban won't work? - by jNkk - 23.12.2012, 14:12
Re: Ban won't work? - by SiRbEaSt - 23.12.2012, 14:14
Re: Ban won't work? - by YoYo123 - 23.12.2012, 14:43
Re: Ban won't work? - by TheSecrets - 23.12.2012, 15:41
Re: Ban won't work? - by ViruZz - 23.12.2012, 16:22
Re: Ban won't work? - by jNkk - 23.12.2012, 18:58
Re: Ban won't work? - by Konstantinos - 23.12.2012, 19:21

Forum Jump:


Users browsing this thread: 1 Guest(s)