16.02.2013, 11:42
WHen I ban IP myself and trying to reconnect it still works..
CMD:banip(playerid, params[]) { if(!CheckAdmin(playerid, 1)) return NotAuthMSG(playerid); new ip[128],pIP[128],string[128]; if(sscanf(params,"s[128]",ip)) return SyntaxMSG(playerid, "/banip [IP]"); format(string, sizeof(string),"banip %s", ip); SendRconCommand(string); SendRconCommand("reloadbans"); format(string, sizeof(string), "AdmCmd: %s has just IP banned, %s.", GetName(playerid), ip); AMSG(COLOR_LIGHTRED, string); foreach(Player, i) { GetPlayerIp(playerid, pIP, sizeof(pIP)); if(!strcmp(ip, pIP, true)) { format(string, sizeof(string), "[SERVER]: Your IP %s, has been banned from the server.", pIP); KickEx(playerid, string); } } return 1; }
CMD:banip(playerid, params[]) {
if(!CheckAdmin(playerid, 1)) return NotAuthMSG(playerid);
new ip[20], pIP[20], str[128];
if(sscanf(params, "s[20]", ip)) return SyntaxMSG(playerid, "/banip [IP]");
foreach(Player, i) {
GetPlayerIp(i, pIP, sizeof(pIP));
if(!strcmp(ip, pIP, true)) SendClientMessage(i, -1, "[SERVER]: Your IP address has been banned from the server.");
}
format(str, sizeof str, "banip %s", pIP);
SendRconCommand(str);
SendRconCommand("reloadbans");
return 1;
}
pawn Код:
|
format(string, sizeof(string),"banip %s", ip);
format(string, sizeof(string),"banip %d", ip);
Replace
pawn Код:
pawn Код:
|
Replace
pawn Код:
pawn Код:
|