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

Zmiana koloru w dont say ip


  • Nie możesz napisać tematu
  • Zaloguj się, aby dodać odpowiedź
2 odpowiedzi w tym temacie

#1 diego1060

    Życzliwy

  • Użytkownik

Reputacja: 0
Nowy

  • Postów:24
  • Imię:Adrian
  • Lokalizacja:Kalisz
Offline

Napisano 22.12.2011 15:38

Witam chcialem dodać do pluginu kolor zielony gdy ktoś poda ip wyświetla sie *** xxxxxx.pl Zapraszamy *** chciałbym ten napis zrobić na zielono oto sma.


#define PLUGINNAME "Don't say IPs"
#define VERSION "0.1"
#define AUTHOR "JGHG"
/*
Copyleft 2005
Plugin topic: http://www.amxmodx.o...pic.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 ^"*** xxxx.pl Zapraszamy***^"")
}
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

#2 Klakier

    Volenti non fit iniuria

  • Power User

Reputacja: 391
Wszechpomocny

  • Postów:878
  • GG:
  • Imię:Sebastian
  • Lokalizacja:Mogilno
Offline

Napisano 27.12.2011 00:26

teraz luknij:


#define PLUGINNAME "Don't say IPs"
#define VERSION "0.1"
#define AUTHOR "JGHG"
/*
Copyleft 2005
Plugin topic: http://www.amxmodx.o...pic.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>
#include <colorchat>
#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 {

ColorChat(id,GREEN,"say ^"*** xxxx.pl Zapraszamy***^"");
}
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")
}

  • +
  • -
  • 1

Sell - System Klanów (wojny, top15 etc)

 

Kontakt GG: 7285018


#3 diego1060

    Życzliwy

  • Autor tematu
  • Użytkownik

Reputacja: 0
Nowy

  • Postów:24
  • Imię:Adrian
  • Lokalizacja:Kalisz
Offline

Napisano 28.12.2011 12:21

Ok dzięki za wysiłek masz + dla cb.
  • +
  • -
  • 0




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

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