04.01.2012, 10:41
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.
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;
}
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;
}