What's new

Welcome to HvH Forum!

SignUp Now! Download Free HvH CS2/CS:GO Cheats, CFG, LUA/JS Scripts, And More!


SignUp Now!

Request Autopeek src

Sal

Rookie HvHer
User ID
22847
Messages
92
Reactions
15
Level
14
Does someone have an autopeek that doesnt reverse player input? if yes, please share it.
 
Rookie HvHer
User ID
17369
Messages
36
Reactions
21
Level
5
movement.cpp:
void Movement::AutoPeek(CUserCmd* cmd, float wish_yaw) {
    if (g_input.GetKeyState(g_menu.main.aimbot.autopeek.get())) {
        if (start_position.IsZero()) {
            start_position = g_cl.m_local->GetAbsOrigin();

            if (!(g_cl.m_flags & FL_ONGROUND)) {
                CTraceFilterWorldOnly filter;
                CGameTrace trace;

                g_csgo.m_engine_trace->TraceRay(Ray(start_position, start_position - vec3_t(0.0f, 0.0f, 1000.0f)), MASK_SOLID, &filter, &trace);

                if (trace.m_fraction < 1.0f)
                    start_position = trace.m_endpos + vec3_t(0.0f, 0.0f, 2.0f);
            }
        }
        else {
            bool revolver_shoot = g_cl.m_weapon_id == REVOLVER && !g_cl.m_revolver_fire && (cmd->m_buttons & IN_ATTACK || cmd->m_buttons & IN_ATTACK2);

            if (g_cl.m_old_shot)
                fired_shot = true;

            if (fired_shot) {
                vec3_t current_position = g_cl.m_local->GetAbsOrigin();
                vec3_t difference = current_position - start_position;

                if (difference.length_2d() > 5.0f && difference.length_2d() < 300.0f) {
                    vec3_t velocity = vec3_t(difference.x * cos(wish_yaw / 180.0f * math::pi) + difference.y * sin(wish_yaw / 180.0f * math::pi), difference.y * cos(wish_yaw / 180.0f * math::pi) - difference.x * sin(wish_yaw / 180.0f * math::pi), difference.z);

                    if (difference.length_2d() < 50.0f) {
                        cmd->m_forward_move = -velocity.x * 20.0f;
                        cmd->m_side_move = velocity.y * 20.0f;
                    }
                    else if (difference.length_2d() < 100.0f) {
                        cmd->m_forward_move = -velocity.x * 10.0f;
                        cmd->m_side_move = velocity.y * 10.0f;
                    }
                    else if (difference.length_2d() < 150.0f) {
                        cmd->m_forward_move = -velocity.x * 5.0f;
                        cmd->m_side_move = velocity.y * 5.0f;
                    }
                    else if (difference.length_2d() < 250.0f) {
                        cmd->m_forward_move = -velocity.x * 2.0f;
                        cmd->m_side_move = velocity.y * 2.0f;
                    }
                    else {
                        cmd->m_forward_move = -velocity.x * 1.0f;
                        cmd->m_side_move = velocity.y * 1.0f;
                    }
                }
                else {
                    fired_shot = false;
                    start_position.clear();
                }
            }
        }
    }
    else {
        fired_shot = false;
        start_position.clear();
    }
}

vector3.h:
__forceinline bool  IsZero(float tolerance = 0.01f) const
    {
        return (this->x > -tolerance && this->x < tolerance&&
            this->y > -tolerance && this->y < tolerance&&
            this->z > -tolerance && this->z < tolerance);
    }

movement.h:
    void AutoPeek(CUserCmd* cmd, float wish_yaw);

    bool fired_shot;
    vec3_t start_position = vec3_t(0.0f, 0.0f, 0.0f);
 

Sal

Rookie HvHer
User ID
22847
Messages
92
Reactions
15
Level
14
movement.cpp:
void Movement::AutoPeek(CUserCmd* cmd, float wish_yaw) {
    if (g_input.GetKeyState(g_menu.main.aimbot.autopeek.get())) {
        if (start_position.IsZero()) {
            start_position = g_cl.m_local->GetAbsOrigin();

            if (!(g_cl.m_flags & FL_ONGROUND)) {
                CTraceFilterWorldOnly filter;
                CGameTrace trace;

                g_csgo.m_engine_trace->TraceRay(Ray(start_position, start_position - vec3_t(0.0f, 0.0f, 1000.0f)), MASK_SOLID, &filter, &trace);

                if (trace.m_fraction < 1.0f)
                    start_position = trace.m_endpos + vec3_t(0.0f, 0.0f, 2.0f);
            }
        }
        else {
            bool revolver_shoot = g_cl.m_weapon_id == REVOLVER && !g_cl.m_revolver_fire && (cmd->m_buttons & IN_ATTACK || cmd->m_buttons & IN_ATTACK2);

            if (g_cl.m_old_shot)
                fired_shot = true;

            if (fired_shot) {
                vec3_t current_position = g_cl.m_local->GetAbsOrigin();
                vec3_t difference = current_position - start_position;

                if (difference.length_2d() > 5.0f && difference.length_2d() < 300.0f) {
                    vec3_t velocity = vec3_t(difference.x * cos(wish_yaw / 180.0f * math::pi) + difference.y * sin(wish_yaw / 180.0f * math::pi), difference.y * cos(wish_yaw / 180.0f * math::pi) - difference.x * sin(wish_yaw / 180.0f * math::pi), difference.z);

                    if (difference.length_2d() < 50.0f) {
                        cmd->m_forward_move = -velocity.x * 20.0f;
                        cmd->m_side_move = velocity.y * 20.0f;
                    }
                    else if (difference.length_2d() < 100.0f) {
                        cmd->m_forward_move = -velocity.x * 10.0f;
                        cmd->m_side_move = velocity.y * 10.0f;
                    }
                    else if (difference.length_2d() < 150.0f) {
                        cmd->m_forward_move = -velocity.x * 5.0f;
                        cmd->m_side_move = velocity.y * 5.0f;
                    }
                    else if (difference.length_2d() < 250.0f) {
                        cmd->m_forward_move = -velocity.x * 2.0f;
                        cmd->m_side_move = velocity.y * 2.0f;
                    }
                    else {
                        cmd->m_forward_move = -velocity.x * 1.0f;
                        cmd->m_side_move = velocity.y * 1.0f;
                    }
                }
                else {
                    fired_shot = false;
                    start_position.clear();
                }
            }
        }
    }
    else {
        fired_shot = false;
        start_position.clear();
    }
}

vector3.h:
__forceinline bool  IsZero(float tolerance = 0.01f) const
    {
        return (this->x > -tolerance && this->x < tolerance&&
            this->y > -tolerance && this->y < tolerance&&
            this->z > -tolerance && this->z < tolerance);
    }

movement.h:
    void AutoPeek(CUserCmd* cmd, float wish_yaw);

    bool fired_shot;
    vec3_t start_position = vec3_t(0.0f, 0.0f, 0.0f);
courvix does this have an circle?
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Similar threads

0
Replies
472
Views
2
Replies
470
Views
  • Question
0
Replies
215
Views
Top