28.09.2010, 12:29
** this is not made by me. I found it somewhere on the forums :P
pawn Код:
stock RangeBan(playerid)
{
if(!IsPlayerConnected(playerid)) return 0;
new total[16],ip[16], string[24];
GetPlayerIp(playerid, ip, sizeof(ip));
new cnt;
for(new i=0;i<strlen(ip);i++)
{
if(ip[i] == '.') cnt++;
if(cnt == 2)
{
i++;
strdel(ip, i, strlen(ip));
format(total,sizeof(total),"%s*.*",ip);
}
}
format(string, sizeof(string),"banip %s",total);
SendRconCommand(string);
return 1;
}