Counter-Strike 1.6
CS1.BG | DUST2 NOSHTA GARMI [RANKED PLAY] #1
45.144.155.113:27015
de_dust2
Играчи: 30/32
de_dust2
Counter-Strike 1.6
Cs-PlovdiV.com - Aim Attack 93.123.16.4:27022 aim_aztec Играчи: 0/16

Chat Filder Remvove file .ini

В този раздел можете да подавате всякакви заявки за намиране, изработка или преработка на плъгини/модове.
Аватар
lantimilan
Извън линия
Foreigner
Foreigner
Мнения: 424
Регистриран на: 29 Ное 2017, 22:49
Се отблагодари: 31 пъти
Получена благодарност: 3 пъти

Chat Filder Remvove file .ini

Мнение от lantimilan » 07 Апр 2020, 10:14

Hello i find one plugin Anti Abuse Filter when somebody said bad word to set **** but this plugin have to file .ini badword and white list i dont like i want to set words direct in plugin some word and in plugin have some symbol i dont know what is it can you check

Код за потвърждение: Избери целия код

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Chat Filter"
#define VERSION "1.2"
#define AUTHOR "RateX"

#define MAX_BL		500	// Increase this number to increase max blacklisted words
#define MAX_WL		500 	// Increase this number to increase max whitelisted words

new g_blacknum, g_whitenum, BAD_WORDS[MAX_BL][64], GOOD_WORDS[MAX_WL][64]
new white[128][128], said[512], pos, bad[64], len, good[64], wnum, wlen[128], block

public plugin_init() 
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
    
	register_clcmd("say ", "ChatGlobalCommand", ADMIN_IMMUNITY, "Filter Global Chat")
	register_clcmd("say_team ", "ChatTeamCommand", ADMIN_IMMUNITY, "Filter Team Chat")
}

public plugin_precache()
{
	new configsdir[64], path[132]
	get_configsdir(configsdir, charsmax(configsdir))
	
	// Load blacklisted words
	formatex(path, charsmax(path), "%s/blacklistwords.ini", configsdir)	
	new file = fopen(path, "rt")
	if(!file)
	{
		server_print("Could not find the blacklistwords.ini file!")
		return PLUGIN_HANDLED
	}
	new linedata[512]
	
	while(!feof(file))
	{
		// Read one line at a time
		fgets(file, linedata, charsmax(linedata))

		// Replace newlines with a null character to prevent headaches
		replace(linedata, charsmax(linedata), "^n", "")
			
		// Blank line or comment
		if (!linedata[0] || linedata[0] == ';') 
			continue
			
		parse(linedata, BAD_WORDS[g_blacknum], 63)
		g_blacknum++
	}
	fclose(file)
	// Load whitelisted words
	formatex(path, charsmax(path), "%s/whitelistwords.ini", configsdir)	
	file = fopen(path, "rt")
	if(!file)
	{
		server_print("Could not find the whitelistwords.ini file!")
		return PLUGIN_HANDLED
	}
	
	while(!feof(file))
	{
		// Read one line at a time
		fgets(file, linedata, charsmax(linedata))

		// Replace newlines with a null character to prevent headaches
		replace(linedata, charsmax(linedata), "^n", "")
			
		// Blank line or comment
		if (!linedata[0] || linedata[0] == ';') 
			continue
			
		parse(linedata, GOOD_WORDS[g_whitenum], 63)
		g_whitenum++
	}
	fclose(file)
	return PLUGIN_CONTINUE
}

public ChatGlobalCommand(id, level, cid)
{
	if(cmd_access(id, level, cid, 1))
		return PLUGIN_CONTINUE

	read_args(said, charsmax(said))
	block = 0
	wnum = 0
	
	// Check for whitelisted words(case ignored) and hide them
	for(new j = 0; j < g_whitenum; j++)
	{
		while((pos = containi(said, GOOD_WORDS[j])) != -1)
		{
			wnum++
			wlen[wnum] = strlen(GOOD_WORDS[j])
			copy(white[wnum], wlen[wnum], said[pos])
			formatex(good, wlen[wnum], "%s", "äëïöüÇÑáéíóúÁÉÍÓÚñçÄËÏÖÜÜÜÜÜÜÜÜÜ")
			replace(said, charsmax(said), white[wnum], good)	
		}	
	}
	// Check for blacklisted words(case ignored) and replace them
	for(new i = 0; i < g_blacknum; i++)
	{
		while((pos = containi(said, BAD_WORDS[i])) != -1)
		{
			len = strlen(BAD_WORDS[i])
			copy(bad, len, said[pos])
			formatex(good, len, "%s", "********************************************")
			replace_all(said, charsmax(said), bad, good)   
			if(!block)
				block = 1
		}
	}
	
	if(block)
	{
		// Restore the whitelisted words
		while(wnum)
		{
			pos = containi(said, "äëï")
			copy(good, wlen[wnum], white[wnum])
			formatex(bad, wlen[wnum], "%s", "äëïöüÇÑáéíóúÁÉÍÓÚñçÄËÏÖÜÜÜÜÜÜÜÜÜ")
			replace(said, charsmax(said), bad, good)
			wnum--
		}
		client_cmd(id, "say %s", said)
		return PLUGIN_HANDLED
	}
	return PLUGIN_CONTINUE
}

public ChatTeamCommand(id, level, cid)
{
	if(cmd_access(id, level, cid, 1))
		return PLUGIN_CONTINUE
		
	read_args(said, charsmax(said))
	block = 0
	wnum = 0
	
	// Check for whitelisted words(case ignored) and hide them
	for(new j = 0; j < g_whitenum; j++)
	{
		while((pos = containi(said, GOOD_WORDS[j])) != -1)
		{
			wnum++
			wlen[wnum] = strlen(GOOD_WORDS[j])
			copy(white[wnum], wlen[wnum], said[pos])
			formatex(good, wlen[wnum], "%s", "äëïöüÇÑáéíóúÁÉÍÓÚñçÄËÏÖÜ")
			replace(said, charsmax(said), white[wnum], good)	
		}	
	}
	// Check for blacklisted words(case ignored) and replace them
	for(new i = 0; i < g_blacknum; i++)
	{
		while((pos = containi(said, BAD_WORDS[i])) != -1)
		{
			len = strlen(BAD_WORDS[i])
			copy(bad, len, said[pos])
			formatex(good, len, "%s", "********************************************")
			replace_all(said, charsmax(said), bad, good)   
			if(!block)
				block = 1
		}
	}
	
	if(block)
	{
		// Restore the whitelisted words
		while(wnum)
		{
			pos = containi(said, "äëï")
			copy(good, wlen[wnum], white[wnum])
			format(bad, wlen[wnum], "%s", "äëïöüÇÑáéíóúÁÉÍÓÚñçÄËÏÖÜ")
			replace(said, charsmax(said), bad, good)
			wnum--
		}
		client_cmd(id, "say_team %s", said)
		return PLUGIN_HANDLED
	}
	return PLUGIN_CONTINUE
}

  • Подобни теми
    Отговори
    Преглеждания
     Последно мнение

Обратно към “Заявки за плъгини”

Кой е на линия

Потребители разглеждащи този форум: Bing [Bot] и 6 госта