OMG, Ban help [Help me] ;( ;(
#3

Quote:
Originally Posted by LocMax
Посмотреть сообщение
Show AddBan stock. I think you're banning IP on each of these commands..
Код:
stock AddBan(ip[])
{
	if(CheckBan(ip) == 0)
	{
		new File: file = fopen("ban.cfg", io_append);
		new string[20];
		format(string, sizeof(string), "\n%s", ip);
	 	fwrite(file, string);
	 	fclose(file);
		return 1;
	}
	return 0;
}
Код:
stock RemoveBan(ip[])
{
    if(CheckBan(ip) == 1)
	{
	    new string[20];
		new File: file = fopen("ban.cfg", io_read);
		fcreate("tempBan.cfg");
		new File: file2 = fopen("tempBan.cfg", io_append);
		while(fread(file, string))
		{
			if(strcmp(ip, string, true, strlen(ip)) != 0 && strcmp("\n", string) != 0)
		    {
				fwrite(file2, string);
			}
		}
		fclose(file);
		fclose(file2);
		file = fopen("ban.cfg", io_write);
		file2 = fopen("tempBan.cfg", io_read);
		while(fread(file2, string))
		{
			fwrite(file, string);
		}
		fclose(file);
		fclose(file2);
		fremove("tempBan.cfg");
		return 1;
    }
	return 0;
}
Reply


Messages In This Thread
OMG, Ban help [Help me] ;( ;( - by ChristianIvann09 - 31.03.2014, 05:17
Re: OMG, Ban help [Help me] ;( ;( - by LocMax - 31.03.2014, 05:25
Re: OMG, Ban help [Help me] ;( ;( - by ChristianIvann09 - 31.03.2014, 05:45
Re: OMG, Ban help [Help me] ;( ;( - by ChristianIvann09 - 31.03.2014, 06:39
Re: OMG, Ban help [Help me] ;( ;( - by NEXT0LIFE0RP - 31.03.2014, 07:22
Re: OMG, Ban help [Help me] ;( ;( - by BroZeus - 31.03.2014, 07:25
Re: OMG, Ban help [Help me] ;( ;( - by ChristianIvann09 - 31.03.2014, 07:53
Re: OMG, Ban help [Help me] ;( ;( - by ChristianIvann09 - 31.03.2014, 09:32

Forum Jump:


Users browsing this thread: 3 Guest(s)