-
Автор темы
- #1
Source:
Вот souce silent aim :
void hacks::AimBot(CUserCmd* cmd) noexcept
{
if (globals::localPlayer->IsDefusing()) return;
CEntity* activeWeapon = globals::localPlayer->GetActiveWeapon();
if (!activeWeapon) return;
const int weaponType = activeWeapon->GetWeaponType();
switch(weaponType)
{
case CEntity::WEAPONTYPE_MACHINEGUN:
case CEntity::WEAPONTYPE_RIFLE:
case CEntity::WEAPONTYPE_SHOTGUN:
case CEntity::WEAPONTYPE_SNIPER:
case CEntity::WEAPONTYPE_PISTOL:
{
if (!activeWeapon->GetClip())
return;
if (weaponType == CEntity::WEAPONTYPE_SNIPER) {
if (!globals::localPlayer->IsScoped())
globals::localPlayer->IsScoped() = true;
}
break;
}
default:
return;
}
CVector bestAngle{};
//Fov
float bestFov{ 360.f };
for (int i = 1; i <= interfaces::globals->maxClients;++i) {
CEntity* player = interfaces::entityList->GetEntityFromIndex(i);
if (!player) continue;
if (player->IsDormant() || !player->IsAlive()) continue;
if (player->GetTeam() == globals::localPlayer->GetTeam()) continue;
if (player->HasGunGameImmunity()) continue;
CMatrix3x4 bones[128];
if (!player->SetupBones(bones, 128, 256, interfaces::globals->currentTime)) continue;
CVector localEyePosition;
globals::localPlayer->GetEyePosition(localEyePosition);
CVector aimPunch{};
switch (weaponType) {
case CEntity::WEAPONTYPE_RIFLE:
case CEntity::WEAPONTYPE_SUBMACHINEGUN:
case CEntity::WEAPONTYPE_MACHINEGUN:
globals::localPlayer->GetAimPunch(aimPunch);
}
CTrace trace;
interfaces::engineTrace->TraceRay(
CRay{ localEyePosition , bones[8].Origin() },
MASK_SHOT,
CTraceFilter{globals::localPlayer},
trace
);
if (!trace.entity) return;
CVector enemyAngle
{
(bones[8].Origin() - localEyePosition).ToAngle() - (cmd->viewAngles + aimPunch)
};
if (const float fov = std::hypot(enemyAngle.x, enemyAngle.y); fov < bestFov) {
bestFov = fov;
bestAngle = enemyAngle;
}
}
cmd->viewAngles = cmd->viewAngles + bestAngle;
}
все написано очень просто.
Вот souce silent aim :
void hacks::AimBot(CUserCmd* cmd) noexcept
{
if (globals::localPlayer->IsDefusing()) return;
CEntity* activeWeapon = globals::localPlayer->GetActiveWeapon();
if (!activeWeapon) return;
const int weaponType = activeWeapon->GetWeaponType();
switch(weaponType)
{
case CEntity::WEAPONTYPE_MACHINEGUN:
case CEntity::WEAPONTYPE_RIFLE:
case CEntity::WEAPONTYPE_SHOTGUN:
case CEntity::WEAPONTYPE_SNIPER:
case CEntity::WEAPONTYPE_PISTOL:
{
if (!activeWeapon->GetClip())
return;
if (weaponType == CEntity::WEAPONTYPE_SNIPER) {
if (!globals::localPlayer->IsScoped())
globals::localPlayer->IsScoped() = true;
}
break;
}
default:
return;
}
CVector bestAngle{};
//Fov
float bestFov{ 360.f };
for (int i = 1; i <= interfaces::globals->maxClients;++i) {
CEntity* player = interfaces::entityList->GetEntityFromIndex(i);
if (!player) continue;
if (player->IsDormant() || !player->IsAlive()) continue;
if (player->GetTeam() == globals::localPlayer->GetTeam()) continue;
if (player->HasGunGameImmunity()) continue;
CMatrix3x4 bones[128];
if (!player->SetupBones(bones, 128, 256, interfaces::globals->currentTime)) continue;
CVector localEyePosition;
globals::localPlayer->GetEyePosition(localEyePosition);
CVector aimPunch{};
switch (weaponType) {
case CEntity::WEAPONTYPE_RIFLE:
case CEntity::WEAPONTYPE_SUBMACHINEGUN:
case CEntity::WEAPONTYPE_MACHINEGUN:
globals::localPlayer->GetAimPunch(aimPunch);
}
CTrace trace;
interfaces::engineTrace->TraceRay(
CRay{ localEyePosition , bones[8].Origin() },
MASK_SHOT,
CTraceFilter{globals::localPlayer},
trace
);
if (!trace.entity) return;
CVector enemyAngle
{
(bones[8].Origin() - localEyePosition).ToAngle() - (cmd->viewAngles + aimPunch)
};
if (const float fov = std::hypot(enemyAngle.x, enemyAngle.y); fov < bestFov) {
bestFov = fov;
bestAngle = enemyAngle;
}
}
cmd->viewAngles = cmd->viewAngles + bestAngle;
}
все написано очень просто.