15.03.2016, 11:26
Is there anyway to make a banip command instead of having to use rcon?
Cheers
Cheers
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;
}
CMD:banip(playerid,params[]) {
if(!IsPlayerAdmin(playerid)) return 0;
if(isnull(params)) return SendClientMessage(playerid,-1,"SERVER: Usage: /banip [ip]");
new string[128];
format(string,sizeof string,"banip %s",params);
SendRconCommand(string);
SendRconCommand("reloadbans");
format(string,sizeof string,"SERVER: Ip successfully banned");
return SendClientMessage(playerid,-1,string);
return 1;
}
PHP код:
|
yes, by using https://sampwiki.blast.hk/wiki/SendRconCommand
PHP код:
very nice copy paste ;_; |