Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <hamsandwich>
- #define LOG_FILE "addons/amxmodx/logs/fake_detector.log"
- new PLUGIN[][]={
- "Anti Faker",
- "1.0",
- "Seroff"
- };
- new eDeafault[][]={
- "+forward",
- "-forward",
- "+jump",
- "-jump",
- "+duck",
- "-duck",
- "+back",
- "-back",
- "+left",
- "-left",
- "+right",
- "-right",
- "+showscores",
- "-showscores",
- "+attack",
- "-attack",
- "+attack2",
- "-attack2",
- "+moveup",
- "-moveup",
- "+movedown",
- "-movedown",
- "-mlook",
- "+mlook",
- "+moveleft",
- "-moveleft",
- "+moveright",
- "-moveright",
- "+reload",
- "-reload",
- "+klook",
- "-klook",
- "+speed",
- "-speed",
- "-commandmenu",
- "m_pitch",
- "rate",
- "hideconsole",
- "fps_max",
- "cl_updaterate",
- "cl_cmdrate",
- "ex_interp",
- "record"
- }
- new i_logs,i_banreason,i_banmess,i_bantime,is_banned[33],Trie:sBadCommands;
- public plugin_init() {
- register_plugin(PLUGIN[0],PLUGIN[1],PLUGIN[2]);
- register_message(get_user_msgid("TextMsg"), "stTextmsg");
- sBadCommands=TrieCreate();
- i_logs=register_cvar("feke_logs_enabled","1");
- i_banreason=register_cvar("feke_reason","FakePlayer Detected!");
- i_banmess=register_cvar("feke_banmess","amx_ban [time] [userid] [reason]");
- i_bantime=register_cvar("feke_bantime","10080");
- register_srvcmd("gg_bb","ggbb_user");
- register_event("ResetHUD", "UserSpawn", "b");
- for(new i=0;i<sizeof(eDeafault);i++){
- TrieSetCell(sBadCommands, eDeafault[i], 1);
- }
- }
- public ggbb_user(id){
- static sArgv[64];
- static sArgv1[64];
- read_argv(1, sArgv, 63);
- read_argv(2, sArgv1, 63);
- PunishPlayer(str_to_num(sArgv1),sArgv);
- }
- public plugin_end() {
- TrieDestroy(sBadCommands);
- }
- public stTextmsg(msg_id,msg_dest,id){
- static sArgv[64];
- read_argv(0, sArgv, 63);
- remove_quotes(sArgv); trim(sArgv);
- new szArg2[32];
- get_msg_arg_string(2, szArg2, 31);
- if (equal(szArg2, "#Game_unknown_command") ){
- if(is_banned[id])return;
- if(TrieKeyExists(sBadCommands, sArgv)){
- is_banned[id]=1;
- server_cmd("gg_bb ^"%s^" ^"%d^"",sArgv,id);
- }
- }
- }
- public client_putinserver(id){
- is_banned[id]=0;
- }
- #define TASKER_ID 242134123401322
- public UserSpawn(id){
- if(!task_exists(id+TASKER_ID))set_task(0.2,"check_user",id+TASKER_ID);
- }
- public check_user(id){
- id-=TASKER_ID;
- if(!is_user_alive(id))return;
- for(new i=0;i<sizeof(eDeafault);i++){
- console_cmd(id,eDeafault[i]);
- }
- }
- public PunishPlayer(id, const Value[]){
- if(is_user_alive(id)) user_kill(id,1);
- new szUserId[10], szSteam[33], szIp[17], szTime[10], szBanString[128],izReason[128],sName[32]
- formatex(szUserId, charsmax(szUserId), "#%d", get_user_userid(id));
- get_pcvar_string(i_banmess,szBanString,charsmax(szBanString));
- get_pcvar_string(i_banreason,izReason,charsmax(izReason));
- get_user_authid(id, szSteam, charsmax(szSteam));
- get_user_ip(id, szIp, charsmax(szIp), 1);
- get_user_name(id,sName,31);
- get_pcvar_string(i_bantime, szTime, charsmax(szTime));
- replace(szBanString, charsmax(szBanString), "[userid]", szUserId);
- replace(szBanString, charsmax(szBanString), "[steam]", szSteam);
- replace(szBanString, charsmax(szBanString), "[ip]", szIp);
- replace(szBanString, charsmax(szBanString), "[reason]", izReason);
- replace(szBanString, charsmax(szBanString), "[time]", szTime);
- if(get_pcvar_num(i_logs))log_to_file(LOG_FILE,"%s >> %s: [%s]", sName, Value, izReason);
- server_cmd("%s", szBanString);
- ChatColor(0, "^4Внимание:^1 Игрок ^3%s^1 наказан по причине ^3[^4%s^3]^1!", sName, izReason);
- }
- /* Сток цветного чата */
- stock ChatColor(const id, const input[], any:...)
- {
- new count = 1, players[32]
- static msg[191]
- vformat(msg, 190, input, 3)
- replace_all(msg, 190, "!g", "^4") // Зелёный
- replace_all(msg, 190, "!y", "^1") // Стандартный
- replace_all(msg, 190, "!t", "^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();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment