bool CS_FASTCALL H::CreateMove(CCSGOInput* pInput, int nSlot, bool bActive)
{
const auto oCreateMove = hkCreateMove.GetOriginal();
const bool bResult = oCreateMove(pInput, nSlot, bActive);
//Get local controller from local player
SDK::LocalController = CCSPlayerController::GetLocalPlayerController();
//Checks
if (SDK::LocalController == nullptr)
{
std::cout << "Failed to get CMD from controller" << std::endl;
return bResult;
}
//Get local player pawn from local controller
SDK::LocalPawn = I::GameResourceService->pGameEntitySystem->Get<C_CSPlayerPawn>(SDK::LocalController->GetPawnHandle());
//Checks
if (SDK::LocalPawn == nullptr)
{
std::cout << "Failed to get pawn from controller" << std::endl;
return bResult;
}
//Health
int32_t health = SDK::LocalController->GetPawnHealth();
//Checks
if (!health)
{
std::cout << "Failed to get health from controller" << std::endl;
return bResult;
}
//Getting cmd from local controller
SDK::Cmd = CUserCmd::Get();
//Checks
if (SDK::Cmd == nullptr)
{
std::cout << "Failed to get CMD from controller" << std::endl;
return bResult;
}
//Get Base User Cmd from Cmd
CBaseUserCmdPB* pUserBaseCmd = nullptr;
pUserBaseCmd = SDK::Cmd->csgoUserCmd.pBaseCmd;
//Checks
if (pUserBaseCmd == nullptr)
{
std::cout << "Failed to get BASE CMD from cmd" << std::endl;
return bResult;
}
if (SDK::Cmd->nButtons.nValue & IN_JUMP && SDK::LocalPawn->GetFlags() & FL_ONGROUND)
{
std::cout << "Before: " << pUserBaseCmd->pInButtonState->nValue << std::endl;
SDK::Cmd->nButtons.nValue &= ~IN_JUMP;
}
return bResult;
}