Вопрос Left hand knife not working what is wrong? (lw)

Начинающий
Статус
Оффлайн
Регистрация
28 Авг 2019
Сообщения
120
Реакции[?]
8
Поинты[?]
0
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]
 
Начинающий
Статус
Оффлайн
Регистрация
25 Апр 2019
Сообщения
12
Реакции[?]
1
Поинты[?]
0
C++:
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() ? 1 : 0);
}
 
Начинающий
Статус
Оффлайн
Регистрация
28 Авг 2019
Сообщения
120
Реакции[?]
8
Поинты[?]
0
[QUOTE = "nikita2282271339, post: 2023450, member: 183860"]
[CODE = cpp] 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 ()? 1: 0);
} [/ CODE]
[/ QUOTE]
doesnt help still the same problem
 
Сверху Снизу