-
Автор темы
- #1
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Wallbang
[POSTS]
100[/POSTS]
Crosshair
[POSTS]
100[/POSTS]
[POSTS]
Код:
bool CanWallbang(float &dmg)
{
DT_CSPlayer *local = EntityList->GetClientEntity(Engine->GetLocalPlayer());
if (!local)
return false;
FireBulletData data = FireBulletData(local->GetEyePosition());
data.filter = CTraceFilter();
data.filter.pSkip = local;
Vector EyeAng;
Engine->GetViewAngles(EyeAng);
Vector dst, forward;
AngleVectors(EyeAng, &forward);
dst = data.src + (forward * 8196.f);
Vector angles;
CalcAngle(data.src, dst, angles);
AngleVectors(angles, &data.direction);
VectorNormalize(data.direction);
CBaseCombatWeapon* weapon = (CBaseCombatWeapon*)EntityList->GetClientEntityFromHandle((HANDLE)local->GetWeaponHandle());
if (!weapon)
return false;
data.penetrate_count = 1;
data.trace_length = 0.0f;
CSWeaponInfo *weaponData = weapon->GetWeaponData();
if (!weaponData)
return false;
data.current_damage = (float)weaponData->m_iDamage;
data.trace_length_remaining = weaponData->m_flRange - data.trace_length;
Vector end = data.src + data.direction * data.trace_length_remaining;
UTIL_TraceLine(data.src, end, MASK_SHOT | CONTENTS_GRATE, local, 0, &data.enter_trace);
if (data.enter_trace.fraction == 1.0f)
return false;
if (HandleBulletPenetration(weaponData, data))
{
dmg = data.current_damage;
return true;
}
return false;
}
Crosshair
[POSTS]
Код:
void DrawAutowallCrosshair()
{
float damage = 0.f;
if (CanWallbang(damage))
{
Draw->Rect(MidX - 2, MidY - 2, 5, 5, Color(0, 255, 0));
RECT text = Draw->GetTextSize(NormalFont, "-%.1f HP", damage);
Draw->Text(MidX - (text.right / 2), MidY - 18, Color(255, 255, 255, 210), NormalFont, "-%.1f HP", damage);
}
else
{
Draw->Rect(MidX - 2, MidY - 2, 5, 5, Color(255, 0, 0));
}
}