Начинающий
-
Автор темы
- #1
i do not get errors with it but the knife doesnt switch to the left hand in game what is wrong witht this code?
[CODE ]
void misc :: KnifeLeft ()
{
static auto left_knife = m_cvar () -> FindVar (crypt_str ("cl_righthand"));
auto local_player = g_ctx.local ();
if (local_player-> is_alive ())
{
left_knife-> SetValue (1);
return;
}
auto weapon = g_ctx.local () -> m_hActiveWeapon (). Get ();
if (! weapon) return;
left_knife-> SetValue (! weapon-> is_knife ());
}
[/ CODE]
[CODE ]
void misc :: KnifeLeft ()
{
static auto left_knife = m_cvar () -> FindVar (crypt_str ("cl_righthand"));
auto local_player = g_ctx.local ();
if (local_player-> is_alive ())
{
left_knife-> SetValue (1);
return;
}
auto weapon = g_ctx.local () -> m_hActiveWeapon (). Get ();
if (! weapon) return;
left_knife-> SetValue (! weapon-> is_knife ());
}
[/ CODE]