designer1337 / csgo-cheat-base

simple csgo internal base.
MIT License
245 stars 48 forks source link

Adding simple aimbot #63

Open danyrusdem opened 4 years ago

danyrusdem commented 4 years ago

#include "../features.hpp"
//create aimbot.cpp
int aim_bone[] = { 8, 7 , 6 };

player_t* legitbot::GetBestTarget(c_usercmd* cmd)
{
    float ofov = variables::aimbot_fov;
    float nfov = 0;
    player_t* player = nullptr;

    for (int iPlayer = 0; iPlayer < interfaces::globals->max_clients; iPlayer++)
    {
        auto pCSPlayer = reinterpret_cast<player_t*>(interfaces::entity_list->get_client_entity(iPlayer));
        if (!pCSPlayer)
            continue;
        if (pCSPlayer == csgo::local_player || pCSPlayer->team() == csgo::local_player->team())
            continue;
        if (pCSPlayer->dormant())
            continue;
        if (!(pCSPlayer->is_alive() && pCSPlayer->health() > 0))
            continue;
        if (pCSPlayer->has_gun_game_immunity())
            continue;
        vec3_t eyepos = csgo::local_player->get_eye_pos();
        vec3_t enemyheadpos = pCSPlayer->get_bone_position(8);
        vec3_t angleTo = math::calculate_angle(eyepos, enemyheadpos);
        angleTo.clamp();
        nfov = cmd->viewangles.distance_to(angleTo);

        if (nfov < ofov)
        {
            ofov = nfov;
            player = pCSPlayer;
        }
    }
    return player;
}
void legitbot::simple_rcs(c_usercmd* cmd, vec3_t& angles)
{
    static vec3_t old_punch{ 0, 0, 0 };
    auto scale = interfaces::console->get_convar("weapon_recoil_scale");
    auto punch = csgo::local_player->aim_punch_angle() * 2;

    punch.x *= variables::rcs_x;
    punch.y *= variables::rcs_y;

    auto rcs_angle = cmd->viewangles += (old_punch - punch);
    interfaces::engine->set_view_angles(rcs_angle);

    old_punch = punch;
}
void legitbot::aimbot(c_usercmd* cmd)
{
    if (!variables::aimbot)
        return;
    if (!interfaces::engine->is_connected() || !interfaces::engine->is_in_game())
        return;
    if (!csgo::local_player)
        return;
    if (!csgo::local_player->is_alive())
        return;

    const auto weapon_type = csgo::local_player->active_weapon()->get_weapon_data()->weapon_type;

    if (weapon_type == WEAPONTYPE_GRENADE || weapon_type == WEAPONTYPE_C4 || weapon_type == WEAPONTYPE_KNIFE)
        return;

    if (variables::simple_rcs)
    {
        simple_rcs(cmd, cmd->viewangles);
    }

    player_t* target = GetBestTarget(cmd);
    auto weapon = csgo::local_player->active_weapon();
    if(GetAsyncKeyState(VK_LBUTTON))
    { 
        if (target)
        {
         //   int bone = 0;
         //   bone = aim_bone[variables::bone];
            vec3_t eyepos = csgo::local_player->get_eye_pos();
            vec3_t targethead = target->get_bone_position(8);
          //  vec3_t targetbone = target->get_bone_position(bone);
            vec3_t viewangles = math::calculate_angle(eyepos, targethead);
            viewangles.clamp();
            vec3_t delta = cmd->viewangles - viewangles;
            delta.clamp();

            vec3_t finalAng = cmd->viewangles - delta / (variables::aimbot_smoothing * 20);
            finalAng.clamp();

            if (variables::aimbot_isvisiblecheck && csgo::local_player->can_see_player_pos(target, target->get_eye_pos()))
            {
                cmd->viewangles = finalAng;
                interfaces::engine->set_view_angles(cmd->viewangles);
            }
            else if (!variables::aimbot_isvisiblecheck)
            {
                cmd->viewangles = finalAng;
                interfaces::engine->set_view_angles(cmd->viewangles);
            }
        }
    }
}
``
``
//make aimbot header or paste in features.hpp
namespace legitbot
{
    player_t* GetBestTarget(c_usercmd* cmd);
    void aimbot(c_usercmd* cmd);
    void simple_rcs(c_usercmd* cmd, vec3_t& angles);
    inline int hitbox_id;
}
``
//call it in createmove hook,after prediction.
legitbot::aimbot(cmd);
``
danyrusdem commented 4 years ago

plz make it enhancement

danyrusdem commented 4 years ago
//add in variables.hpp
inline bool aimbot = false;
    inline float aimbot_fov = 0.f;

    inline float rcs_x;
    inline float rcs_y;
    inline float aimbot_smoothing = 2.f;

    inline int bone;

    inline bool aimbot_isvisiblecheck = true;
    inline bool simple_rcs = true;
danyrusdem commented 4 years ago
//menu.cpp in aim tab
menu_framework::check_box(variables::menu::x + 120, variables::menu::y + 45, variables::menu::x + 375, render::fonts::watermark_font, "aimbot enable", variables::aimbot);
            menu_framework::slider(variables::menu::x + 120, variables::menu::y + 60, 125, render::fonts::watermark_font, "fov", variables::aimbot_fov, 0.f, 10.f);
            menu_framework::slider(variables::menu::x + 120, variables::menu::y + 75, 125, render::fonts::watermark_font, "smooth", variables::aimbot_smoothing, 1.f, 5.f);
            menu_framework::check_box(variables::menu::x + 120, variables::menu::y + 90, variables::menu::x + 375, render::fonts::watermark_font, "rcs", variables::simple_rcs);
            menu_framework::slider(variables::menu::x + 120, variables::menu::y + 105, 125, render::fonts::watermark_font, "rcs x", variables::rcs_x, 1.f, 3.f);
            menu_framework::slider(variables::menu::x + 120, variables::menu::y + 120, 125, render::fonts::watermark_font, "rcs y", variables::rcs_y, 1.f, 3.f);
            menu_framework::check_box(variables::menu::x + 120, variables::menu::y + 135, variables::menu::x + 375, render::fonts::watermark_font, "visible only", variables::aimbot_isvisiblecheck);
jon4dev commented 4 years ago

Pasted from cleminternal/overflow and some other shit this is dont needed.

danyrusdem commented 4 years ago

Menu shit add in menu.cpp

пн, 10 авг. 2020 г., 19:05 vibingdir notifications@github.com:

need some help! the post code, what tab would it be put in? hooks.cpp, main.cpp, or a new tab that i would create?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/designer1337/csgo-cheat-base/issues/63#issuecomment-671444567, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF7NEASWY2ZDUYGWNFWX7NTSAALDNANCNFSM4OWQVQHQ .

danyrusdem commented 4 years ago

In this base you already have aimbot tab.In hooks.cpp you need to call your aimbot in createmove hook.

пн, 10 авг. 2020 г., 22:34 Даниил Демченко danyrusdem@gmail.com:

Menu shit add in menu.cpp

пн, 10 авг. 2020 г., 19:05 vibingdir notifications@github.com:

need some help! the post code, what tab would it be put in? hooks.cpp, main.cpp, or a new tab that i would create?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/designer1337/csgo-cheat-base/issues/63#issuecomment-671444567, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF7NEASWY2ZDUYGWNFWX7NTSAALDNANCNFSM4OWQVQHQ .

vibingdir commented 4 years ago

NN question, how do i "call" it, exactly?

On Mon, Aug 10, 2020 at 3:37 PM danyrusdem notifications@github.com wrote:

In this base you already have aimbot tab.In hooks.cpp you need to call your aimbot in createmove hook.

пн, 10 авг. 2020 г., 22:34 Даниил Демченко danyrusdem@gmail.com:

Menu shit add in menu.cpp

пн, 10 авг. 2020 г., 19:05 vibingdir notifications@github.com:

need some help! the post code, what tab would it be put in? hooks.cpp, main.cpp, or a new tab that i would create?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub < https://github.com/designer1337/csgo-cheat-base/issues/63#issuecomment-671444567 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AF7NEASWY2ZDUYGWNFWX7NTSAALDNANCNFSM4OWQVQHQ

.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/designer1337/csgo-cheat-base/issues/63#issuecomment-671548477, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQFLP3KIUXLP2BFCE4T5LULSABEATANCNFSM4OWQVQHQ .

danyrusdem commented 4 years ago

//call it in createmove hook,after prediction. legitbot::aimbot(cmd);

I'm not at home,but you can dm me on:Danyrusdem#4434

пн, 10 авг. 2020 г., 22:40 vibingdir notifications@github.com:

NN question, how do i "call" it, exactly?

On Mon, Aug 10, 2020 at 3:37 PM danyrusdem notifications@github.com wrote:

In this base you already have aimbot tab.In hooks.cpp you need to call your aimbot in createmove hook.

пн, 10 авг. 2020 г., 22:34 Даниил Демченко danyrusdem@gmail.com:

Menu shit add in menu.cpp

пн, 10 авг. 2020 г., 19:05 vibingdir notifications@github.com:

need some help! the post code, what tab would it be put in? hooks.cpp, main.cpp, or a new tab that i would create?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <

https://github.com/designer1337/csgo-cheat-base/issues/63#issuecomment-671444567

,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AF7NEASWY2ZDUYGWNFWX7NTSAALDNANCNFSM4OWQVQHQ

.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub < https://github.com/designer1337/csgo-cheat-base/issues/63#issuecomment-671548477 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AQFLP3KIUXLP2BFCE4T5LULSABEATANCNFSM4OWQVQHQ

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/designer1337/csgo-cheat-base/issues/63#issuecomment-671549808, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF7NEARK4D72ZU42MGYTN3DSABEMVANCNFSM4OWQVQHQ .

vibingdir commented 4 years ago

Sent, I’m “ten$cent#9662”

On Mon, Aug 10, 2020 at 3:44 PM danyrusdem notifications@github.com wrote:

//call it in createmove hook,after prediction. legitbot::aimbot(cmd);

I'm not at home,but you can dm me on:Danyrusdem#4434

пн, 10 авг. 2020 г., 22:40 vibingdir notifications@github.com:

NN question, how do i "call" it, exactly?

On Mon, Aug 10, 2020 at 3:37 PM danyrusdem notifications@github.com wrote:

In this base you already have aimbot tab.In hooks.cpp you need to call your aimbot in createmove hook.

пн, 10 авг. 2020 г., 22:34 Даниил Демченко danyrusdem@gmail.com:

Menu shit add in menu.cpp

пн, 10 авг. 2020 г., 19:05 vibingdir notifications@github.com:

need some help! the post code, what tab would it be put in? hooks.cpp, main.cpp, or a new tab that i would create?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <

https://github.com/designer1337/csgo-cheat-base/issues/63#issuecomment-671444567

,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AF7NEASWY2ZDUYGWNFWX7NTSAALDNANCNFSM4OWQVQHQ

.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub <

https://github.com/designer1337/csgo-cheat-base/issues/63#issuecomment-671548477

, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AQFLP3KIUXLP2BFCE4T5LULSABEATANCNFSM4OWQVQHQ

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub < https://github.com/designer1337/csgo-cheat-base/issues/63#issuecomment-671549808 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AF7NEARK4D72ZU42MGYTN3DSABEMVANCNFSM4OWQVQHQ

.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/designer1337/csgo-cheat-base/issues/63#issuecomment-671551276, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQFLP3NDSEW2EDOQR7M5QFDSABEZTANCNFSM4OWQVQHQ .

gr1ndy commented 3 years ago

'pCSPlayer': undeclared identifier

how do I fix?


nvm