nie wiem na ile dostaje. okazało się, że to nie dontsayips.
amxx banuje tylko drugi plugin : No_advertisement.
amxx . Tylko czemu plugin, ktory powinien banowac tylko za wpisanie strony www banuje tez za wpisanie IP?
Z dontsayips.
amxx sobie poradziłem, skasowałem ten drugi plugin i juz działa. Teraz panowie bym prosił o sprawdzenie, co jest nie tak z tym drugim pluginem
Ps. ta wersja co zapodał "xyz?" w ogole nie dziala
wpisuje IP i nic nie robi
podaje kod pliku .sma No_advertisement.
amxx #include <amxmodx>
#include <amxmisc>
#define PLUGIN "Restrict Advertising"
#define VERSION "1.0"
#define AUTHOR "Alka & Sn!ff3r"
stock const advertising_words[][] = {
"www.",
".pl",
".com",
".net",
".org",
".no-ip",
".ru"
}
new const reason[] = "Reklamowanie!";
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR);
register_clcmd("say", "hook_chat");
register_clcmd("say_team", "hook_chat");
register_cvar("amx_adspunish_mode","1")
register_cvar("amx_adsban_time","5")
}
public hook_chat(id)
{
new szArgs[512];
read_args(szArgs, 511);
new len;
len = strlen(szArgs);
new digits, periods;
new szName[32];
get_user_name(id, szName, 31);
for(new i = 0 ; i < sizeof (advertising_words) ; i++)
{
if(containi(szArgs, advertising_words[i]) != -1)
{
server_cmd("amx_kick ^"%s^" %s", szName, reason);
return 1;
}
}
//pobrano z cs-puchatek.pl
for(new i; i < len; i++)
{
if(isdigit(szArgs[i]))
{
digits++
}
else if(szArgs[i] == '.' || szArgs[i] == ':')
{
periods++
}
}
if(digits > 3 && periods > 2)
{
new punish = get_cvar_num("amx_adspunish_mode")
if(punish == 1)
{
static Ip[32]
get_user_ip(id, Ip, 31, 1)
server_cmd("addip %d ^"%s^";wait;wait;writeip", get_cvar_num("amx_adsban_time"), Ip);
}
else if(punish ==2)
server_cmd("amx_kick ^"%s^" %s", szName, reason);
return 1;
}
return 0;
}
Użytkownik chudy_smoker edytował ten post 22.03.2011 14:58