private static void OverrideView_BeforeOverrideView(IntPtr pViewSetup) { if ((menu.Children[0] as GUIManager.ToggleMenu).IsToggled()) { var pLocal = C_CSPlayer.GetLocalPlayer(); if (pLocal == null) { return; } if (!pLocal.IsValid()) { return; } if (!pLocal.IsAlive()) { return; } var viewSetup = Marshal.PtrToStructure <CViewSetup>(pViewSetup); viewSetup.angles -= pLocal.AimPunch() * 2 * 0.45f; viewSetup.angles.Clamp(); Marshal.StructureToPtr(viewSetup, pViewSetup, false); } }
private static void CreateMove_AfterCreateMove(ref CUserCmd pCmd) { if ((menu.Children[0] as GUIManager.ToggleMenu).IsToggled()) { var pLocal = C_CSPlayer.GetLocalPlayer(); if (!pLocal.IsAlive()) { return; } var punchAngles = pLocal.AimPunch() * 2; pCmd.viewangles -= punchAngles; } }
private static void CreateMove_BeforeCreateMove(ref CUserCmd cmd) { var pLocal = C_CSPlayer.GetLocalPlayer(); if (((GUIManager.ToggleMenu)menu.Children[1]).IsToggled()) { DoStrafe(ref cmd, pLocal); } if (((GUIManager.ToggleMenu)menu.Children[0]).IsToggled()) { DoBhop(ref cmd, pLocal); } }
private static void OverrideView_AfterOverrideView(IntPtr pViewSetup) { if (CEngineClient.Instance.IsConnected() && CEngineClient.Instance.IsInGame()) { var local = C_CSPlayer.GetLocalPlayer(); if (!local.IsValid() || !local.IsAlive()) { return; } var viewSetup = Marshal.PtrToStructure <CViewSetup>(pViewSetup); currentfov = viewSetup.fov; } }
private static unsafe void OverrideMouseInput_OnOverrideMouseInput(float *x, float *y) { if (!active.IsToggled()) { return; } if (!hotkey.IsToggled()) { return; } var local = C_CSPlayer.GetLocalPlayer(); if (!local.IsValid() || !local.IsAlive()) { return; } var weapon = local.GetActiveWeapon(); if (!weapon.IsValid() || weapon.IsC4() || weapon.IsKnife() || weapon.IsGrenade()) { return; } var target = GetClosestPlayer(local); if (target.IsValid() && utils.TraceBone(local, target, Bones.HEAD_0)) { var delta = GetDelta(local, target, Bones.HEAD_0); delta.X /= smooth.GetValue(); delta.Y /= smooth.GetValue(); var finalDelta = new Vector3(delta.Y, -delta.X, 0); finalDelta.X = (finalDelta.X + *x) / 2.0f; finalDelta.Y = (finalDelta.Y + *y) / 2.0f; *x = finalDelta.X; *y = finalDelta.Y; } }
private static void PaintTraverse_AfterPaintTraverse(IntPtr pPanel, uint vguiPanel) { if (!active.IsToggled()) { return; } if (CEngineClient.Instance.IsConnected() && CEngineClient.Instance.IsInGame()) { var local = C_CSPlayer.GetLocalPlayer(); if (!local.IsValid() || !local.IsAlive()) { return; } int width = 0, height = 0; CEngineClient.Instance.GetScreenSize(ref width, ref height); float radius = (float)(Math.Tan(utils.DEG2RAD(fov.GetValue()) / 2) / Math.Tan(utils.DEG2RAD(currentfov) / 2) * width); Drawing.DrawCircle(new Vector2(width / 2, height / 2), 20, radius, new Color(0, 0, 255, 150)); } }
private static void CreateMove_BeforeCreateMove(ref CUserCmd pCmd) { if (!(menu.Children[0] as GUIManager.ToggleMenu).IsToggled()) { return; } if (!hotkey.IsToggled()) { return; } var pLocal = C_CSPlayer.GetLocalPlayer(); if (pLocal.IsValid() && pLocal.IsAlive()) { var weapon = pLocal.GetActiveWeapon(); if (!weapon.IsValid() || weapon.IsC4() || weapon.IsKnife() || weapon.IsGrenade()) { return; } var vTraceForward = new Vector3(); var vTraceAngles = pCmd.viewangles; global::HepajSharp.Utils.Utils.AngleVectors(vTraceAngles, ref vTraceForward); var vTraceStart = C_CSPlayer.GetLocalPlayer().GetEyePos(); var vTraceEnd = vTraceStart + vTraceForward * 8192.0f; var trace = Helper.TraceRay(vTraceStart, vTraceEnd, pLocal.m_BaseAddress, (int)(Definitions.MASKS.MASK_SHOT_HULL | Definitions.MASKS.CONTENTS_HITBOX)); if (trace.fraction != 1.0f && trace.m_pEnt != IntPtr.Zero) { if (!throughSmoke.IsToggled() && global::HepajSharp.Utils.Utils.LineThroughSmoke(vTraceStart, vTraceEnd)) { return; } var target = new C_CSPlayer(trace.m_pEnt); if (target.IsValid() && target.GetClassID() == Definitions.EClassIds.CCSPlayer && target.IsAlive() /* && target.GetHealth() > 0*/ && target.IsEnemy()) //GetHealth kell ha nem ellenőrzünk ClassID-t { if (autopistol.IsToggled()) { if (weapon.IsPistol()) { if (!weapon.CanFire()) { pCmd.buttons &= ~Definitions.IN_ATTACK; } else { pCmd.buttons |= Definitions.IN_ATTACK; } } else { pCmd.buttons |= Definitions.IN_ATTACK; } } else { pCmd.buttons |= Definitions.IN_ATTACK; } } } } }