Пользователь
-
Автор темы
- #1
Onetap taser and knife range.
C++:
void Visuals::TaserRange()
{
CBaseCombatWeapon* pWeapon = g_LocalPlayer->m_hActiveWeapon().Get();
if (pWeapon && (pWeapon->IsKnife() || pWeapon->m_iItemDefinitionIndex() == WEAPON_TASER))
{
Vector pRenderOrigin = ZERO;
float flRadius = 0.0
if (g_pInput->m_fCameraInThirdPerson)
pRenderOrigin = g_LocalPlayer->m_vecOrigin() + g_LocalPlayer->m_vecViewOffset();
else
pRenderOrigin = g_pGlobals.View.Origin; // set in hkOverrideView
if (pWeapon->m_iItemDefinitionIndex() == WEAPON_TASER)
flRadius = 150.0;
else
flRadius = 64.0;
DrawManager::Get().DrawCircle(flRadius, pRenderOrigin, g_LocalPlayer);
}
}
C++:
void __stdcall hkOverrideView(CViewSetup* viewsetup)
{
// overrideview start
oOverrideView(viewsetup);
g_pGlobals.View.Origin = viewsetup->origin;
// overrideview end
}