BanIP and UnbanIP not working |rep+
#1

Hello.

I have cmd /banip and /unbanip.

But when type some IP ( /banip and IP) in samp.ban dont have ip.

when someone banned, and im type /unbanip IP , ip is not unbanned :S

here is command:

Код:
CMD:banip(playerid, params[])
{
    new ip[32];
    if(IsLogged[playerid] == false) return SendClientMessage(playerid, COLOR_RED, "[SERVER]: "COL_WHITE"Moras biti ulogiran kako bi mogao koristiti komande!");
    if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, COLOR_RED, "[GRESKA]: "COL_WHITE"Nemas prava za koristenje ove komande.");
	if(gaDuty[playerid] == false) return SendClientMessage(playerid, COLOR_RED, "[GRESKA]: "COL_WHITE"Nisi na Admin duznosti.");
    if(sscanf(params, "s[32]", ip)) return SendClientMessage(playerid, COLOR_CYAN, "[KORISTI]: "COL_WHITE"/banip [ip]");
	else
	{
        new string[20];
        format(string,sizeof(string),"banip %s",ip);
        SendRconCommand(string);
        SendRconCommand("reloadbans");

        new string2[124];
        format(string2, sizeof(string2), "[ADMIN]: "COL_GREY"Admin %s je banao IP: %s", GetName(playerid), ip);
        SendMessageToStaff(COLOR_PURPLE, string2);

		format(string2, sizeof(string2),"[SERVER]: "COL_WHITE"Banao si IP adresu: %s", ip);
		SendClientMessage(playerid, COLOR_ORANGE,string2);
	}
    return 1;
}

CMD:unbanip(playerid, params[])
{
    new ip[32];
    if(IsLogged[playerid] == false) return SendClientMessage(playerid, COLOR_RED, "[SERVER]: "COL_WHITE"Moras biti ulogiran kako bi mogao koristiti komande!");
    if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, COLOR_RED, "[GRESKA]: "COL_WHITE"Nemas prava za koristenje ove komande.");
	if(gaDuty[playerid] == false) return SendClientMessage(playerid, COLOR_RED, "[GRESKA]: "COL_WHITE"Nisi na Admin duznosti.");
    if(sscanf(params, "s[32]", ip)) return SendClientMessage(playerid, COLOR_CYAN, "[KORISTI]: "COL_WHITE"/unbanip [ip]");
	else
	{
        new string[20];
        format(string,sizeof(string),"unbanip %s",ip);
        SendRconCommand(string);
        SendRconCommand("reloadbans");

        new string2[124];
        format(string2, sizeof(string2), "[ADMIN]: "COL_GREY"Admin %s je unbanao IP: %s", GetName(playerid), ip);
        SendMessageToStaff(COLOR_PURPLE, string2);

		format(string2, sizeof(string2),"[SERVER]: "COL_WHITE"Unbanao si IP adresu: %s", ip);
		SendClientMessage(playerid, COLOR_ORANGE,string2);
	}
    return 1;
}
Reply
#2

Any Error While Compiling ?
Reply
#3

Try those,
Quote:
Originally Posted by FreshDoubleX
Посмотреть сообщение
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;
}
Quote:
Originally Posted by Aprezt
Посмотреть сообщение
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;
}
Reply
#4

no warnings / no errors
Reply
#5

have you tried the above code given by maro06 ?
Reply
#6

thanks all rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)