代码拉取完成,页面将自动刷新
#include "Features.h"
bool Settings::AutoDefuse::enabled = false;
bool Settings::AutoDefuse::silent = false;
void AutoDefuse::CreateMove(CUserCmd *cmd)
{
if (!Settings::AutoDefuse::enabled && !Settings::AutoDefuse::silent)
return;
C_BasePlayer* localplayer = (C_BasePlayer*)pEntityList->GetClientEntity(pEngine->GetLocalPlayer());
if (!localplayer || !localplayer->GetAlive())
return;
if (localplayer->GetTeam() != TeamID::TEAM_COUNTER_TERRORIST)
return;
if (!(*pGameRules) || !(*pGameRules)->IsBombPlanted())
return;
C_PlantedC4* bomb = nullptr;
for (int i = 1; i < pEntityList->GetHighestEntityIndex(); i++)
{
C_BaseEntity* entity = (C_BaseEntity*)pEntityList->GetClientEntity(i);
if (!entity)
continue;
if (entity->GetClientClass()->m_ClassID == EClassIds::CPlantedC4)
{
bomb = (C_PlantedC4*)entity;
break;
}
}
if (!bomb || bomb->IsBombDefused())
return;
float bombTimer = bomb->GetBombTime() - pGlobalVars->curtime;
if (Settings::AutoDefuse::silent)
{
float distance = localplayer->GetVecOrigin().DistTo(bomb->GetVecOrigin());
if (cmd->buttons & IN_USE && distance <= 75.0f)
{
Vector pVecTarget = localplayer->GetEyePosition();
Vector pTargetBomb = bomb->GetVecOrigin();
Vector angle = Math::CalcAngle(pVecTarget, pTargetBomb);
Math::ClampAngles(angle);
cmd->viewangles = angle;
}
}
else
if (Settings::AutoDefuse::enabled)
{
if (localplayer->HasDefuser() && bombTimer > 5.5f)
return;
if (!localplayer->HasDefuser() && bombTimer > 10.5f)
return;
float distance = localplayer->GetVecOrigin().DistTo(bomb->GetVecOrigin());
if (distance <= 75.0f)
cmd->buttons |= IN_USE;
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。