private static PlayerHelper GetTarget(CUserCmd *pCmd) { float bestFOV = 420; PlayerHelper bestEntity = new PlayerHelper(IntPtr.Zero); for (int i = 0; i <= 64; i++) { PlayerHelper pEntity = EntityList.GetClientEntity(i); if (!pEntity.IsValid() || !pEntity.IsAlive() || !pEntity.IsEnemy()) { continue; } Vector vecEyePos = pEntity.GetEyePos(); float FOVtoPlayer = SpacialUtils.GetFOV(pCmd->viewangles, SpacialUtils.CalcAngle(Utils.GetLocalPlayer().GetEyePos(), vecEyePos)); if (FOVtoPlayer < bestFOV) { bestFOV = FOVtoPlayer; bestEntity = pEntity; } } return(bestEntity); }
public static void OnCreateMove(CUserCmd *pCmd) { if (!jumped_last_tick && should_fake_jump) { should_fake_jump = false; pCmd->buttons |= IN_JUMP; } else if (((pCmd->buttons & IN_JUMP) != 0) || should_fake_jump) { if (should_fake_jump) { pCmd->buttons |= IN_JUMP; jumped_last_tick = true; should_fake_jump = false; } else if ((Utils.GetLocalPlayer().GetFlags() & EntityFlags.FL_ONGROUND) != 0) { jumped_last_tick = true; should_fake_jump = true; pCmd->buttons |= IN_JUMP; } else { pCmd->buttons &= ~IN_JUMP; jumped_last_tick = false; } } else { jumped_last_tick = false; should_fake_jump = false; } }
public static void OnCreateMove(CUserCmd *pCmd) { QAngle angPunchAngles = Utils.GetLocalPlayer().GetPunchAngles(); angPunchAngles.roll = 0; pCmd->viewangles = pCmd->viewangles.Subtract(angPunchAngles.Multiply(2)); }
public static void OnCreateMove(CUserCmd *pCmd) { if (WinAPI.GetAsyncKeyState(VirtualKeys.LeftButton) && !bShot) { pCmd->buttons |= IN_ATTACK; bShot = true; } else { pCmd->buttons &= ~IN_ATTACK; bShot = false; } }
private unsafe bool CreateMove_Hooked(float smt, int *cmd) // Framework won't let me have an argument of type CUserCmd*. { CUserCmd *pCmd = (CUserCmd *)cmd; // I hate the .NET Framework... if ((pCmd == null) || (pCmd->command_number == 0) || !Utils.GetLocalPlayer().IsValid()) { return(OriginalFunction(smt, cmd)); } InfoSaver.angEyeAngles = pCmd->viewangles; Features.AutoJump.OnCreateMove(pCmd); Features.AutomaticWeapons.OnCreateMove(pCmd); Features.RCS.OnCreateMove(pCmd); Features.Aim.OnCreateMove(pCmd); return(false); }
public static void OnCreateMove(CUserCmd *pCmd) { if ((pCmd->buttons & IN_ATTACK) == 0) { return; } PlayerHelper pEntity = GetTarget(pCmd); if (!pEntity.IsValid()) { return; } QAngle targetAngle = SpacialUtils.CalcAngle(Utils.GetLocalPlayer().GetEyePos(), pEntity.GetEyePos()); targetAngle.Normalize(); pCmd->viewangles = pCmd->viewangles.Add(targetAngle.Subtract(pCmd->viewangles).Divide(2)); pCmd->viewangles.Normalize(); }