AIM BLOCK 2.8 "FM_CmdStart_Pre"

Сообщения
3
Реакции
0
Ошибка
L 07/29/2024 - 19:08:10: [AMXX] Run time error 10: native error (native "set_task")
L 07/29/2024 - 19:08:10: [AMXX] [0] cp_aim_blocker.sma::FM_CmdStart_Pre (line 308)
L 07/29/2024 - 19:08:10: [cp/anti-cheat/cp_aim_blocker.amxx] performance issue. Function FM_CmdStart_Pre executed more than 12.9ms.
L 07/29/2024 - 19:08:10: Function is not present (function "force_drop_client_bad_fps") (plugin "cp/anti-cheat/cp_aim_blocker.amxx")
L 07/29/2024 - 19:08:10: [AMXX] Displaying debug trace (plugin "cp/anti-cheat/cp_aim_blocker.amxx", version "2.8")
ОС
Windows
Amx Mod X
1.10
Билд
8684
ReGamedll
5.26.0.668
Версия Metamod
1.3.0.149
Список метамодулей
Currently loaded plugins:
description stat pend file vers src load unload
[ 1] AMX Mod X RUN - amxmodx_mm.dll v1.10.0.5467 ini Start ANY
[ 2] Reunion RUN - reunion_mm.dll v0.1.92d ini Start Never
[ 3] ReAuthCheck RUN - reauthcheck_mm.dll v0.1.6 ini Start Never
[ 4] Revoice RUN - revoice_mm.dll v0.1.0.34 ini Start Never
[ 5] ReSemiclip RUN - resemiclip_mm.dll v2.4.3 ini Chlvl ANY
[ 6] HitBox Fix RUN - hitbox_fix_mm.dll v1.1.5 ini Start ANY
[ 7] Print Center Fix RUN - printcenterfix_mm.dll v2.0.1 ini ANY ANY
[ 8] YaPB RUN - yapb.dll v4.4.957 ini Chlvl ANY
[ 9] SafeNameAndChat RUN - safenameandchat.dll v1.2 Beta 3 ini ANY ANY
[10] WHBlocker RUN - whblocker_mm.dll v1.5.697 ini Chlvl ANY
[11] SHDetect RUN - shdetect.dll v0.5 ini ANY ANY
[12] ReAPI RUN - reapi_amxx.dll v5.24.0.300-dev pl1 ANY Never
[13] ReAimDetector RUN - reaimdetector_amxx.dll v0.2.2 pl1 ANY Never
[14] Ham Sandwich RUN - hamsandwich_amxx.dll v1.10.0.5467 pl1 ANY ANY
[15] FakeMeta RUN - fakemeta_amxx.dll v1.10.0.5467 pl1 ANY ANY
[16] Engine RUN - engine_amxx.dll v1.10.0.5467 pl1 ANY ANY
[17] CSX RUN - csx_amxx.dll v1.10.0.5467 pl1 ANY ANY
[18] Fun RUN - fun_amxx.dll v1.10.0.5467 pl1 ANY ANY
[19] CStrike RUN - cstrike_amxx.dll v1.10.0.5467 pl1 ANY ANY
19 plugins, 19 running
Список плагинов
Currently loaded plugins:
id name version author url file status
[ 1] 0 Unreal Aim Blocker 2.8 karaulov cp/anti-che debug
[ 2] 1 FPS Meter 1.1 neygomon cp/cp_serve running
[ 3] 2 UnrealUnprecacher 1.3 Karaulov cp/cp_unrea running
[ 4] 3 World Model Group 1.2 w0w cp/cp_world running
[ 5] 4 Objective as GameName 1.2.1 CHEL74 cp/mods/cp_ running
[ 6] 5 trigger_camera fix 1.0.0 Nordic Warrior t.me/NordicWarrior cp/mods/cp_ running
[ 7] 6 [ReAPI] Block 'Fire in 0.0.1 sergrib cp/mods/cp_ running
[ 8] 7 [REAPI] User FOV 2.04.24 DEV-CS.RU cp/mods/cp_ running
[ 9] 8 ReAimDetector API 0.2.2 ReHLDS Team cp/anti-che running
[ 10] 9 Server-Side SmokeNade 1.0.0-beta Sergey Shorokhov https://github.com/wopox1337/Se cp/anti-che running
[ 11] 10 Admin Base 1.10.0.546 AMXX Dev Team admin.amxx running
[ 12] 11 Admin Commands 1.10.0.546 AMXX Dev Team admincmd.am running
[ 13] 12 Admin Help 1.10.0.546 AMXX Dev Team adminhelp.a running
[ 14] 13 Slots Reservation 1.10.0.546 AMXX Dev Team adminslots. running
[ 15] 14 Multi-Lingual System 1.10.0.546 AMXX Dev Team multilingua running
[ 16] 15 Menus Front-End 1.10.0.546 AMXX Dev Team menufront.a running
[ 17] 16 Commands Menu 1.10.0.546 AMXX Dev Team cmdmenu.amx running
[ 18] 17 Players Menu 1.10.0.546 AMXX Dev Team plmenu.amxx running
[ 19] 18 Maps Menu 1.10.0.546 AMXX Dev Team mapsmenu.am running
[ 20] 19 Plugin Menu 1.10.0.546 AMXX Dev Team pluginmenu. running
[ 21] 20 Admin Chat 1.10.0.546 AMXX Dev Team adminchat.a running
[ 22] 21 Anti Flood 1.10.0.546 AMXX Dev Team antiflood.a running
[ 23] 22 Scrolling Message 1.10.0.546 AMXX Dev Team scrollmsg.a running
[ 24] 23 Info. Messages 1.10.0.546 AMXX Dev Team imessage.am running
[ 25] 24 Admin Votes 1.10.0.546 AMXX Dev Team adminvote.a running
[ 26] 25 Pause Plugins 1.10.0.546 AMXX Dev Team pausecfg.am running
[ 27] 26 Stats Configuration 1.10.0.546 AMXX Dev Team statscfg.am running
[ 28] 27 AES: StatsX 0.5+1 serfreeman1337 cp/statsx/c running
[ 29] 28 StatsX 1.10.0.546 AMXX Dev Team statsx.amxx running
[ 30] 29 Ping Control 1.2 mx?! cp/cp_ping_ running
[ 31] 30 AFK Control 1.0 mx?! cp/cp_afk_c running
[ 32] 31 [ReAPI] Best player of 1.1.2 F@nt0M cp/statsx/c running
[ 33] 32 Stats Marquee 1.2 Travo cp/statsx/c running
[ 34] 33 Top SayPrefix 0.4 serfreeman1337 cp/statsx/c running
[ 35] 34 Bot Features 0.9 Vaqtincha cp/cp_BotFe running
[ 36] 35 Spectator Bots 2.1.2 SISA cp/cp_spect running
[ 37] 36 [AMXX] Weapon Damage C 0.1 Flymic24 cp/cp_weapo running
[ 38] 37 WeaponState Remember 0.0.4 Vaqtincha cp/cp_weapo running
[ 39] 38 Weapon Use Pickup 1.4 fl0wer & Purpose cp/cp_weapo running
[ 40] 39 Lie Flat Optimized 1.1 Nomexous cp/cp_lie_f running
[ 41] 40 Lite Vampire + Fade 1.3 neygomon cp/cp_lite_ running
[ 42] 41 Advanced Kill Assists 1.5 Xelson cp/cp_next2 running
[ 43] 42 ReSpeedometer 1.1b PurposeLess & wo cp/fan/cp_r running
[ 44] 43 Reload radio 1.0 xPaw cp/fan/cp_R running
[ 45] 44 Shaking The Grenade 1.0 b0t. cp/fan/cp_S running
[ 46] 45 Vehicle Real Killer 1.1 xPaw cp/fan/cp_V running
[ 47] 46 Simple Damager 2.1.0 fl0wer cp/fan/cp_s running
[ 48] 47 SpecList 1.4 pUzzlik cp/fan/cp_s running
[ 49] 48 Advanced Slow Motion 0.1 KRoTaL cp/fan/cp_a running
[ 50] 49 Die Motion Rate 0.0.2 Vaqtincha cp/fan/cp_m running
[ 51] 50 Ultimate Gore 1.6 JTP10181 cp/fan/cp_a running
[ 52] 51 AMXX Piss 2.0 KRoTaL cp/fan/cp_a running
[ 53] 52 Revive Teammates: Core 2.2.8 DEV-CS.RU Commun rt/rt_core. running
[ 54] 53 Revive Teammates: Plan 2.2.8 DEV-CS.RU Commun rt/rt_plant running
[ 55] 54 Revive Teammates: Rest 2.2.8 DEV-CS.RU Commun rt/rt_restr running
[ 56] 55 Revive Teammates: Time 2.2.8 DEV-CS.RU Commun rt/rt_timer running
[ 57] 56 Revive Teammates: Effe 2.2.8 DEV-CS.RU Commun rt/rt_effec running
[ 58] 57 Revive Teammates: Soun 2.2.8 DEV-CS.RU Commun rt/rt_sound running
[ 59] 58 Revive Teammates: Bonu 2.2.8 DEV-CS.RU Commun rt/rt_bonus running
[ 60] 59 Map Manager: Core 3.2.1 Mistrick mapmanager/ running
[ 61] 60 Map Manager: Scheduler 0.2.1 Mistrick mapmanager/ running
[ 62] 61 Map Manager: Rtv 0.1.5 Mistrick mapmanager/ running
[ 63] 62 Map Manager: Nominatio 0.3.5 Mistrick mapmanager/ running
[ 64] 63 Map Manager: BlockList 0.0.4 Mistrick mapmanager/ running
[ 65] 64 Map Manager: Online so 0.0.4 Mistrick mapmanager/ running
[ 66] 65 Map Manager: Effects 0.1.3 Mistrick mapmanager/ running
[ 67] 66 Map Manager: Informer 0.0.5 Mistrick mapmanager/ running
[ 68] 67 Map Manager: Sounds 0.0.3 Mistrick mapmanager/ running
[ 69] 68 Auto Team Switcher 1.0 nikhilgupta345 cp/mods/cp_ running
[ 70] 69 Restrict Weapons 1.10.0.546 AMXX Dev Team restmenu.am running
[ 71] 70 Team Balance Control 1.3.9 gyxoBka cp_a/cp_Tea running
[ 72] 71 Simple WarmUp Mode 2.2.1 d3m37r4 cp_a/cp_sim running
[ 73] 72 Spec Money Save 0.2 F@nt0M cp_a/cp_spe running
[ 74] 73 Molotov Grenade 1.0.3 medusa cp_a/cp_mol running
[ 75] 74 CS:GO Money Rewards 0.0.1 PurposeLess cp_a/cp_csg running
[ 76] 75 Sell Weapons 1.0 Ruby cp_a/cp_sel running
[ 77] 76 Awp Block New 3.5 b0t. cp_a/fan/cp running
[ 78] 77 D7 Announcer Kills: Do 0.4.2 D i 5 7 i n c T cp_a/fan/cp running
[ 79] 78 NoLag Nightvision 1.0 Foxa cp_a/fan/cp running
[ 80] 79 Music Connection 1.0.1 Jumper cp_a/fan/cp running
[ 81] 80 FirstPlayersRespawn 1.0.1 Emma Jule cp_a/fan/cp running
81 plugins, 81 running
Автор плагина
karaulov
Версия плагина
2.8
Исходный код
#include <amxmodx>
#include <reapi>
#include <hamsandwich>
#include <fakemeta>
#include <easy_cfg>
#include <cssdk_const>
#include <xs>

#pragma ctrlchar '\'

new const DEFAULT_BLOCKWEAPON_LIST[][] = { "weapon_p228", "weapon_xm1014", "weapon_c4", "weapon_mac10", "weapon_elite", "weapon_fiveseven",
"weapon_ump45", "weapon_galil", "weapon_mp5navy", "weapon_m249", "weapon_m3", "weapon_tmp", "weapon_deagle", "weapon_ak47", "weapon_p90" };

new Array:g_aBlockWeapons;

new g_iAimBlockMethod = 1;
new g_iScoreAttribMsg = 0;
new g_iScoreInfoMsg = 0;
new g_iForcechasecam = 0;
new g_iForcecamera = 0;
new g_iFadetoblack = 0;

new g_iButtons[MAX_PLAYERS + 1] = {0, ...};
//new g_iButtons_old[MAX_PLAYERS + 1] = {0, ...};
new g_iCmdCounter[MAX_PLAYERS + 1] = {0, ...};
new g_iCmdMsecCounter[MAX_PLAYERS + 1] = {0, ...};
new g_iBlockMove[MAX_PLAYERS + 1] = {0, ...};

new bool:g_bBlockScoreAttr = true;
new bool:g_bBlockScoreAttrAttack = false;
new bool:g_bBlockScoreLocalDead = false;
new bool:g_bShowDef = false;
new bool:g_bBlockBadCmd = false;

new bool:g_bCurScore[MAX_PLAYERS + 1] = {false, ...};
new bool:g_bWaitForBuyZone[MAX_PLAYERS + 1] = {false, ...};
new bool:g_bRadarFix[MAX_PLAYERS + 1] = {false, ...};
new bool:g_bUserBot[MAX_PLAYERS + 1] = {false, ...};

new Float:g_fRadarUpdateTime[MAX_PLAYERS + 1] = {0.0, ...};
new Float:g_fRadarStayTime = 0.45;
new Float:g_fRadarDeadTime = 0.05;

new Float:g_vAngles1[MAX_PLAYERS + 1][3];
new Float:g_vAngles2[MAX_PLAYERS + 1][3];
new Float:g_vCmdCheckTime[MAX_PLAYERS + 1] = {0.0, ...};
new Float:g_vCL_movespeedkey[MAX_PLAYERS + 1] = {0.0, ...};

new const PLUGIN_VERSION[] = "2.8";

public plugin_init()
{
register_plugin("Unreal Aim Blocker", PLUGIN_VERSION, "karaulov");
create_cvar("unreal_no_aim", PLUGIN_VERSION, FCVAR_SERVER | FCVAR_SPONLY);

g_aBlockWeapons = ArrayCreate(64);

cfg_set_path("plugins/unreal_aim_blocker.cfg");

new tmp_cfgdir[512];
cfg_get_path(tmp_cfgdir,charsmax(tmp_cfgdir));
trim_to_dir(tmp_cfgdir);

if (!dir_exists(tmp_cfgdir))
{
log_amx("Warning config dir not found: %s",tmp_cfgdir);
if (mkdir(tmp_cfgdir) < 0)
{
log_error(AMX_ERR_NOTFOUND, "Can't create %s dir",tmp_cfgdir);
set_fail_state("Fail while create %s dir",tmp_cfgdir);
return;
}
else
{
log_amx("Config dir %s created!",tmp_cfgdir);
}
}

new iBlockWeaponCount = 0;
cfg_read_int("general","block_weapon_count",iBlockWeaponCount,iBlockWeaponCount);
cfg_read_int("general","aim_block_method",g_iAimBlockMethod,g_iAimBlockMethod);
cfg_read_bool("general","block_score",g_bBlockScoreAttr,g_bBlockScoreAttr);
cfg_read_bool("general","block_score_attack",g_bBlockScoreAttrAttack,g_bBlockScoreAttrAttack);
cfg_read_bool("general","block_score_local_dead",g_bBlockScoreLocalDead,g_bBlockScoreLocalDead);
cfg_read_flt("general","block_score_radar_staytime",g_fRadarStayTime,g_fRadarStayTime);
cfg_read_flt("general","block_score_radar_deadtime",g_fRadarDeadTime,g_fRadarDeadTime);
cfg_read_bool("general","block_bad_cmd",g_bBlockBadCmd,g_bBlockBadCmd);

if (g_fRadarStayTime < 0.1)
g_fRadarStayTime = 0.1;

if (g_fRadarDeadTime < 0.01)
g_fRadarDeadTime = 0.01;

new sWeaponName[64];
new sWeaponId[64];

if (iBlockWeaponCount == 0)
{
cfg_write_int("general","block_weapon_count",sizeof(DEFAULT_BLOCKWEAPON_LIST));
for (new i = 0; i < sizeof(DEFAULT_BLOCKWEAPON_LIST); i++)
{
formatex(sWeaponId,charsmax(sWeaponId),"weapon%i",i+1);
cfg_write_str("weapons",sWeaponId,DEFAULT_BLOCKWEAPON_LIST[i]);
ArrayPushString(g_aBlockWeapons,DEFAULT_BLOCKWEAPON_LIST[i]);
}
}
else
{
for (new i = 0; i < iBlockWeaponCount; i++)
{
formatex(sWeaponId,charsmax(sWeaponId),"weapon%i",i+1);
cfg_read_str("weapons",sWeaponId,sWeaponName,sWeaponName,charsmax(sWeaponName));
ArrayPushString(g_aBlockWeapons,sWeaponName);
}
}

if (iBlockWeaponCount > 0)
{
for (new i = 0; i < ArraySize(g_aBlockWeapons); i++)
{
ArrayGetString(g_aBlockWeapons, i, sWeaponName, charsmax(sWeaponName));
RegisterHam(Ham_Weapon_PrimaryAttack, sWeaponName, "fw_block_weapon_secondary", 1);
RegisterHam(Ham_Item_Deploy, sWeaponName, "fw_block_weapon_secondary", 1);
}
}

if (g_iAimBlockMethod == 1)
{
RegisterHookChain(RG_PM_Move, "PM_Move_Post", .post = true);
}

if (g_iAimBlockMethod == 2 || g_bBlockBadCmd)
{
RegisterHookChain(RG_PM_Move, "PM_Move_Pre", .post = false);
}

register_forward(FM_CmdStart, "FM_CmdStart_Pre", false);
if (g_iAimBlockMethod == 1)
{
cfg_set_path("reaimdetector");

new iNoSpread = 0;
cfg_read_int("NOSPREAD","NOSPREAD_DETECTION",iNoSpread,iNoSpread);
if (iNoSpread > 0)
{
log_amx("Detected NOSPREAD_DETECTION = %i in reaimdetector.cfg!",iNoSpread);
cfg_write_int("NOSPREAD","NOSPREAD_DETECTION",0);
server_cmd("reaim_reloadcfg");
log_amx("Reloaded reaimdetector.cfg!");
}
}

if (g_bBlockScoreAttr)
{
g_bShowDef = get_cvar_float("mp_scoreboard_showdefkit") != 0.0;

g_iScoreAttribMsg = get_user_msgid("ScoreAttrib");
g_iScoreInfoMsg = get_user_msgid("ScoreInfo");

bind_pcvar_num(get_cvar_pointer("mp_forcechasecam"), g_iForcechasecam);
bind_pcvar_num(get_cvar_pointer("mp_forcecamera"), g_iForcecamera);
bind_pcvar_num(get_cvar_pointer("mp_fadetoblack"), g_iFadetoblack);

register_message(g_iScoreAttribMsg, "ScoreAttrib_HOOK");
}


log_amx("AimBlocker [v%s] loaded!", PLUGIN_VERSION);
log_amx("Settings: ");
log_amx(" aim_block_method = %i",g_iAimBlockMethod);
log_amx(" block_weapon_count = %i",iBlockWeaponCount);
log_amx(" block_bad_cmd = %i",g_bBlockBadCmd);
log_amx(" block_score = %i",g_bBlockScoreAttr);
log_amx(" block_score_attack = %i",g_bBlockScoreAttrAttack);
log_amx(" block_score_local_dead = %i",g_bBlockScoreLocalDead);
log_amx(" block_score_radar_staytime = %f",g_fRadarStayTime);
log_amx(" block_score_radar_deadtime = %f",g_fRadarDeadTime);
}

public clear_client(id)
{
g_bCurScore[id] = g_bWaitForBuyZone[id] = false;
g_vAngles1[id][0] = g_vAngles1[id][1] = g_vAngles1[id][2] = 0.0;
g_vAngles2[id][0] = g_vAngles2[id][1] = g_vAngles2[id][2] = 0.0;
g_iButtons[id] = /*g_iButtons_old[id] =*/ 0;
g_vCmdCheckTime[id] = 0.0;
g_iCmdCounter[id] = 0;
g_iCmdMsecCounter[id] = 0;
g_iBlockMove[id] = 0;
g_bUserBot[id] = false;
}

public client_disconnected(id)
{
clear_client(id);
}

public client_connectex(id)
{
clear_client(id);
g_vCmdCheckTime[id] = get_gametime();
}

public client_putinserver(id)
{
g_vCL_movespeedkey[id] = 0.52;
g_bUserBot[id] = is_user_bot(id) || is_user_hltv(id);
if (g_bBlockBadCmd && !g_bUserBot[id])
{
query_client_cvar(id, "cl_movespeedkey", "update_client_movespeedkey");
set_task(5.0, "query_client_movespeedkey", id);
}
}

public update_client_movespeedkey(id, const cvar[], const value[])
{
g_vCL_movespeedkey[id] = str_to_float(value);
// max playable speed
if (g_vCL_movespeedkey[id] <= 0.01 || g_vCL_movespeedkey[id] > 0.52)
{
g_vCL_movespeedkey[id] = 0.52;
}
}

public query_client_movespeedkey(id)
{
if (!g_bUserBot[id] && is_user_connected(id))
{
query_client_cvar(id, "cl_movespeedkey", "update_client_movespeedkey");
set_task(5.0, "query_client_movespeedkey", id);
}
}

public plugin_end()
{
ArrayDestroy(g_aBlockWeapons);
}

public PM_Move_Post(const id)
{
static Float:vTmpAngles[3];
if (id > 0 && id <= MaxClients && !g_bUserBot[id])
{
if (g_iAimBlockMethod == 1)
{
get_pmove(pm_oldangles, vTmpAngles);
set_pmove(pm_oldangles, g_vAngles1[id]);
g_vAngles1[id][0] = vTmpAngles[0];
g_vAngles1[id][1] = vTmpAngles[1];
g_vAngles1[id][2] = vTmpAngles[2];
get_pmove(pm_angles, vTmpAngles);
set_pmove(pm_angles, g_vAngles2[id]);
g_vAngles2[id][0] = vTmpAngles[0];
g_vAngles2[id][1] = vTmpAngles[1];
g_vAngles2[id][2] = vTmpAngles[2];
}
}
return HC_CONTINUE;
}

public PM_Move_Pre(const id)
{
static Float:vTmpAngles[3];
if (id > 0 && id <= MaxClients && !g_bUserBot[id])
{
if (g_iAimBlockMethod == 2)
{
new cmd = get_pmove(pm_cmd);
set_ucmd(cmd,ucmd_buttons, get_entvar(id, var_button));
}

if (g_bBlockBadCmd)
{
if (g_iBlockMove[id] > 0)
{
get_pmove(pm_velocity, vTmpAngles);
vTmpAngles[0] /= 1.2;
vTmpAngles[1] /= 1.2;
set_pmove(pm_velocity, vTmpAngles);

if (g_iBlockMove[id] > 1)
{
get_entvar(id, var_velocity, vTmpAngles);
vTmpAngles[0] /= 2.0;
vTmpAngles[1] /= 2.0;
set_entvar(id, var_velocity, vTmpAngles);
}
}
}
}
}

public FM_CmdStart_Pre(id, handle)
{
if (id > 0 && id <= MaxClients && !g_bUserBot[id])
{
new btn = get_uc(handle, UC_Buttons);
new bool:bHandled = false;

if (g_bBlockBadCmd)
{
new iMsec = get_uc(handle, UC_Msec);
new Float:fMaxMov = get_entvar(id,var_maxspeed);

if (iMsec < 1)
{
set_task(0.01,"force_drop_client_bad_fps",id);
return FMRES_SUPERCEDE;
}
else if (fMaxMov > 0.0 && is_user_alive(id))
{
new Float:fForward = 0.0;
get_uc(handle, UC_ForwardMove, fForward);
new Float:fSide = 0.0;
get_uc(handle, UC_SideMove, fSide);
new Float:fUp = 0.0;
get_uc(handle, UC_UpMove, fUp);

if ( fForward != 0.0 || fSide != 0.0 || fUp != 0.0 )
{
new Float:fmov = xs_sqrt((fForward * fForward) + (fSide * fSide) + (fUp * fUp));
new Float:fmov2 = fmov / g_vCL_movespeedkey[id];

if (btn & IN_MOVERIGHT == 0 && btn & IN_MOVELEFT == 0 && fSide != 0.0)
{
g_iBlockMove[id]++;
//log_amx("[%i] bad cmd1 fmov = %.2f, fmov2 = %.2f, fMaxMov = %.2f [%.2f %.2f %.2f]", id,fmov,fmov2,fMaxMov, fForward, fSide, fUp);
}
else if (btn & IN_FORWARD == 0 && btn & IN_BACK == 0 && fForward != 0.0)
{
g_iBlockMove[id]++;
//log_amx("[%i] bad cmd2 fmov = %.2f, fmov2 = %.2f, fMaxMov = %.2f [%.2f %.2f %.2f]", id,fmov,fmov2,fMaxMov, fForward, fSide, fUp);
}
else if (btn & IN_MOVERIGHT != 0 && btn & IN_MOVELEFT == 0 && fSide < -1.0)
{
g_iBlockMove[id]++;
//log_amx("[%i] bad cmd3 fmov = %.2f, fmov2 = %.2f, fMaxMov = %.2f [%.2f %.2f %.2f]", id,fmov,fmov2,fMaxMov, fForward, fSide, fUp);
}
else if (btn & IN_MOVERIGHT == 0 && btn & IN_MOVELEFT != 0 && fSide > 1.0)
{
g_iBlockMove[id]++;
//log_amx("[%i] bad cmd4 fmov = %.2f, fmov2 = %.2f, fMaxMov = %.2f [%.2f %.2f %.2f]", id,fmov,fmov2,fMaxMov, fForward, fSide, fUp);
}
else if (btn & IN_FORWARD != 0 && btn & IN_BACK == 0 && fForward < -1.0)
{
g_iBlockMove[id]++;
//log_amx("[%i] bad cmd5 fmov = %.2f, fmov2 = %.2f, fMaxMov = %.2f [%.2f %.2f %.2f]", id,fmov,fmov2,fMaxMov, fForward, fSide, fUp);
}
else if (floatabs(fmov - fMaxMov) > 5.0 && floatabs(fmov2 - fMaxMov) > 5.0)
{
if (g_iBlockMove[id] == 0)
{
new Float:fmov3 = fmov * 1.25;
new Float:fmov4 = fmov2 * 1.25;
if (floatabs(fmov3 - fMaxMov) > 5.0 && floatabs(fmov4 - fMaxMov) > 5.0)
{
g_iBlockMove[id]++;
//log_amx("[%i] bad fmov = %.2f, fmov2 = %.2f, fMaxMov = %.2f [%.2f %.2f %.2f]", id,fmov,fmov2,fMaxMov, fForward, fSide, fUp);
}
else
{
//log_amx("[%i] good2 fmov = %.2f, fmov2 = %.2f, fMaxMov = %.2f [%.2f %.2f %.2f]", id,fmov,fmov2,fMaxMov, fForward, fSide, fUp);
g_iBlockMove[id] = 0;
}
}
else
{
g_iBlockMove[id]++;
//log_amx("[%i] bad fmov = %.2f, fmov2 = %.2f, fMaxMov = %.2f [%.2f %.2f %.2f]", id,fmov,fmov2,fMaxMov, fForward, fSide, fUp);
}
}
else
{
//log_amx("[%i] good fmov = %.2f, fmov2 = %.2f, fMaxMov = %.2f [%.2f %.2f %.2f]", id,fmov,fmov2,fMaxMov, fForward, fSide, fUp);
g_iBlockMove[id] = 0;
}
}
else
{
g_iBlockMove[id] = 0;
}
}
}

if (g_bBlockScoreAttr)
{
// Use score attrib message [like in softblocker]
new bool:oldScore = (g_iButtons[id] & IN_SCORE) > 0;
g_bCurScore[id] = (btn & IN_SCORE) > 0;

if (g_bBlockScoreAttrAttack)
{
if (g_bCurScore[id])
{
set_member(id, m_flNextAttack, 0.1);
}
}

if (g_bBlockScoreLocalDead)
{
if (g_bWaitForBuyZone[id])
{
if (rg_get_user_buyzone(id))
{
UpdateUserScoreForPlayer(id, id);
g_bWaitForBuyZone[id] = false;

// force update scoreboard
message_begin(MSG_ONE_UNRELIABLE, g_iScoreInfoMsg, _,id);
write_byte(33); // is safe!
write_short(0);
write_short(0);
write_short(0);
write_short(0);
message_end();
}
else
{
if (g_bRadarFix[id] && floatabs(get_gametime() - g_fRadarUpdateTime[id]) > g_fRadarDeadTime)
{
g_bRadarFix[id] = !g_bRadarFix[id];
UpdateUserScoreForPlayer(id, id);
g_fRadarUpdateTime[id] = get_gametime();
}
else if (!g_bRadarFix[id] && floatabs(get_gametime() - g_fRadarUpdateTime[id]) > g_fRadarStayTime)
{
g_bRadarFix[id] = !g_bRadarFix[id];
message_begin(MSG_ONE_UNRELIABLE, g_iScoreAttribMsg, _, id);
write_byte(id);
write_byte(SCORE_STATUS_DEAD);
message_end();
g_fRadarUpdateTime[id] = get_gametime();
}
}
}
else
{
if (!rg_get_user_buyzone(id))
{
g_bWaitForBuyZone[id] = true;
}
}
}

if (oldScore == true && g_bCurScore[id] == false)
{
if (!is_user_bot(id))
{
new bool:in_buyzone = true;

if (g_bBlockScoreLocalDead)
{
in_buyzone = rg_get_user_buyzone(id);
}

for(new iPlayer = 1; iPlayer <= MaxClients; iPlayer++)
{
if (iPlayer == id)
{
if (in_buyzone)
{
UpdateUserScoreForPlayer(id, iPlayer);
continue;
}
else
{
g_bWaitForBuyZone[id] = true;
}
}

if (is_user_connected(iPlayer))
{
if (get_member(id, m_iTeam) == get_member(iPlayer, m_iTeam))
{
continue;
}

message_begin(MSG_ONE_UNRELIABLE, g_iScoreAttribMsg, _, id);
write_byte(iPlayer);
write_byte(SCORE_STATUS_DEAD);
message_end();
}
}


// force update scoreboard
message_begin(MSG_ONE_UNRELIABLE, g_iScoreInfoMsg, _,id);
write_byte(33); // is safe!
write_short(0);
write_short(0);
write_short(0);
write_short(0);
message_end();
}
}
else if (oldScore == false && g_bCurScore[id] == true)
{
if (!is_user_bot(id))
{
for(new iPlayer = 1; iPlayer <= MaxClients; iPlayer++)
{
if (is_user_connected(iPlayer))
{
UpdateUserScoreForPlayer(id, iPlayer);
}
}

// force update scoreboard
message_begin(MSG_ONE_UNRELIABLE, g_iScoreInfoMsg, _,id);
write_byte(33); // is safe!
write_short(0);
write_short(0);
write_short(0);
write_short(0);
message_end();
}
}
}

if (g_iAimBlockMethod == 2)
{
/*new tmpbutton = get_entvar(id, var_oldbuttons);
set_entvar(id, var_oldbuttons, g_iButtons_old[id]);
g_iButtons_old[id] = tmpbutton;*/
set_uc(handle, UC_Buttons, g_iButtons[id]);
bHandled = true;
}

g_iButtons[id] = btn;

if (bHandled)
{
return FMRES_HANDLED;
}
}
return FMRES_IGNORED;
}

// Use score attrib message [like in softblocker]
public ScoreAttrib_HOOK(msgid, dest, id)
{
if (id <= 0 || id > MaxClients)
{
return PLUGIN_CONTINUE;
}

if (!g_bCurScore[id])
{
new target = get_msg_arg_int(1);
if (target == id)
{
if (g_bBlockScoreLocalDead)
{
if (!rg_get_user_buyzone(id))
{
return PLUGIN_HANDLED;
}
}
return PLUGIN_CONTINUE;
}
else if (get_member(id, m_iTeam) == get_member(target, m_iTeam))
{
return PLUGIN_CONTINUE;
}
return PLUGIN_HANDLED;
}

return PLUGIN_CONTINUE;
}

public fw_block_weapon_secondary(const weapon)
{
new id = get_member(weapon, m_pPlayer);
new Float:fSecondary = get_member(weapon, m_Weapon_flNextSecondaryAttack);

if (get_member(id,m_bOwnsShield))
{
if (fSecondary >= 1000.0)
{
set_member(weapon, m_Weapon_flNextSecondaryAttack, 0.0);
}
}
else if (fSecondary < 1000.0)
set_member(weapon, m_Weapon_flNextSecondaryAttack, 2000.0);

}

stock trim_to_dir(path[])
{
new len = strlen(path);
len--;
for(; len >= 0; len--)
{
if(path[len] == '/' || path[len] == '\\')
{
path[len] = EOS;
break;
}
}
}

#define CAMERA_MODE_SPEC_ANYONE 0
#define CAMERA_MODE_SPEC_ONLY_TEAM 1
#define CAMERA_MODE_SPEC_ONLY_FIRST_PERSON 2

#define FADETOBLACK_OFF 0
#define FADETOBLACK_STAY 1
#define FADETOBLACK_AT_DYING 2


stock GetForceCamera()
{
new retVal = 0;

if (g_iFadetoblack != FADETOBLACK_STAY)
{
retVal = g_iForcechasecam;

if (retVal == CAMERA_MODE_SPEC_ANYONE)
retVal = g_iForcecamera;
}
else
retVal = CAMERA_MODE_SPEC_ONLY_FIRST_PERSON;

return retVal;
}

stock UpdateUserScoreForPlayer(id, iPlayer)
{
new iState = SCORE_STATUS_NONE;

if (get_entvar(iPlayer,var_deadflag) != DEAD_NO)
{
iState |= SCORE_STATUS_DEAD;
}

if (get_member(iPlayer,m_bHasC4))
{
iState |= SCORE_STATUS_BOMB;
}

if (get_member(iPlayer,m_bIsVIP))
{
iState |= SCORE_STATUS_VIP;
}

if (g_bShowDef && get_member(iPlayer,m_bHasDefuser))
{
iState |= SCORE_STATUS_DEFKIT;
}

if (iState & (SCORE_STATUS_BOMB | SCORE_STATUS_DEFKIT) && GetForceCamera() != CAMERA_MODE_SPEC_ANYONE)
{
#if REAPI_VERSION > 524300
if (rg_player_relationship(id, iPlayer) != GR_TEAMMATE)
#else
if (get_member(iPlayer, m_iTeam) != get_member(id, m_iTeam))
#endif
iState &= ~(SCORE_STATUS_BOMB | SCORE_STATUS_DEFKIT);
}

message_begin(MSG_ONE, g_iScoreAttribMsg, _,id);
write_byte(iPlayer);
write_byte(iState);
message_end();
}

stock bool:rg_get_user_buyzone(const pClient) {
new iSignals[UnifiedSignals];
get_member(pClient, m_signals, iSignals);

return bool:(SignalState:iSignals[US_State] & SIGNAL_BUY);
}

stock force_drop_client_bad_fps(id)
{
if (is_user_connected(id))
{
clear_client(id);
rh_drop_client(id, "BAD FPS");
}
}
При значении block_bad_cmd = "true / 1".

Выдает такую ошибку:
-------------------------------------------------------------------------------------------------------------------

L 07/29/2024 - 19:08:10: [AMXX] Run time error 10: native error (native "set_task")
L 07/29/2024 - 19:08:10: [AMXX] [0] cp_aim_blocker.sma::FM_CmdStart_Pre (line 308)
L 07/29/2024 - 19:08:10: [cp/anti-cheat/cp_aim_blocker.amxx] performance issue. Function FM_CmdStart_Pre executed more than 12.9ms.
L 07/29/2024 - 19:08:10: Function is not present (function "force_drop_client_bad_fps") (plugin "cp/anti-cheat/cp_aim_blocker.amxx")
L 07/29/2024 - 19:08:10: [AMXX] Displaying debug trace (plugin "cp/anti-cheat/cp_aim_blocker.amxx", version "2.8")

-------------------------------------------------------------------------------------------------------------------
И сервер уходит в краш.
 
Сообщения
676
Реакции
578
Предупреждения
8
Помог
9 раз(а)
Сообщения
1,576
Реакции
658
Помог
5 раз(а)
Vaqtincha, там и не надо чаще чем 10 раз в секунду, одиночный вызов
 
Сообщения
676
Реакции
578
Предупреждения
8
Помог
9 раз(а)
@karaulov,ладно
 
Сообщения
1,576
Реакции
658
Помог
5 раз(а)
Arn1_95, я такой ошибки не получаю, странно

но в общем получается достаточно stock на public заменить что бы ошибки не было, опечатка в коде завтра обновлю ресурс

пока что во вкладку исходный код

https://dev-cs.ru/resources/1725/field?field=source

загрузил фикс этой ошибки
 
Последнее редактирование:
Сообщения
1,576
Реакции
658
Помог
5 раз(а)
Arn1_95 спасибо за багрепорт ошибка в коде (почему-то у меня работало, хотя не должно было т.к stock это не public)

Исправил опечатку и добавил еще багфиксов, в 2.10 версии.
 

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу