Skocz do zawartości

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie

Anty reklama (Nick/Say)


  • Nie możesz napisać tematu
  • Zaloguj się, aby dodać odpowiedź
Brak odpowiedzi do tego tematu

#1 skunew

    Profesjonalista

  • Użytkownik

Reputacja: 10
Początkujący

  • Postów:186
  • Lokalizacja:Wrocław
Offline

Napisano 08.02.2014 19:33

Witam.

Mam prośbę, może ktoś użyć tej samej funkcji wyszukiwania IP co w pluginie do antyreklamy w SAY w antyreklamie NICK. Chodzi mi o to, że w pluginie do anty nick blokuje tylko wpisane liczby, a czesto jest tak, że ktoś spamuje ip bez cyfr ktore sa podane w tym pluginie i antyreklama nie działa. Lub połączyć te dwa pluginy. 

Miałem plugin anticomerce ale bardzo serwer mi obciążał :/

AntyReklama NICK

/* Plugin generated by AMXX-Studio */

#include <amxmodx>

#define PLUGIN "Zakaz reklamy w nicku"
#define VERSION "1.0.1"
#define AUTHOR "Mochi, edycja by Nesk"

new cvar,zezwolone[32],kara
new const reklama[][] =
{
	

	".ru" ,
	".waw",
	".waw.",
	".biz",
	".eu",
	".info",
	".co",
	".cn",
	".de",
	"89.",
	"91.",
	"83.",
	"193.",
	"212.",
	"194.",
	"195.",
	"216.",
	"79.",
	"80.",
	"91.",
	"213.",
	"77.",
	"79.",
	"178.",
	"188.",
	"94.",
	"153.",
	":27000",
	":27001",
	":27002",
	":27003",
	":27004",
	":27005",
	":27006",
	":27007",
	":27008",
	":27009",
	":27010",
	":27011",
	":27012",
	":27013",
	":27014",
	":27015",
	":27016",
	":27017",
	":27018",
	":27019",
	":27020",
	":14000",
	":27026",
	":27025",
	":27077",
	":27033",
	":27164",
	":27070",
	":27022",
	":27041",
	":27222",
	":27122",
	":27030",
	":27276",
	":27365",
	":27196",
	":27606",
	":29023",
	":27053",
	":27068",
	":27066",
	":27088",
	":27146",
	":27039",
	"27094",
	"193.",
	"91.",
	"27216",
	"27021",
	"27729",
	"weed-cs.pl",
	"hardplay.pl",
	"cspukawka.eu",
	"xaa.pl",
	"CSBydgoszcz.PL",
	"dream.pl",
	"Deagle.pl"
}

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
	cvar = register_cvar("amx_reklama_www","CsClub.pl")
	kara = register_cvar("amx_reklama_sp","1")
	
}

public client_putinserver(id)
{
	
	new name[32]
	get_user_name(id,name,31);
	get_pcvar_string(cvar,zezwolone,31)
	if(containi(name,zezwolone) != -1)
	{
		return PLUGIN_HANDLED
	}
	for(new i = 0; i < sizeof(reklama); i++) 
	{ 		
		if(containi(name, reklama[i]) != -1) 
		{
			if(kara == 1)
			{
				server_cmd("kick #%d Reklama! Zmien nick!",get_user_userid(id))
			}
			else
			{
				set_user_info(id,"name","CsClub.pl")
			}
		}
	}
	return PLUGIN_CONTINUE
}
public client_infochanged(id)
{
	new name[32]
	get_user_info(id, "name", name,31)
	get_pcvar_string(cvar,zezwolone,31)
	if(containi(name,zezwolone) != -1)
	{
		return PLUGIN_HANDLED
	}
	for(new i = 0; i < sizeof(reklama); i++) 
	{ 
		if(containi(name, reklama[i]) != -1) 
		{
			if(kara == 1)
			{
				server_cmd("kick #%d Reklama! Zmien nick!",get_user_userid(id))
			}
			else
			{
				set_user_info(id,"name","CsClub.pl")
			}
		}
	}
	return PLUGIN_CONTINUE
}
 

AntyReklama SAY

#define PLUGINNAME	"Don't say IPs"
#define VERSION		"0.1"
#define AUTHOR		"JGHG"
/*
Copyleft 2005
Plugin topic: http://www.amxmodx.org/forums/viewtopic.php?p=90172


Don't say IPs
=============
Messages like "hey join my server 213.34.231.23" are automatically blocked... and another message is printed instead. :-P
Or, you can choose to just ban violators by setting cvar ip_banviolators to 1 and ip_banminutes to how many minutes the violator should be banned. 0 is permanent, 5 is default.

/JGHG


VERSIONS
========
050204	0.1	First version


CREDITS
=======
Requested by lord_inuyasha88.
*/

#include <amxmodx>
#include <regex>

#define PATTERN				"(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)" // \b
#define REASON				"IP advertising"
#define CVAR_BANMINUTES		"ip_banminutes"
#define CVAR_BANVIOLATORS	"ip_banviolators"

// Globals below
new Regex:g_result
new g_returnvalue
new g_error[64]
new g_allArgs[1024]
// Globals above

public plugin_modules() {
	require_module("regex")
}

public hook_say(id, level, cid) {
	read_args(g_allArgs, 1023)
	g_result = regex_match(g_allArgs, PATTERN, g_returnvalue, g_error, 63)
	switch (g_result) {
		case REGEX_MATCH_FAIL: {
			log_amx("REGEX_MATCH_FAIL! %s", g_error)
			return PLUGIN_CONTINUE
		}
		case REGEX_PATTERN_FAIL: {
			log_amx("REGEX_PATTERN_FAIL! %s", g_error)
			return PLUGIN_CONTINUE
		}
		case REGEX_NO_MATCH: {
			return PLUGIN_CONTINUE
		}
		default: {
			if (get_cvar_num(CVAR_BANVIOLATORS)) {
				new userid = get_user_userid(id)
				new minutesString[10]
				get_cvar_string(CVAR_BANMINUTES, minutesString, 9)
				new temp[64], banned[16], minutes = get_cvar_num(CVAR_BANMINUTES)
	
				if (minutes)
					format(temp, 63, "%L", id, "FOR_MIN", minutesString)
				else
					format(temp, 63, "%L", id, "PERM")
				
				format(banned, 15, "%L", id, "BANNED")
	
				new authid[32]
				get_user_authid(id, authid, 31)
	
				new name[32]
				get_user_name(id, name, 31)
				log_amx("%s (%s), %s %s because of advertising an IP address. This was written: ^"%s^"", name, authid, banned, temp, g_allArgs)
	
				server_cmd("kick #%d ^"%s (%s %s)^";wait;banid ^"%d^" ^"%s^";wait;writeid", userid, REASON, banned, temp, minutes, authid)				
			}
			else {
				client_cmd(id, "say ^"CsClub.pl - Zapraszamy do rejestracji^"")
			}
			regex_free(g_result)
			return PLUGIN_HANDLED // block msg
		}
	}
	
	return PLUGIN_CONTINUE
}



public plugin_init() {
	register_plugin(PLUGINNAME, VERSION, AUTHOR)
	
	register_clcmd("say", "hook_say")
	register_cvar(CVAR_BANVIOLATORS, "0")
	register_cvar(CVAR_BANMINUTES, "30")
	
	register_dictionary("admincmd.txt")
}

  • +
  • -
  • 0

Pomogłem? Kliknij: rep_up.png

 

b_350_20_690849_260738_FFFFFF_000000.png





Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych