Wie der titel sagt, würde dies funktionieren?
CMD:ipban(playerid,params[])
{
new banid, reason[24], msg[128], name[24], banname[24], ip[18];
if(!sscanf(params,"us", banid, reason))
{
if(!isPlayerAnAdmin(playerid,5))return SendClientMessage(playerid,COLOR_RED,"You are no admin or your adminlevel is too low.");
if(!IsPlayerConnected(banid)) return SendClientMessage(playerid, COLOR_RED, "ERROR: Invalid ID");
new CheckAdminRank = GetPVarInt(banid,"Adminlevel");
if(GetPVarInt(playerid,"Adminlevel") < CheckAdminRank) return SendClientMessage(playerid,COLOR_RED,"Have some respect! This player has a higher rank then you.");
GetPlayerIp(banid, ip, sizeof(ip));
format(msg,sizeof(msg),"banip %i",ip);
SendRconCommand(msg);
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(banid, banname, sizeof(banname));
format(msg,sizeof(msg),"AdminSystem: %s has been IP-banned by %s [Reason: %s (Appeal: www.xxxxxxx.com.com)]",banname,name,reason);
SendClientMessageToAll(COLOR_RED,msg);
Kick(banid);
}
else
{
SendClientMessage(playerid, COLOR_CMD, "CORRECT USAGE: /ipban <id> <reason>");
}
return 1;
}
Der spieler soll per IP gebannt werden (über rcon).