Banning an IP script
#4

AddBan

Код:
AddBan(ip[])
{
	if (CheckBan(ip) == 0)
	{
		new File: file = fopen("ban.cfg", io_append);
		new string[20];
		format(string, sizeof(string), "%s", ip);
	 	fwrite(file, string);
	 	fclose(file);
	 	foreach(Player, playerid)
		{
		    new playerIP[16];
			GetPlayerIp(playerid, playerIP, sizeof(playerIP));
			if (strcmp(playerIP, ip) == 0)
			{
	            SendClientMessage(playerid, COLOR_WHITE, "SERVER: You are banned from this server.");
				SetTimerEx("KickPlayer",500,false,"i",playerid);
			}
		}
		return 1;
	}
	return 0;
}
Oh, thank you
Reply


Messages In This Thread
Banning an IP script - by Josh_Main - 09.06.2013, 12:57
Re: Banning an IP script - by Aly - 09.06.2013, 13:00
Re: Banning an IP script - by Vince - 09.06.2013, 13:00
Re: Banning an IP script - by Josh_Main - 09.06.2013, 13:12
Re: Banning an IP script - by Josh_Main - 09.06.2013, 13:37

Forum Jump:


Users browsing this thread: 2 Guest(s)