Existing user? Sign in
Sign up
Games
Servers
Useful
User
Pass
2FA
Plugin Anti-Flood
Freakz Forum Index
->
Trash Bin
->
CS 2006-2019 (Archived)
->
Resources
Author
Message
1759
MultIdReeat
[Mentally Stable]
Status: Offline
(since 30-07-2013 19:16)
Joined: 27 Dec 2012
Posts: 26
,
Topics: 9
Location:
Romania
Reputation:
34.7
Votes
: 2
Posted: 27-07-2013, 21:17:59
| Translate post to:
... (
Click for more languages
)
Autor: Un scripter
Versiune: Nush prima
Descriere: Un sma anti flood
Link download:
http://www.girlshare.ro/32627783.1
Instalare: Il bagati in Cstrike/addons/amxmodx/scripting
Module necesare: Nu trebuie module neaparat
Imagini: Nu am facut nu sunt necesare
Sma:
Cod:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <hamsandwich>
#define MAX_PLAYERS 32
#if cellbits == 32
const OFFSET_TEAM = 114
#else
const OFFSET_TEAM = 139
#endif
const OFFSET_LINUX = 5
enum
{
CS_TEAM_UNASSIGNED = 0,
CS_TEAM_T,
CS_TEAM_CT,
CS_TEAM_SPECTATOR
}
new bool:user_can_use_radio[MAX_PLAYERS], g_conectat[MAX_PLAYERS];
new bool:can_say[MAX_PLAYERS];
new cvar_active, cvar_anti_flood_cfg, cvar_anti_radio_spam, cvar_anti_hlds_fake, cvar_anti_hlds_spam, cvar_anti_hlds_crash;
new cvar_anti_spec_bug, cvar_default_binds, cvar_delete_customhpk;
new blocked_commands[][] =
{
"cl_setautobuy",
"cl_autobuy",
"cl_setrebuy",
"cl_rebuy",
"autobuy",
"fullupdate"
}
new flood_commands[][] =
{
"gX4takingfire",
"gX4getout",
"gX4regroup"
}
new radio_commands[][] =
{
"radio1",
"radio2",
"radio3",
"takingfire",
"fallback",
"report",
"reportingin",
"sticktog",
"getinpos",
"holdpos",
"inposition"
}
public plugin_init()
{
register_plugin("Server Protection", "2.2", "cyby")
cvar_active = register_cvar("sp_activ","1")
cvar_anti_flood_cfg = register_cvar("sp_anti_flood_cfg","1")
cvar_anti_radio_spam = register_cvar("sp_anti_radio_spam","1")
cvar_anti_hlds_fake = register_cvar("sp_anti_hlds_flood","1")
cvar_anti_hlds_spam = register_cvar("sp_anti_hlds_spam","1")
cvar_anti_hlds_crash = register_cvar("sp_anti_hlds_crash","1")
cvar_delete_customhpk = register_cvar("sp_delete_customhpk","1")
cvar_anti_spec_bug = register_cvar("sp_anti_spec_bug","1")
cvar_default_binds = register_cvar("sp_default_binds","1")
RegisterHam(Ham_Spawn, "player", "spawn_player", 1)
register_clcmd("say","check_say")
new i;
for(i = 0; i < sizeof blocked_commands; i++)
{
if(get_pcvar_num(cvar_anti_hlds_crash) == 1)
{
register_clcmd(blocked_commands[i], "block_command")
}
}
for(i = 0; i < sizeof flood_commands; i++)
{
if(get_pcvar_num(cvar_anti_flood_cfg) == 1)
{
register_clcmd(flood_commands[i], "kick_player")
}
}
for(i = 0; i < sizeof radio_commands; i++)
{
if(get_pcvar_num(cvar_anti_radio_spam) == 1)
{
register_clcmd(radio_commands[i], "no_flood_radio")
}
}
}
public plugin_cfg()
{
new cfgdir[32]
get_configsdir(cfgdir, charsmax(cfgdir))
server_cmd("exec %s/server_protection.cfg", cfgdir)
}
public client_connect(id)
{
if(get_pcvar_num(cvar_active) == 1)
{
if(get_pcvar_num(cvar_anti_hlds_fake) == 1)
{
if(g_conectat[id] == 4)
{
new ip[32]
get_user_ip(id, ip, 31, 1)
server_cmd("addip 120.0 ^"%s^";wait;writeip", ip)
log_to_file("server_protection.log", "[Server Protection] IP-ul: %s a fost detectat ca floodeaza serverul cu HLDS Fake Bots.", ip)
color_chat(0, ".e[Server Protection].g IP-ul.e %s.g a fost detectat ca facand flood.", ip)
}
g_conectat[id] += 1
}
if(get_pcvar_num(cvar_anti_radio_spam) == 1)
{
user_can_use_radio[id] = true
}
if(get_pcvar_num(cvar_default_binds) == 1)
{
client_cmd(id, "bind m chooseteam")
client_cmd(id, "bind n nightvision")
client_cmd(id, "bind z radio1")
client_cmd(id, "bind x radio2")
client_cmd(id, "bind c radio3")
client_cmd(id, "bind b buy")
client_cmd(id, "bind z radio1")
client_cmd(id, "unbind v")
}
set_task(17.0, "join_message", id)
}
}
public client_putinserver(id)
{
if(get_pcvar_num(cvar_anti_hlds_spam) == 1)
{
can_say[id] = true
}
}
public join_message(id)
{
color_chat(id, ".eAcest server utilizeaza anti-flood plugins")
}
public client_disconnect(id)
{
if(get_pcvar_num(cvar_active) == 1)
{
if(get_pcvar_num(cvar_anti_radio_spam) == 1)
{
user_can_use_radio[id] = false
}
if(get_pcvar_num(cvar_anti_hlds_spam) == 1)
{
can_say[id] = false
}
if(get_pcvar_num(cvar_anti_hlds_fake) == 1)
{
g_conectat[id] = 0
}
}
remove_task(id);
}
public spawn_player(id)
{
if(get_pcvar_num(cvar_active) == 1)
{
if(get_pcvar_num(cvar_anti_spec_bug) == 1)
{
new team = fm_get_user_team(id)
new name[32]
get_user_name(id, name, 31)
if(team == CS_TEAM_SPECTATOR && is_user_alive(id))
{
color_chat(0, ".v[Server Protection].e %s.g a fost prins folosind Spec Bug.", name)
user_kill(id)
fm_set_user_team(id, CS_TEAM_CT, 1)
}
}
}
}
public check_say(id)
{
if(get_pcvar_num(cvar_active) == 1)
{
if(get_pcvar_num(cvar_anti_hlds_spam) == 1)
{
if(can_say[id])
{
return PLUGIN_CONTINUE;
}
else
{
new ip[32]
get_user_ip(id, ip, 31, 1)
server_cmd("addip 120.0 ^"%s^";wait;writeip", ip)
log_to_file("server_protection.log", "[Server Protection] IP-ul: %s a fost detectat cu HLDS Spam bot.", ip)
server_cmd("echo %s a fost prins facand marsavii cu hlds spam bot. L-am banat.", ip)
color_chat(0, ".v[Server Protection].g IP-ul.e %s.g a fost prins cu Hlds Spam Bot.", ip)
return PLUGIN_HANDLED;
}
}
}
return PLUGIN_CONTINUE;
}
public block_command(id)
{
if(get_pcvar_num(cvar_active) == 1)
{
if(is_user_connected(id))
{
return PLUGIN_HANDLED;
}
}
return PLUGIN_CONTINUE;
}
public kick_player(id)
{
if(get_pcvar_num(cvar_active) == 1)
{
if(get_pcvar_num(cvar_anti_flood_cfg) == 1)
{
server_cmd("kick #%d Ai luat kick pentru ca folosesti comenzi aiurea.", get_user_userid(id))
}
}
}
public no_flood_radio(id)
{
if(get_pcvar_num(cvar_active) == 1)
{
if(get_pcvar_num(cvar_anti_radio_spam) == 1)
{
if(user_can_use_radio[id])
{
user_can_use_radio[id] = false
set_task(4.9, "i_want_again", id)
return PLUGIN_CONTINUE;
}
else
{
return PLUGIN_HANDLED;
}
}
}
return PLUGIN_CONTINUE;
}
public i_want_again(id)
{
if(is_user_connected(id))
{
user_can_use_radio[id] = true
}
}
stock fm_get_user_team(id)
{
return get_pdata_int(id, OFFSET_TEAM, OFFSET_LINUX);
}
stock fm_set_user_team(id, {CsTeams,_}:team, update = 1)
{
set_pdata_int(id, OFFSET_TEAM, _:team, OFFSET_LINUX)
set_pev(id, pev_team, _:team);
if(update)
{
static _msg_teaminfo; if(!_msg_teaminfo) _msg_teaminfo = get_user_msgid("TeamInfo");
static teaminfo[][] = { "UNASSIGNED", "TERRORIST", "CT", "SPECTATOR" };
message_begin(MSG_ALL, _msg_teaminfo);
write_byte(id);
write_string(teaminfo[_:team]);
message_end();
}
}
stock color_chat(const id, const input[], any:...)
{
new count = 1, players[32]
static msg[191]
vformat(msg, 190, input, 3)
replace_all(msg, 190, ".v", "^4")
replace_all(msg, 190, ".g", "^1")
replace_all(msg, 190, ".e", "^3")
if (id) players[0] = id; else get_players(players, count, "ch")
{
for (new i = 0; i < count; i++)
{
if (is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
write_byte(players[i]);
write_string(msg);
message_end();
}
}
}
}
// THX TO ALKA
public plugin_end()
{
if(get_pcvar_num(cvar_active) == 1)
{
if(get_pcvar_num(cvar_delete_customhpk) == 1)
{
new szDir[] = "/", DirPointer, szFile[32];
DirPointer = open_dir(szDir, "", 0);
while(next_file(DirPointer, szFile, sizeof szFile - 1))
{
if(szFile[0] == '.')
continue;
if(containi(szFile, "custom.hpk") != -1)
{
delete_file(szFile);
break;
}
}
close_dir(DirPointer);
return 1;
}
}
return PLUGIN_CONTINUE;
}
Asta a fost tot bafta
Stai putin nu e luat de pe net
))) am cumparat un addons de la un scripter si avea si anti flood facut de el
nu e loat de pe net
0
0
Back to top
D4mage
[Gum!Tz@]
Status: Offline
(since 08-06-2015 16:55)
Joined: 06 Apr 2013
Posts: 1324
,
Topics: 32
Location:
Romania
Reputation:
238.5
Votes
: 20
Posted: 29-07-2013, 19:58:45
| Translate post to:
... (
Click for more languages
)
dupa parerea mea multi nu mai folosesc anti-flood de pe net mai bn ei anti-flood krond.org
0
0
Back to top
Freakz Forum Index
->
Trash Bin
->
CS 2006-2019 (Archived)
->
Resources
The time now is 09-08-2025, 04:29:45
Copyright info
Based on phpBB
ro
/
com
B
Login
I forgot my password
World of Warcraft
Login for more...
Download WoW 7.3.5
Misc
eSports
Achievements
Buy reputation with votes
Reputation trades
Forum rules
Ban list
Members list
User guide (FAQ)
World of Warcraft
View details