void __fastcall Hooks::RunCommand(void* ecx, void* edx, C_BaseEntity* player, CUserCmd* ucmd, IMoveHelper* moveHelper)
{
static auto RunCommand = g_Hooks.pPredictionHook->GetOriginal<RunCommandFn>(19);
if ( player == nullptr || Globals::LocalPlayer == nullptr || !Globals::bCheatActive)
return RunCommand(ecx, player, ucmd, moveHelper);
if (g_pEngine->IsConnected() && g_pEngine->IsInGame()) {
if (player == Globals::LocalPlayer) {
//твой гавнокод
}
else
RunCommand(ecx, player, ucmd, moveHelper);
}
else
RunCommand(ecx, player, ucmd, moveHelper);
}
static void __fastcall RunCommand(void* ecx, void* edx, C_BaseEntity* player, CUserCmd* ucmd, IMoveHelper* moveHelper);
typedef void(__thiscall* RunCommandFn)(void*, C_BaseEntity*, CUserCmd*, IMoveHelper*);
g_Hooks.pPredictionHook->Hook(19, Hooks::RunCommand);
g_Hooks.pPredictionHook = std::make_unique<VMTHook>(g_pPrediction);