lev1on
Guest
L
-
Автор темы
- #1
Какой At Target лучше?
Этот:
Или этот:
Этот:
Код:
void AimAtTarget(CUserCmd *pCmd)
{
IClientEntity* pLocal = hackManager.pLocal();
CBaseCombatWeapon* pWeapon = (CBaseCombatWeapon*)Interfaces::EntList->GetClientEntityFromHandle(hackManager.pLocal()->GetActiveWeaponHandle());
if (!pLocal || !pWeapon)
return;
Vector eye_position = pLocal->GetEyePosition();
float best_dist = pWeapon->GetCSWpnData()->m_flRange;
IClientEntity* target = Interfaces::EntList->GetClientEntity(Globals::TargetID);
if (target == NULL)
return;
if (target == pLocal)
return;
if ((target->GetTeamNum() == pLocal->GetTeamNum()) || target->IsDormant() || !target->IsAlive() || target->GetHealth() <= 0)
return;
Vector target_position = target->GetEyePosition();
float temp_dist = eye_position.DistTo(target_position);
if (best_dist > temp_dist)
{
best_dist = temp_dist;
CalcAngle(eye_position, target_position, pCmd->viewangles);
}
}
Код:
void AtTarget(IClientEntity *Target, CUserCmd *pCmd) {
if (!Target)
return;
if ((Target->GetTeamNum() == hackManager.pLocal()->GetTeamNum()) || Target->IsDormant() || !Target->IsAlive() || Target->GetHealth() <= 0)
return;
Vector TargetPosition = Target->GetEyePosition();
CalcAngle(hackManager.pLocal()->GetEyePosition(), TargetPosition, pCmd->viewangles);
}
Последнее редактирование модератором: