From d3d231375c1b1e0c4337dfd3584c9db183846ad7 Mon Sep 17 00:00:00 2001 From: Maddy <59680197+xM4ddy@users.noreply.github.com> Date: Tue, 24 May 2022 15:59:54 -0400 Subject: [PATCH] remove(Toxic): remove toxic options --- .../looped/player/player_never_wanted.cpp | 4 +- BigBaseV2/src/util/all.hpp | 1 - BigBaseV2/src/util/globals.hpp | 13 +++ BigBaseV2/src/util/toxic.hpp | 98 ------------------- BigBaseV2/src/views/players/view_player.cpp | 28 +----- 5 files changed, 17 insertions(+), 127 deletions(-) delete mode 100644 BigBaseV2/src/util/toxic.hpp diff --git a/BigBaseV2/src/backend/looped/player/player_never_wanted.cpp b/BigBaseV2/src/backend/looped/player/player_never_wanted.cpp index 8b952159..a9177a59 100644 --- a/BigBaseV2/src/backend/looped/player/player_never_wanted.cpp +++ b/BigBaseV2/src/backend/looped/player/player_never_wanted.cpp @@ -1,6 +1,6 @@ #include "backend/looped/looped.hpp" #include "services/player_service.hpp" -#include "util/toxic.hpp" +#include "util/globals.hpp" namespace big { @@ -8,7 +8,7 @@ namespace big { if (g->player.player_never_wanted && g_player_service->get_selected()->is_valid()) { - toxic::clear_wanted_player(g_player_service->get_selected()->id()); + globals::clear_wanted_player(g_player_service->get_selected()->id()); } } } diff --git a/BigBaseV2/src/util/all.hpp b/BigBaseV2/src/util/all.hpp index ea318667..382042f9 100644 --- a/BigBaseV2/src/util/all.hpp +++ b/BigBaseV2/src/util/all.hpp @@ -8,5 +8,4 @@ #include "session.hpp" #include "system.hpp" #include "teleport.hpp" -#include "toxic.hpp" #include "vehicle.hpp" \ No newline at end of file diff --git a/BigBaseV2/src/util/globals.hpp b/BigBaseV2/src/util/globals.hpp index 01d5ec84..448f2f30 100644 --- a/BigBaseV2/src/util/globals.hpp +++ b/BigBaseV2/src/util/globals.hpp @@ -1,5 +1,6 @@ #pragma once #include "script_global.hpp" +#include "util/system.hpp" namespace big::globals { @@ -7,4 +8,16 @@ namespace big::globals { return *script_global(2810701).at(298).as(); } + + inline void clear_wanted_player(Player target) + { + constexpr size_t arg_count = 3; + int64_t args[arg_count] = { + static_cast(eRemoteEvent::ClearWantedLevel), + self::id, + *script_global(1893551).at(target, 599).at(510).as() + }; + + g_pointers->m_trigger_script_event(1, args, arg_count, 1 << target); + } } \ No newline at end of file diff --git a/BigBaseV2/src/util/toxic.hpp b/BigBaseV2/src/util/toxic.hpp deleted file mode 100644 index d88ec54c..00000000 --- a/BigBaseV2/src/util/toxic.hpp +++ /dev/null @@ -1,98 +0,0 @@ -#pragma once -#include "gta/enums.hpp" -#include "natives.hpp" -#include "script_global.hpp" -#include "system.hpp" -#include "entity.hpp" - -namespace big::toxic -{ - inline void blame_explode_coord(Player to_blame, Vector3 pos, eExplosionType explosion_type, float damage, bool is_audible, bool is_invisible, float camera_shake) - { - system::patch_blame(true); - FIRE::ADD_OWNED_EXPLOSION( - PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(to_blame), - pos.x, pos.y, pos.z, - explosion_type, - damage, - is_audible, - is_invisible, - camera_shake - ); - system::patch_blame(false); - } - - inline void blame_explode_player(Player to_blame, Player target, eExplosionType explosion_type, float damage, bool is_audible, bool is_invisible, float camera_shake) - { - Vector3 coords = ENTITY::GET_ENTITY_COORDS(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(target), true); - blame_explode_coord(to_blame, coords, explosion_type, damage, is_audible, is_invisible, camera_shake); - } - - inline void bounty_player(Player target, int amount) - { - const size_t arg_count = 22; - int64_t args[arg_count] = { - static_cast(eRemoteEvent::Bounty), - self::id, - target, - 0, // set by player or NPC? - amount, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - * script_global(1921039).at(9).as(), - * script_global(1921039).at(10).as() - }; - - g_pointers->m_trigger_script_event(1, args, arg_count, -1); - } - - inline void taze_player(const Player player) - { - const Ped target = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(player); - - constexpr auto max_attempts = 20; - for (size_t attempts = 0; attempts < max_attempts && !ENTITY::IS_ENTITY_DEAD(target, false); attempts++) - { - const Vector3 destination = PED::GET_PED_BONE_COORDS(target, (int)PedBones::SKEL_ROOT, 0.0f, 0.0f, 0.0f); - const Vector3 origin = PED::GET_PED_BONE_COORDS(target, (int)PedBones::SKEL_R_Hand, 0.0f, 0.0f, 0.2f); - - MISC::SHOOT_SINGLE_BULLET_BETWEEN_COORDS(origin.x, origin.y, origin.z, destination.x, destination.y, destination.z, 1, 0, RAGE_JOAAT("WEAPON_STUNGUN"), self::ped, false, true, 1); - } - } - - inline void kick_from_vehicle(const Player player) - { - const Ped target = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(player); - - TASK::CLEAR_PED_TASKS_IMMEDIATELY(target); - } - - inline void flying_vehicle(const Player player) - { - Entity ent = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(player); - - if (!PED::IS_PED_IN_ANY_VEHICLE(ent, true)) - g_notification_service->push_warning("Toxic", "Target player is not in a vehicle."); - else { - ent = PED::GET_VEHICLE_PED_IS_IN(ent, false); - - if (entity::take_control_of(ent)) - ENTITY::APPLY_FORCE_TO_ENTITY(ent, 1, 0.f, 0.f, 50000.f, 0.f, 0.f, 0.f, 0, 0, 1, 1, 0, 1); - else - g_notification_service->push_warning("Toxic", "Failed to take control of player vehicle."); - } - } - - - inline void clear_wanted_player(Player target) - { - constexpr size_t arg_count = 3; - int64_t args[arg_count] = { - static_cast(eRemoteEvent::ClearWantedLevel), - self::id, - *script_global(1893551).at(target, 599).at(510).as() - }; - - g_pointers->m_trigger_script_event(1, args, arg_count, 1 << target); - } -} diff --git a/BigBaseV2/src/views/players/view_player.cpp b/BigBaseV2/src/views/players/view_player.cpp index c07cd16a..e0bdb9b6 100644 --- a/BigBaseV2/src/views/players/view_player.cpp +++ b/BigBaseV2/src/views/players/view_player.cpp @@ -1,8 +1,8 @@ #include "views/view.hpp" -#include "util/toxic.hpp" #include "services/player_service.hpp" #include "gta_util.hpp" #include "util/misc.hpp" +#include "util/globals.hpp" #include "util/ped.hpp" #include "util/teleport.hpp" @@ -35,7 +35,7 @@ namespace big }); components::button("Clear Wanted Level", [] { - toxic::clear_wanted_player(g_player_service->get_selected()->id()); + globals::clear_wanted_player(g_player_service->get_selected()->id()); }); ImGui::SameLine(); @@ -109,30 +109,6 @@ namespace big ImGui::TreePop(); } - - if (ImGui::TreeNode("Toxic")) { - components::button("Explode Self", [] { - toxic::blame_explode_player( - g_player_service->get_selected()->id(), - g_player_service->get_selected()->id(), - eExplosionType::PLANE, 1000, false, true, 0.f - ); - }); - - components::button("Taze", [] { - toxic::taze_player(g_player_service->get_selected()->id()); - }); - - components::button("Kick From Vehicle", [] { - toxic::kick_from_vehicle(g_player_service->get_selected()->id()); - }); - - components::button("Flying Vehicle", [] { - toxic::flying_vehicle(g_player_service->get_selected()->id()); - }); - - ImGui::TreePop(); - } } } } \ No newline at end of file