void CMiscHacks::PerfectStrafe(CUserCmd *pCmd)
{
IClientEntity* pLocal = hackManager.pLocal();
bool bKeysPressed = true;
if (GUI.GetKeyState(0x41) || GUI.GetKeyState(0x57) || GUI.GetKeyState(0x53) || GUI.GetKeyState(0x44)) bKeysPressed = false;
if ((GetAsyncKeyState(VK_SPACE) && !(pLocal->GetFlags() & FL_ONGROUND)) && bKeysPressed)
{
if (pCmd->mousedx > 1 || pCmd->mousedx < -1) {
pCmd->sidemove = pCmd->mousedx < 0.f ? -450.f : 450.f;
}
else {
pCmd->forwardmove = (1800.f * 4.f) / pLocal->GetVelocity().Length2D();
pCmd->sidemove = (pCmd->command_number % 2) == 0 ? -450.f : 450.f;
if (pCmd->forwardmove > 450.f)
pCmd->forwardmove = 450.f;
}
}
}
void CMiscHacks::RageStrafe(CUserCmd *pCmd)
{
IClientEntity* pLocal = hackManager.pLocal();
bool bKeysPressed = true;
if (GUI.GetKeyState(0x41) || GUI.GetKeyState(0x57) || GUI.GetKeyState(0x53) || GUI.GetKeyState(0x44)) bKeysPressed = false;
if ((GetAsyncKeyState(VK_SPACE) && !(pLocal->GetFlags() & FL_ONGROUND)) && bKeysPressed)
{
if (pCmd->mousedx > 1 || pCmd->mousedx < -1) {
pCmd->sidemove = pCmd->mousedx < 0.f ? -450.f : 450.f;
}
else {
pCmd->upmove = 250.f;// for testing
pCmd->forwardmove = (10000.f) / pLocal->GetVelocity().Length2D();
pCmd->sidemove = (pCmd->command_number % 2) == 0 ? -450.f : 450.f;
}
}
}