diff --git a/src/backend/command.hpp b/src/backend/command.hpp index 2277cb01..111b6b16 100644 --- a/src/backend/command.hpp +++ b/src/backend/command.hpp @@ -21,6 +21,7 @@ namespace big public: command(const std::string& name, const std::string& label, const std::string& description, std::optional num_args, bool fiber_pool = true); + inline const std::string& get_name() { return m_name; } inline const std::string& get_label() { return m_label; } inline const std::string& get_description() { return m_description; } diff --git a/src/backend/looped/weapons/aimbot.cpp b/src/backend/looped/weapons/aimbot.cpp new file mode 100644 index 00000000..7da0ee2d --- /dev/null +++ b/src/backend/looped/weapons/aimbot.cpp @@ -0,0 +1,132 @@ +#include "gta/enums.hpp" +#include "natives.hpp" +#include "backend/looped_command.hpp" +#include "util/entity.hpp" + +namespace big +{ + class aimbot : looped_command + { + using looped_command::looped_command; + + Vector3 aim_lock; + Vector2 mouse_movement; + + virtual void on_tick() override + { + float local_fov_change = g.weapons.aimbot.fov; + for (auto ped : entity::get_entities(false, true)) + { + if (ENTITY::HAS_ENTITY_CLEAR_LOS_TO_ENTITY(self::ped, ped, 17) && !ENTITY::IS_ENTITY_DEAD(ped, 0)) // Tracetype is always 17. LOS check + { + int relation = PED::GET_RELATIONSHIP_BETWEEN_PEDS(ped, self::ped); // relation for enemy check + int type = PED::GET_PED_TYPE(ped); // for police check, cop types are 6, swat is 27 + Vector3 world_position = ENTITY::GET_ENTITY_COORDS(ped, false); + + if (SYSTEM::VDIST(self::pos.x, self::pos.y, self::pos.z, world_position.x, world_position.y, world_position.z) > g.weapons.aimbot.distance) + continue; // If the entity is further than our preset distance then just skip it + + if (PED::IS_PED_A_PLAYER(ped) && g.weapons.aimbot.on_player) // check if its a player + { + goto aimbot_handler; + } + else if (((relation == 4) || (relation == 5)) && g.weapons.aimbot.on_enemy) // relation 4 and 5 are for enemies + { + goto aimbot_handler; + } + else if (((type == 6 && !PED::IS_PED_MODEL(ped, rage::joaat("s_m_y_uscg_01"))) || type == 27 || // s_m_y_uscg_01 = us coast guard 1 (techniaclly military) + PED::IS_PED_MODEL(ped, rage::joaat("s_m_y_ranger_01")) || PED::IS_PED_MODEL(ped, rage::joaat("s_f_y_ranger_01"))) // ranger models + && g.weapons.aimbot.on_police) + { + goto aimbot_handler; + } + else if (g.weapons.aimbot.on_npc && !PED::IS_PED_A_PLAYER(ped)) + + // Update aim lock coords + aimbot_handler: + { // Jump to here to handle instead of continue statements + aim_lock = ENTITY::GET_WORLD_POSITION_OF_ENTITY_BONE(ped, PED::GET_PED_BONE_INDEX(ped, g.weapons.aimbot.selected_bone)); + if ((aim_lock.x != 0) && (aim_lock.y != 0) && (aim_lock.z != 0)) // Ensure none of the coords are = to 0 + { + Vector2 screen_dim, movement; + GRAPHICS::GET_SCREEN_COORD_FROM_WORLD_COORD(aim_lock.x, aim_lock.y, aim_lock.z, &screen_dim.x, &screen_dim.y); + if ((screen_dim.x >= 0) && (screen_dim.y >= 0)) // Make sure updated screen dim is greater than 0 + { + auto& io = ImGui::GetIO(); + ImVec2 center(io.DisplaySize.x / 2.f, io.DisplaySize.y / 2.f); // Use ImGui to get the display size + //Screen dim is a float between 0-1, multiply the float by screen coords + screen_dim.x *= io.DisplaySize.x; + screen_dim.y *= io.DisplaySize.y; + + if (screen_dim.x > center.x) //If the location is greater than the center (right side) + { // Get the amount of distance we need to move, so center of the screen - our location + movement.x = -(center.x - screen_dim.x); + if (movement.x + center.x > center.x * 2) movement.x = 0; + } + else + { // if the location is on the left side + movement.x = screen_dim.x - center.x; + if (movement.x + center.x < 0) movement.x = 0; + } + + // Same thing here but for y, so switch right with up and left with down + if (screen_dim.y > center.y) + { + movement.y = -(center.y - screen_dim.y); + if (movement.y + center.y > center.y * 2) movement.x = 0; + } + else + { + movement.y = screen_dim.y - center.y; + if (movement.y + center.y < 0) movement.y = 0; + } + + if (sqrt(pow(movement.x, 2) + pow(movement.y, 2)) < local_fov_change) + { // sqrt of movment x and y ^ 2, handles fov math + local_fov_change = sqrt(pow(movement.x, 2) + pow(movement.y, 2)); + mouse_movement.x = movement.x; + mouse_movement.y = movement.y; + } + + } + } + } + } + } + + if (PAD::GET_DISABLED_CONTROL_NORMAL(0, (int)ControllerInputs::INPUT_AIM)) + { + static bool update_time_now = true; static std::chrono::system_clock::time_point current_time; + + if (update_time_now) + { + current_time = std::chrono::system_clock::now(); + update_time_now = false; //lockout + } + + std::chrono::duration elapsed_time = std::chrono::system_clock::now() - current_time; + if (elapsed_time.count() > 0.f) + { + INPUT mouse_handle; // MOUSEINPUT mi; + mouse_handle.type = INPUT_MOUSE; mouse_handle.mi.dwFlags = MOUSEEVENTF_MOVE; // Type = Mouse movement, and the event is emulating the mouse movement + + // Update the mouse by moving it with how much we need / smoothing speed + mouse_handle.mi.dx = mouse_movement.x / (g.weapons.aimbot.smoothing ? g.weapons.aimbot.smoothing_speed : 2); + mouse_handle.mi.dy = mouse_movement.y / (g.weapons.aimbot.smoothing ? g.weapons.aimbot.smoothing_speed : 2); + SendInput(1, &mouse_handle, sizeof(mouse_handle)); //handles the input + + //Reset our variables + mouse_movement.x = 0, mouse_movement.y = 0; + update_time_now = true; //reset our time + } + } + } + }; + + aimbot g_aimbot("aimbot", "Aimbot", "lock on and kill", g.weapons.aimbot.enable); + bool_command g_smoothing("smoothing", "Smoothing", "Controls the snappiness of your lock on", g.weapons.aimbot.smoothing); + bool_command g_aimbot_on_player("aimatplayer", "Player", "If you suck at pvp this is for you.", g.weapons.aimbot.on_player); + bool_command g_aimbot_on_npc("aimatnpc", "NPC", "Generally kills normal NPCs", g.weapons.aimbot.on_npc); + bool_command g_aimbot_on_police("aimatpolice", "Police", "Locks onto cops to kill", g.weapons.aimbot.on_police); + bool_command g_aimbot_on_enemy("aimatenemy", "Enemy", "Eliminate your enemies, and win your missions", g.weapons.aimbot.on_enemy); +} diff --git a/src/backend/looped/weapons/triggerbot.cpp b/src/backend/looped/weapons/triggerbot.cpp new file mode 100644 index 00000000..ae9e6f8b --- /dev/null +++ b/src/backend/looped/weapons/triggerbot.cpp @@ -0,0 +1,29 @@ +#include "gta/enums.hpp" +#include "natives.hpp" +#include "backend/looped_command.hpp" +#include "util/entity.hpp" + +namespace big +{ + class triggerbot : looped_command + { + using looped_command::looped_command; + + virtual void on_tick() override + { + Entity crosshair_catch; + if (PAD::IS_DISABLED_CONTROL_PRESSED(0, (int)ControllerInputs::INPUT_AIM)) + { + if (entity::raycast(&crosshair_catch)) + { + if (ENTITY::IS_ENTITY_A_PED(crosshair_catch) && !ENTITY::IS_ENTITY_DEAD(crosshair_catch, 0)) { + Vector3 coords = ENTITY::GET_ENTITY_COORDS(crosshair_catch, 1); + PED::SET_PED_SHOOTS_AT_COORD(self::ped, coords.x, coords.y, coords.z, true); + } // Add check for vehicles, currently only shoots peds not in vehicles + } + } + } + }; + + triggerbot g_triggerbot("triggerbot", "Triggerbot", "Shoots at a ped with fast ease", g.weapons.triggerbot); +} diff --git a/src/backend/looped/world/blackhole.cpp b/src/backend/looped/world/blackhole.cpp index eab641c7..5f660382 100644 --- a/src/backend/looped/world/blackhole.cpp +++ b/src/backend/looped/world/blackhole.cpp @@ -3,6 +3,7 @@ #include "pointers.hpp" #include "util/vehicle.hpp" #include "util/mobile.hpp" +#include "util/entity.hpp" #include "gta_util.hpp" namespace big @@ -12,58 +13,10 @@ namespace big { using looped_command::looped_command; - std::vector target_entities; - - void get_entities() - { - const auto replay_interface = *g_pointers->m_replay_interface; - if(!replay_interface) - return; - - if (g.world.blackhole.include_vehicles) - { - const auto vehicle_interface = replay_interface->m_vehicle_interface; - for (int i = 0; i < vehicle_interface->m_max_vehicles; i++) - { - const auto vehicle_ptr = vehicle_interface->get_vehicle(i); - if (!vehicle_ptr) - continue; - - const auto veh = g_pointers->m_ptr_to_handle(vehicle_ptr); - if (!veh) - break; - - target_entities.push_back(veh); - } - } - - if (g.world.blackhole.include_peds) - { - const auto ped_interface = replay_interface->m_ped_interface; - for (int i = 0; i < ped_interface->m_max_peds; i++) - { - const auto ped_ptr = ped_interface->get_ped(i); - if (!ped_ptr) - continue; - - //make sure to don't include ourselves - if (ped_ptr == gta_util::get_local_ped()) - continue; - - const auto ped = g_pointers->m_ptr_to_handle(ped_ptr); - if (!ped) - break; - - target_entities.push_back(ped); - } - } - } - virtual void on_tick() override { - get_entities(); - for (auto entity : target_entities) + for (auto entity : entity::get_entities(g.world.blackhole.include_vehicles, g.world.blackhole.include_peds)) { if (entity::take_control_of(entity, 0)) { @@ -75,7 +28,7 @@ namespace big //draw blackhole GRAPHICS::DRAW_MARKER(28, g.world.blackhole.pos.x, g.world.blackhole.pos.y, g.world.blackhole.pos.z, - 0.f, 0.f, 0.f, 0, 0, 0, 15.f, 15.f, 15.f, + 0.f, 0.f, 0.f, 0, 0, 0, g.world.blackhole.scale, g.world.blackhole.scale, g.world.blackhole.scale, g.world.blackhole.color[0] * 255, g.world.blackhole.color[1] * 255, g.world.blackhole.color[2] * 255, @@ -83,15 +36,17 @@ namespace big 0, 0, 0, 0, 0, 0, 0); //cleanup - target_entities.clear(); + entity::get_entities(g.world.blackhole.include_vehicles, g.world.blackhole.include_peds).clear(); } //make sure that we always cleanup our memory virtual void on_disable() override { - target_entities.clear(); + entity::get_entities(g.world.blackhole.include_vehicles, g.world.blackhole.include_peds).clear(); } }; blackhole g_blackhole("blackhole", "Blackhole", "Spawns a black hole that picks up all the peds and vehicles in your area.", g.world.blackhole.enable); + bool_command g_blackhole_peds("blackholeincpeds", "Peds", "Includes all nearby peds in the blackholes path of destruction", g.world.blackhole.include_peds); + bool_command g_blackhole_vehicles("blackholeincvehs", "Vehicles", "Includes all nearby vehicles in the blackholes path of destruction", g.world.blackhole.include_vehicles); } \ No newline at end of file diff --git a/src/backend/looped/world/nearby/combative.cpp b/src/backend/looped/world/nearby/combative.cpp new file mode 100644 index 00000000..e69de29b diff --git a/src/backend/looped/world/nearby/high_alert.cpp b/src/backend/looped/world/nearby/high_alert.cpp new file mode 100644 index 00000000..5abafbab --- /dev/null +++ b/src/backend/looped/world/nearby/high_alert.cpp @@ -0,0 +1,28 @@ +#include "natives.hpp" +#include "backend/looped_command.hpp" +#include "pointers.hpp" +#include "util/entity.hpp" + +namespace big +{ + + class high_alert : looped_command + { + using looped_command::looped_command; + + virtual void on_tick() override + { + + for (auto ped : entity::get_entities(false, true)) + { + PED::SET_PED_HIGHLY_PERCEPTIVE(ped, true); + PED::SET_PED_HEARING_RANGE(ped, 1000.0); + PED::SET_PED_SEEING_RANGE(ped, 1000.0); + PED::SET_PED_VISUAL_FIELD_MIN_ANGLE(ped, 1000.0); + } + } + }; + + high_alert g_high_alert("highalert", "High Alert", "Not the CoD perk.", g.world.nearby.high_alert); + +} \ No newline at end of file diff --git a/src/backend/looped/world/nearby/ignore.cpp b/src/backend/looped/world/nearby/ignore.cpp new file mode 100644 index 00000000..27b8c431 --- /dev/null +++ b/src/backend/looped/world/nearby/ignore.cpp @@ -0,0 +1,40 @@ +#include "natives.hpp" +#include "backend/looped_command.hpp" +#include "pointers.hpp" +#include "util/entity.hpp" + +namespace big +{ + + class ignore : looped_command + { + using looped_command::looped_command; + + virtual void on_enable() override //should help for any stragglers that aren't set by the tick (aka current event) + { + PLAYER::SET_EVERYONE_IGNORE_PLAYER(self::id, true); + PLAYER::SET_POLICE_IGNORE_PLAYER(self::id, true); + } + + virtual void on_tick() override + { + + for (auto ped : entity::get_entities(false, true)) + { + if (!PED::GET_PED_CONFIG_FLAG(ped, 17, true)) { // Flag 17 = PED_FLAG_BLOCK_NON_TEMPORARY_EVENTS + PED::SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(ped, true); + TASK::TASK_SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(ped, true); + } + } + } + + virtual void on_disable() override + { + PLAYER::SET_EVERYONE_IGNORE_PLAYER(self::id, false); + PLAYER::SET_POLICE_IGNORE_PLAYER(self::id, false); + } + }; + + ignore g_ignore("pedsignore", "Ignore", "Nearby peds will ignore you and become oblivious to your actions.", g.world.nearby.ignore); + +} \ No newline at end of file diff --git a/src/backend/looped/world/nearby/ped_rush.cpp b/src/backend/looped/world/nearby/ped_rush.cpp new file mode 100644 index 00000000..de01a2f3 --- /dev/null +++ b/src/backend/looped/world/nearby/ped_rush.cpp @@ -0,0 +1,32 @@ +#include "natives.hpp" +#include "backend/looped_command.hpp" +#include "pointers.hpp" +#include "util/entity.hpp" + +namespace big +{ + + class ped_rush : looped_command + { + using looped_command::looped_command; + + virtual void on_tick() override + { + for (auto ped : entity::get_entities(false, true)) + { + PED::SET_PED_MOVE_RATE_OVERRIDE(ped, 10.0f); + } + } + + virtual void on_disable() override //Set the peds back to their normal speed + { + for (auto ped : entity::get_entities(false, true)) + { + PED::SET_PED_MOVE_RATE_OVERRIDE(ped, 1.0f); + } + } + }; + + ped_rush g_ped_rush("pedrush", "Ped Rush", "Makes the nearby peds move with a purpose.", g.world.nearby.ped_rush); + +} \ No newline at end of file diff --git a/src/backend/looped/world/nearby/peds_rain.cpp b/src/backend/looped/world/nearby/peds_rain.cpp new file mode 100644 index 00000000..f81d2814 --- /dev/null +++ b/src/backend/looped/world/nearby/peds_rain.cpp @@ -0,0 +1,32 @@ +#include "natives.hpp" +#include "backend/looped_command.hpp" +#include "pointers.hpp" +#include "util/entity.hpp" + +namespace big +{ + + class ped_rain : looped_command + { + using looped_command::looped_command; + + virtual void on_tick() override + { + + for (auto ped : entity::get_entities(false, true)) + { + if (!ENTITY::IS_ENTITY_IN_AIR(ped)) { + Vector3 my_location = ENTITY::GET_ENTITY_COORDS(self::ped, 1); + my_location.x = my_location.x + (rand() % 100 + (-50)); + my_location.y = my_location.y + (rand() % 100 + (-50)); + my_location.z = my_location.z + (rand() % 50 + 50); + ENTITY::SET_ENTITY_COORDS(ped, my_location.x, my_location.y, my_location.z, 0, 0, 0, 0); + ENTITY::SET_ENTITY_VELOCITY(ped, 0.0, 0.0, -1.0); + } + } + } + }; + + ped_rain g_ped_rain("pedrain", "Rain Peds", "Will pour down and rain nearby peds.", g.world.nearby.ped_rain); + +} \ No newline at end of file diff --git a/src/backend/looped/world/nearby/vehicles_rain.cpp b/src/backend/looped/world/nearby/vehicles_rain.cpp new file mode 100644 index 00000000..f68b8315 --- /dev/null +++ b/src/backend/looped/world/nearby/vehicles_rain.cpp @@ -0,0 +1,35 @@ +#include "natives.hpp" +#include "backend/looped_command.hpp" +#include "pointers.hpp" +#include "util/entity.hpp" + +namespace big +{ + + class vehicle_rain : looped_command + { + using looped_command::looped_command; + + virtual void on_tick() override + { + for (auto vehicles : entity::get_entities(true, false)) + { + if (!ENTITY::IS_ENTITY_IN_AIR(vehicles)) + { + if (entity::take_control_of(vehicles)) + { + Vector3 my_location = ENTITY::GET_ENTITY_COORDS(self::ped, 1); + my_location.x = my_location.x + (rand() % 100 + (-50)); + my_location.y = my_location.y + (rand() % 100 + (-50)); + my_location.z = my_location.z + (rand() % 20 + 100); + ENTITY::SET_ENTITY_COORDS(vehicles, my_location.x, my_location.y, my_location.z, 0, 0, 0, 0); + ENTITY::SET_ENTITY_VELOCITY(vehicles, 0.0, 0.0, -1.0); + } + } + } + } + }; + + vehicle_rain g_vehicle_rain("vehiclerain", "Rain Vehicles", "Drops surround vehicles, vehicles can hit and kill you!", g.world.nearby.veh_rain); + +} \ No newline at end of file diff --git a/src/core/globals.hpp b/src/core/globals.hpp index e0e639e5..70b7f5c9 100644 --- a/src/core/globals.hpp +++ b/src/core/globals.hpp @@ -465,6 +465,7 @@ namespace big bool enable = false; bool include_peds = false; bool include_vehicles = false; + float scale = 6.f; float color[3] = { 1, 1, 1 }; int alpha = 150; rage::fvector3 pos; @@ -472,6 +473,17 @@ namespace big NLOHMANN_DEFINE_TYPE_INTRUSIVE(blackhole, enable, include_peds, include_vehicles, color, alpha) } blackhole{}; + struct nearby + { + bool ignore = false; + bool ped_rain = false; + bool veh_rain = false; + bool high_alert = false; + bool ped_rush = false; + + NLOHMANN_DEFINE_TYPE_INTRUSIVE(nearby, ignore, ped_rain, veh_rain, high_alert, ped_rush) + } nearby{}; + struct model_swapper { std::vector> models; @@ -480,7 +492,7 @@ namespace big NLOHMANN_DEFINE_TYPE_INTRUSIVE(model_swapper, models) } model_swapper{}; - NLOHMANN_DEFINE_TYPE_INTRUSIVE(world, water, spawn_ped, custom_time, blackhole, model_swapper) + NLOHMANN_DEFINE_TYPE_INTRUSIVE(world, water, spawn_ped, custom_time, blackhole, model_swapper, nearby) } world{}; struct spoofing @@ -615,6 +627,21 @@ namespace big NLOHMANN_DEFINE_TYPE_INTRUSIVE(gravity_gun, launch_on_release) } gravity_gun; + struct aimbot + { + bool enable = false; + bool smoothing = true; + float smoothing_speed = 2.f; + bool on_player = true; + bool on_enemy = false; + bool on_police = false; + bool on_npc = false; + float fov = 90.f; + float distance = 200.f; + std::uint32_t selected_bone = 0x796E; // Default to head + NLOHMANN_DEFINE_TYPE_INTRUSIVE(aimbot, enable, smoothing, smoothing_speed, fov, selected_bone) + } aimbot{}; + CustomWeapon custom_weapon = CustomWeapon::NONE; bool force_crosshairs = false; bool infinite_ammo = false; @@ -627,10 +654,12 @@ namespace big bool increased_flare_limit = false; bool rapid_fire = false; bool interior_weapon = false; + bool triggerbot = false; NLOHMANN_DEFINE_TYPE_INTRUSIVE(weapons, - ammo_special, custom_weapon, force_crosshairs, infinite_ammo, infinite_mag, increased_damage, no_recoil, - no_spread, vehicle_gun_model, increased_c4_limit, increased_flare_limit, rapid_fire, gravity_gun, interior_weapon) + ammo_special, custom_weapon, aimbot, force_crosshairs, infinite_ammo, infinite_mag, increased_damage, no_recoil, + no_spread, vehicle_gun_model, increased_c4_limit, increased_flare_limit, rapid_fire, gravity_gun, interior_weapon, + triggerbot) } weapons{}; struct window diff --git a/src/gui.cpp b/src/gui.cpp index 4db30d40..bf2e46e5 100644 --- a/src/gui.cpp +++ b/src/gui.cpp @@ -95,7 +95,7 @@ namespace big colors[ImGuiCol_CheckMark] = ImVec4(0.80f, 0.80f, 0.83f, 0.31f); colors[ImGuiCol_SliderGrab] = ImVec4(0.80f, 0.80f, 0.83f, 0.31f); colors[ImGuiCol_SliderGrabActive] = ImVec4(0.06f, 0.05f, 0.07f, 1.00f); - colors[ImGuiCol_Button] = ImVec4(0.24f, 0.23f, 0.29f, 1.00f); + colors[ImGuiCol_Button] = ImVec4(0.24f, 0.23f, 0.29f, 1.00f); colors[ImGuiCol_ButtonHovered] = ImVec4(0.24f, 0.23f, 0.29f, 1.00f); colors[ImGuiCol_ButtonActive] = ImVec4(0.56f, 0.56f, 0.58f, 1.00f); colors[ImGuiCol_Header] = ImVec4(0.30f, 0.29f, 0.32f, 1.00f); diff --git a/src/gui/components/button.cpp b/src/gui/components/button.cpp deleted file mode 100644 index e1a6c295..00000000 --- a/src/gui/components/button.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include "gui/components/components.hpp" -#include "fiber_pool.hpp" - -namespace big -{ - bool components::button(const std::string_view text) { - return ImGui::Button(text.data()); - } - - void components::button(const std::string_view text, std::function cb) { - if (components::button(text)) { - g_fiber_pool->queue_job(cb); - } - } -} \ No newline at end of file diff --git a/src/gui/components/components.hpp b/src/gui/components/components.hpp index d2c9559c..4577d219 100644 --- a/src/gui/components/components.hpp +++ b/src/gui/components/components.hpp @@ -3,6 +3,7 @@ #include "backend/command.hpp" #include "backend/looped_command.hpp" #include "backend/player_command.hpp" +#include "fiber_pool.hpp" namespace big { @@ -14,12 +15,10 @@ namespace big static void custom_text(const std::string_view, ImFont*); public: static bool nav_button(const std::string_view); - static bool button(const std::string_view); static void icon(const std::string_view); static void small_text(const std::string_view); static void sub_title(const std::string_view); static void title(const std::string_view); - static void button(const std::string_view, std::function); static void nav_item(std::pair&, int); static void input_text_with_hint(const std::string_view label, const std::string_view hint, char* buf, size_t buf_size, ImGuiInputTextFlags_ flag = ImGuiInputTextFlags_None, std::function cb = nullptr); @@ -32,7 +31,7 @@ namespace big static bool script_patch_checkbox(const std::string_view text, bool* option, const std::string_view tooltip = ""); - template + template static void command_button(const std::vector args = {}, std::optional label_override = std::nullopt) { static command* command = command::get(rage::consteval_joaat(cmd_str.value)); @@ -42,7 +41,7 @@ namespace big ImGui::SetTooltip(command->get_description().c_str()); } - template + template static void player_command_button(player_ptr player = g_player_service->get_selected(), const std::vector args = {}, std::optional label_override = std::nullopt) { static player_command* command = (player_command*)command::get(rage::consteval_joaat(cmd_str.value)); @@ -62,6 +61,22 @@ namespace big ImGui::SetTooltip(command->get_description().c_str()); } + template + static bool button(const std::string_view text) { + bool status = false; + ImGui::PushStyleColor(ImGuiCol_Button, color); + status = ImGui::Button(text.data(), size); + ImGui::PopStyleColor(1); + return status; + } + + template + static void button(const std::string_view text, std::function cb) { + if (button(text)) { + g_fiber_pool->queue_job(cb); + } + } + template static void disable_unless(PredicateFn predicate_fn, ComponentsFn components_fn) { auto const result = predicate_fn(); diff --git a/src/services/gui/gui_service.hpp b/src/services/gui/gui_service.hpp index 458293cb..9d5ab757 100644 --- a/src/services/gui/gui_service.hpp +++ b/src/services/gui/gui_service.hpp @@ -31,6 +31,7 @@ namespace big WATER, BLACKHOLE, MODEL_SWAPPER, + NEARBY, NETWORK, SESSION, @@ -90,7 +91,8 @@ namespace big { tabs::WATER, { "Water", view::water }}, { tabs::BLACKHOLE, { "Blackhole", view::blackhole }}, { tabs::MODEL_SWAPPER, { "Model Swapper", view::model_swapper }}, - }}}, + { tabs::NEARBY, { "Nearby", view::nearby }} + }}}, {tabs::NETWORK, { "Network", nullptr, { { tabs::SPOOFING, { "Spoofing", view::spoofing }}, { tabs::SESSION, { "Session", view::session }}, diff --git a/src/util/entity.hpp b/src/util/entity.hpp index e23ecfcc..df176fa2 100644 --- a/src/util/entity.hpp +++ b/src/util/entity.hpp @@ -4,6 +4,7 @@ #include "natives.hpp" #include "script.hpp" #include "math.hpp" +#include "gta_util.hpp" namespace big::entity { @@ -81,4 +82,55 @@ namespace big::entity } return true; } + + inline std::vector get_entities(bool vehicles, bool peds) + { + std::vector target_entities; + target_entities.clear(); + const auto replay_interface = *g_pointers->m_replay_interface; + if (!replay_interface) + return target_entities; + + if (vehicles) + { + const auto vehicle_interface = replay_interface->m_vehicle_interface; + for (int i = 0; i < vehicle_interface->m_max_vehicles; i++) + { + const auto vehicle_ptr = vehicle_interface->get_vehicle(i); + if (!vehicle_ptr) + continue; + + if (vehicle_ptr == gta_util::get_local_vehicle()) + continue; + + const auto veh = g_pointers->m_ptr_to_handle(vehicle_ptr); + if (!veh) + break; + + target_entities.push_back(veh); + } + } + + if (peds) + { + const auto ped_interface = replay_interface->m_ped_interface; + for (int i = 0; i < ped_interface->m_max_peds; i++) + { + const auto ped_ptr = ped_interface->get_ped(i); + if (!ped_ptr) + continue; + + //make sure to don't include ourselves + if (ped_ptr == gta_util::get_local_ped()) + continue; + + const auto ped = g_pointers->m_ptr_to_handle(ped_ptr); + if (!ped) + break; + + target_entities.push_back(ped); + } + } + return target_entities; + } } \ No newline at end of file diff --git a/src/util/ped.hpp b/src/util/ped.hpp index a550a845..b24aa5dc 100644 --- a/src/util/ped.hpp +++ b/src/util/ped.hpp @@ -2,6 +2,7 @@ #include "natives.hpp" #include "script.hpp" #include "pointers.hpp" +#include "entity.hpp" namespace big::ped { @@ -68,6 +69,18 @@ namespace big::ped PED::SET_PED_ARMOUR(self::ped, current_armor); } + inline void kill_ped(const Ped ped) + { + if (entity::take_control_of(ped)) + PED::APPLY_DAMAGE_TO_PED(ped, PED::GET_PED_MAX_HEALTH(ped) * 2, false, 0); + } + + inline void kill_ped_by_relation(Ped ped, int relation_id) + { + if (PED::GET_RELATIONSHIP_BETWEEN_PEDS(ped, PLAYER::PLAYER_PED_ID()) == relation_id) + kill_ped(ped); + } + inline Ped spawn(ePedType pedType, Hash hash, Hash clone, Vector3 location, float heading, bool is_networked = true) { for (uint8_t i = 0; !STREAMING::HAS_MODEL_LOADED(hash) && i < 100; i++) diff --git a/src/util/vehicle.hpp b/src/util/vehicle.hpp index 118dc135..5da081cc 100644 --- a/src/util/vehicle.hpp +++ b/src/util/vehicle.hpp @@ -657,6 +657,15 @@ namespace big::vehicle return g_notification_service->push_warning("VEHICLE"_T.data(), "PLEASE_ENTER_VEHICLE"_T.data()); } + inline void downgrade(Vehicle vehicle) + { + VEHICLE::SET_VEHICLE_MOD_KIT(vehicle, 0); + for (int i = 0; i < 50; i++) + { + VEHICLE::REMOVE_VEHICLE_MOD(vehicle, i); + } + } + inline bool remote_control_vehicle(Vehicle veh) { if (!entity::take_control_of(veh, 4000)) diff --git a/src/views/self/view_weapons.cpp b/src/views/self/view_weapons.cpp index 1d922b04..c59e51f2 100644 --- a/src/views/self/view_weapons.cpp +++ b/src/views/self/view_weapons.cpp @@ -153,5 +153,31 @@ namespace big break; } + + ImGui::Separator(); + components::sub_title("Aim Assistance"); + components::command_checkbox<"triggerbot">(); ImGui::SameLine(); + components::command_checkbox<"aimbot">(); + + if (g.weapons.aimbot.enable) + { + components::command_checkbox<"aimatplayer">(); ImGui::SameLine(); + components::command_checkbox<"aimatnpc">(); ImGui::SameLine(); + components::command_checkbox<"aimatpolice">(); ImGui::SameLine(); + components::command_checkbox<"aimatenemy">(); + + components::command_checkbox<"smoothing">(); + if (g.weapons.aimbot.smoothing) + { + ImGui::SameLine(); + ImGui::PushItemWidth(220); + ImGui::SliderFloat("Speed", &g.weapons.aimbot.smoothing_speed, 1.f, 12.f, "%.1f"); + ImGui::PopItemWidth(); + } + ImGui::PushItemWidth(350); + ImGui::SliderFloat("FOV", &g.weapons.aimbot.fov, 1.f, 360.f, "%.0f"); + ImGui::SliderFloat("Distance", &g.weapons.aimbot.distance, 1.f, 350.f, "%.0f"); + ImGui::PopItemWidth(); + } } } diff --git a/src/views/view.hpp b/src/views/view.hpp index e20e4d6e..94a153cb 100644 --- a/src/views/view.hpp +++ b/src/views/view.hpp @@ -56,6 +56,7 @@ namespace big static void water(); static void blackhole(); static void model_swapper(); + static void nearby(); static void player_info(); static void player_troll(); diff --git a/src/views/world/view_blackhole.cpp b/src/views/world/view_blackhole.cpp index be86fe68..434bada6 100644 --- a/src/views/world/view_blackhole.cpp +++ b/src/views/world/view_blackhole.cpp @@ -8,14 +8,15 @@ namespace big components::command_checkbox<"blackhole">(); components::sub_title("Entities"); - ImGui::Checkbox("Vehicles", &g.world.blackhole.include_vehicles); + components::command_checkbox<"blackholeincvehs">(); ImGui::SameLine(); - ImGui::Checkbox("Peds", &g.world.blackhole.include_peds); + components::command_checkbox<"blackholeincpeds">(); components::sub_title("Position"); ImGui::InputFloat("X", &g.world.blackhole.pos.x, 5.f, 200.f); ImGui::InputFloat("Y", &g.world.blackhole.pos.y, 5.f, 200.f); ImGui::InputFloat("Z", &g.world.blackhole.pos.z, 5.f, 200.f); + ImGui::SliderFloat("Scale", &g.world.blackhole.scale, 2.f, 12.f, "%.0f"); components::button("Set to current coords", [] { const auto player_pos = g_local_player->get_position(); diff --git a/src/views/world/view_nearby.cpp b/src/views/world/view_nearby.cpp new file mode 100644 index 00000000..72be237a --- /dev/null +++ b/src/views/world/view_nearby.cpp @@ -0,0 +1,76 @@ +#include "views/view.hpp" +#include "util/local_player.hpp" +#include "util/entity.hpp" +#include "util/ped.hpp" +#include "util/vehicle.hpp" + +namespace big +{ + void view::nearby() + { + components::sub_title("Peds"); + // Nearby Ped Actions + components::button + ("Delete", [] + { + for (auto peds : entity::get_entities(false, true)) + { + entity::delete_entity(peds); + } + }); ImGui::SameLine(); + + components::button + ("Kill", [] + { + for (auto peds : entity::get_entities(false, true)) + { + ped::kill_ped(peds); + } + }); ImGui::SameLine(); + + components::button + ("Kill Enemies", [] + { + for (auto peds : entity::get_entities(false, true)) + { + ped::kill_ped_by_relation(peds, 4 || 5); + } + }); + + // Nearby Ped Loops / Toggles + components::command_checkbox<"pedsignore">(); ImGui::SameLine(140.f); + components::command_checkbox<"pedrain">(); + components::command_checkbox<"highalert">(); ImGui::SameLine(140.f); + components::command_checkbox<"pedrush">(); + + ImGui::Separator(); + components::sub_title("Vehicles"); + // Nearby Vehicle Actions + + components::button + ("Max Upgrade", [] { + for (auto vehs : entity::get_entities(true, false)) + { + if (entity::take_control_of(vehs)) + { + vehicle::max_vehicle(vehs); + script::get_current()->yield(); + } + } + }); ImGui::SameLine(); + + components::button + ("Downgrade", [] { + for (auto vehs : entity::get_entities(true, false)) + { + if (entity::take_control_of(vehs)) + { + vehicle::downgrade(vehs); + script::get_current()->yield(); + } + } + }); + + components::command_checkbox<"vehiclerain">(); + } +} \ No newline at end of file