SA-MP Forums Archive
BanIP and UnBanIP Command - 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: BanIP and UnBanIP Command (/showthread.php?tid=308617)



BanIP and UnBanIP Command - TV94 - 04.01.2012

Can someone give me a script with /banip and /unbanip please? On my server i have just /ban which ban player's name but not IP. Thank you.


Re: BanIP and UnBanIP Command - TV94 - 05.01.2012

Someone ?


Re: BanIP and UnBanIP Command - FreshDoubleX - 05.01.2012

pawn Код:
CMD:banip(playerid, params[])
{
    new
        type[ 128 ],
        string[ 128 ]
    ;
    if(sscanf(params, "s[128]", type)) SendClientMessage(playerid, -1, "Usage: /banip [IP]");
    else
    {
        format(string, sizeof(string),"banip %s", type);
        SendRconCommand(string);
        SendRconCommand("reloadbans");
    }
    return true;
}



Re: BanIP and UnBanIP Command - Aprezt - 05.01.2012

Here you are...
pawn Код:
CMD:unbanip(playerid, params[])
{
    new type[128],string[128];
    if(sscanf(params, "s[128]", type)) SendClientMessage(playerid, -1, "USAGE: /unbanip [Players IP]");
    else
    {
        if(PlayerInfo[playerid][pPlayerLogged] == 0) return SendClientMessage(playerid, -1, "* You are not logged in!");
       
        if(PlayerInfo[playerid][pAdminLevel] >= 1)
        {
            format(string, sizeof(string),"unbanip %s", type);
            SendRconCommand(string);
            SendRconCommand("reloadbans");
                   format(string, sizeof(string), "AdmWarning: %s has unbanned IP %s", Name( playerid ), type);
            SendAdminMessage(-1,string);
        }
        else
        {
            return SendClientMessage(playerid, -1 ,"You dont have access!");
        }
    }
    return true;
}



Re: BanIP and UnBanIP Command - James Coral - 05.01.2012

Looooool Go in Rcon and use /rcon banip and /rcon unbanip

EDIT: these commands taken in /rcon cmdlist


Re: BanIP and UnBanIP Command - Boooth - 05.01.2012

Aprezt, seems you guys need to learn how the script works, you can just copy and paste a code into your gamemode from other gamemodes and expect them to work.


Re: BanIP and UnBanIP Command - TV94 - 05.01.2012

Please give me a Strcmd one or Dcmd one. I'm not using Zcmd. Thanks