diff --git a/BigBaseV2/src/common.hpp b/BigBaseV2/src/common.hpp index 849067b8..205244c2 100644 --- a/BigBaseV2/src/common.hpp +++ b/BigBaseV2/src/common.hpp @@ -49,9 +49,13 @@ #include #include "logger.hpp" - #include "settings.h" +#include "gta/ped_factory.hpp" +#include "structs/lists.hpp" +#include "structs/player.hpp" +#include "structs/temp.hpp" + namespace big { using namespace std::chrono_literals; @@ -63,4 +67,16 @@ namespace big inline HANDLE g_main_thread{}; inline DWORD g_main_thread_id{}; inline std::atomic_bool g_running{ true }; + + // Global Variables + inline player g_player; + inline player g_selectedPlayer; + inline std::unordered_map g_players; + + inline CAutomobile* g_vehicle; + + inline temp g_temp = temp{}; + + // screen width and height + inline int x, y; } diff --git a/BigBaseV2/src/features.cpp b/BigBaseV2/src/features.cpp index 56316261..e5bca607 100644 --- a/BigBaseV2/src/features.cpp +++ b/BigBaseV2/src/features.cpp @@ -1,54 +1,41 @@ #include "features.hpp" -#include "logger.hpp" -#include "natives.hpp" +#include "features/custom_guns.hpp" +#include "features/protections.hpp" +#include "features/self.hpp" +#include "features/sys.hpp" +#include "features/tunables.hpp" +#include "features/util.hpp" +#include "features/vehicle.hpp" +#include "features/world.hpp" #include "script.hpp" namespace big { void features::run_tick() { - g_playerId = PLAYER::PLAYER_ID(); - // System - update_player_structs(); - update_screen_sizes(); + sys::loop(); // Custom Guns - cage_gun(); - delete_gun(); - gravity_gun(); - money_gun(); - repair_gun(); - vehicle_gun(); - - // Tunable - disable_phone(); - no_idle_kick(); - - // Self - god_mode(); - never_wanted(); - noclip(); - no_ragdoll(); - off_radar(); - super_sprint(); - spoof_rank(); - - // Vehicle - handling(); - no_bike_fall(); - speedo_meter(); - sticky_tyres(); - - // World - population_modifiers(); - - // Util - spectate_player(); + custom_guns::loop(); // Protections - replay_interface(); - //version_mismatch(); + protections::loop(); + + // Self + self::loop(); + + // Tunable + tunables::loop(); + + // Util + util::loop(); + + // Vehicle + vehicle::loop(); + + // World + world::loop(); } void features::script_func() diff --git a/BigBaseV2/src/features.hpp b/BigBaseV2/src/features.hpp index ff32fe14..31e4c3af 100644 --- a/BigBaseV2/src/features.hpp +++ b/BigBaseV2/src/features.hpp @@ -1,69 +1,11 @@ #pragma once #include "common.hpp" -#include "fiber_pool.hpp" -#include "gta/joaat.hpp" -#include "structs/lists.hpp" -#include "structs/player.hpp" -#include "structs/temp.hpp" -#include "features/functions.hpp" -#include "features/notify.hpp" -#include "features/stats.hpp" -#include "features/teleport.hpp" -#include "gta/ped_factory.hpp" namespace big { - inline Player g_playerId; - inline Player g_selectedPlayerId; - - inline player g_currentPlayer; - inline player g_selectedPlayer; - inline player g_players[32]; - - // Temporary Variable struct - inline temp g_temp = temp{}; - - inline CAutomobile* g_vehicle; - inline bool g_in_vehicle = false; - - inline bool g_handling_window = false; - - // Screen Width & Height - inline int x, y; - namespace features { void run_tick(); void script_func(); - - void cage_gun(); - void delete_gun(); - void gravity_gun(); - void money_gun(); - void repair_gun(); - void vehicle_gun(); - - void replay_interface(); - void version_mismatch(); - - void disable_phone(); - void god_mode(); - void never_wanted(); - void noclip(); - void no_bike_fall(); - void no_idle_kick(); - void no_ragdoll(); - void off_radar(); - void population_modifiers(); - void spectate_player(); - void speedo_meter(); - void spoof_rank(); - void sticky_tyres(); - void super_sprint(); - - void handling(); - - void update_screen_sizes(); - void update_player_structs(); } } diff --git a/BigBaseV2/src/features/custom_guns.cpp b/BigBaseV2/src/features/custom_guns.cpp new file mode 100644 index 00000000..554721f7 --- /dev/null +++ b/BigBaseV2/src/features/custom_guns.cpp @@ -0,0 +1,26 @@ +#include "custom_guns.hpp" +#include "fiber_pool.hpp" +#include "script.hpp" + +namespace big +{ + static bool busy = false; + + void custom_guns::loop() + { + if (busy) return; + busy = true; + + QUEUE_JOB_BEGIN_CLAUSE() + { + cage_gun(); + delete_gun(); + gravity_gun(); + money_gun(); + repair_gun(); + vehicle_gun(); + + busy = false; + }QUEUE_JOB_END_CLAUSE + } +} \ No newline at end of file diff --git a/BigBaseV2/src/features/custom_guns.hpp b/BigBaseV2/src/features/custom_guns.hpp new file mode 100644 index 00000000..61a31066 --- /dev/null +++ b/BigBaseV2/src/features/custom_guns.hpp @@ -0,0 +1,25 @@ +#pragma once +#include "common.hpp" +#include "functions.hpp" +#include "gta/joaat.hpp" +#include "natives.hpp" + +namespace big +{ + class custom_guns + { + public: + + static void loop(); + + private: + + static void cage_gun(); + static void delete_gun(); + static void gravity_gun(); + static void money_gun(); + static void repair_gun(); + static void vehicle_gun(); + + }; +} \ No newline at end of file diff --git a/BigBaseV2/src/features/functions.cpp b/BigBaseV2/src/features/functions.cpp index 4b9e008d..694e1b38 100644 --- a/BigBaseV2/src/features/functions.cpp +++ b/BigBaseV2/src/features/functions.cpp @@ -1,9 +1,9 @@ #include "functions.hpp" -#include "features.hpp" #include "gta/joaat.hpp" #include "gta/levels.hpp" #include "pointers.hpp" #include "natives.hpp" +#include "notify.hpp" #include "script.hpp" #include "script_global.hpp" @@ -194,7 +194,7 @@ namespace big } if (!STREAMING::HAS_MODEL_LOADED(hash)) { - features::notify::above_map("~r~Failed to spawn model, did you give an incorrect model?"); + notify::above_map("~r~Failed to spawn model, did you give an incorrect model?"); return -1; } diff --git a/BigBaseV2/src/features/functions.hpp b/BigBaseV2/src/features/functions.hpp index d58cf438..0caf7d29 100644 --- a/BigBaseV2/src/features/functions.hpp +++ b/BigBaseV2/src/features/functions.hpp @@ -1,4 +1,5 @@ #pragma once +#include "common.hpp" #include "structs/session_type.hpp" namespace big diff --git a/BigBaseV2/src/features/looped/custom_guns/cage_gun.cpp b/BigBaseV2/src/features/looped/custom_guns/cage_gun.cpp index 2f54cfaa..93e890da 100644 --- a/BigBaseV2/src/features/looped/custom_guns/cage_gun.cpp +++ b/BigBaseV2/src/features/looped/custom_guns/cage_gun.cpp @@ -1,23 +1,24 @@ -#include "features.hpp" +#include "features/custom_guns.hpp" +#include "features/notify.hpp" namespace big { static const int controls[] = { 14, 15, 24 }; - void features::cage_gun() + void custom_guns::cage_gun() { bool bCageGun = g_settings.options["custom_gun"]["type"] == 5; if (bCageGun) { Hash currWeapon; - WEAPON::GET_CURRENT_PED_WEAPON(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_playerId), &currWeapon, 1); + WEAPON::GET_CURRENT_PED_WEAPON(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_player.id), &currWeapon, 1); if (currWeapon != RAGE_JOAAT("weapon_pistol") && currWeapon != RAGE_JOAAT("weapon_pistol_mk2")) return; if (PAD::IS_DISABLED_CONTROL_PRESSED(0, 25)) { - PLAYER::DISABLE_PLAYER_FIRING(g_playerId, true); + PLAYER::DISABLE_PLAYER_FIRING(g_player.id, true); for (int control : controls) PAD::DISABLE_CONTROL_ACTION(0, control, true); @@ -32,7 +33,7 @@ namespace big func::cage_ped(entity); } } - else features::notify::above_map("No entity found."); + else notify::above_map("No entity found."); } } } diff --git a/BigBaseV2/src/features/looped/custom_guns/delete_gun.cpp b/BigBaseV2/src/features/looped/custom_guns/delete_gun.cpp index 1fbd8537..ae176b2a 100644 --- a/BigBaseV2/src/features/looped/custom_guns/delete_gun.cpp +++ b/BigBaseV2/src/features/looped/custom_guns/delete_gun.cpp @@ -1,23 +1,24 @@ -#include "features.hpp" +#include "features/custom_guns.hpp" +#include "features/notify.hpp" namespace big { static const int controls[] = { 14, 15, 24 }; - void features::delete_gun() + void custom_guns::delete_gun() { bool bDeleteGun = g_settings.options["custom_gun"]["type"] == 1; if (bDeleteGun) { Hash currWeapon; - WEAPON::GET_CURRENT_PED_WEAPON(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_playerId), &currWeapon, 1); + WEAPON::GET_CURRENT_PED_WEAPON(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_player.id), &currWeapon, 1); if (currWeapon != RAGE_JOAAT("weapon_pistol") && currWeapon != RAGE_JOAAT("weapon_pistol_mk2")) return; if (PAD::IS_DISABLED_CONTROL_PRESSED(0, 25)) { - PLAYER::DISABLE_PLAYER_FIRING(g_playerId, true); + PLAYER::DISABLE_PLAYER_FIRING(g_player.id, true); for (int control : controls) PAD::DISABLE_CONTROL_ACTION(0, control, true); @@ -33,7 +34,7 @@ namespace big } else { - Vector3 player = ENTITY::GET_ENTITY_COORDS(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_playerId), true); + Vector3 player = ENTITY::GET_ENTITY_COORDS(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_player.id), true); Vector3 entLoc = ENTITY::GET_ENTITY_COORDS(entity, true); double dist = func::distance_between_vectors(player, entLoc); @@ -51,7 +52,7 @@ namespace big } } } - else features::notify::above_map("No entity found."); + else notify::above_map("No entity found."); } } } diff --git a/BigBaseV2/src/features/looped/custom_guns/gravity_gun.cpp b/BigBaseV2/src/features/looped/custom_guns/gravity_gun.cpp index 9f815654..19beb0d4 100644 --- a/BigBaseV2/src/features/looped/custom_guns/gravity_gun.cpp +++ b/BigBaseV2/src/features/looped/custom_guns/gravity_gun.cpp @@ -1,4 +1,5 @@ -#include "features.hpp" +#include "features/custom_guns.hpp" +#include "features/notify.hpp" namespace big { @@ -10,7 +11,7 @@ namespace big static const int scroll = 2; static const int controls[] = { 14, 15, 24 }; - void features::gravity_gun() + void custom_guns::gravity_gun() { bool bGravityGun = g_settings.options["custom_gun"]["type"] == 2; double multiplier = g_settings.options["custom_gun"]["gravity_velocity_multiplier"]; @@ -18,18 +19,18 @@ namespace big if (bGravityGun) { Hash currWeapon; - WEAPON::GET_CURRENT_PED_WEAPON(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_playerId), &currWeapon, 1); + WEAPON::GET_CURRENT_PED_WEAPON(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_player.id), &currWeapon, 1); if (currWeapon != RAGE_JOAAT("weapon_pistol") && currWeapon != RAGE_JOAAT("weapon_pistol_mk2")) return; // ZOOMED IN if (PAD::IS_DISABLED_CONTROL_PRESSED(0, 25)) { - PLAYER::DISABLE_PLAYER_FIRING(g_playerId, true); + PLAYER::DISABLE_PLAYER_FIRING(g_player.id, true); for (int control : controls) PAD::DISABLE_CONTROL_ACTION(0, control, true); - location = ENTITY::GET_ENTITY_COORDS(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_playerId), true); + location = ENTITY::GET_ENTITY_COORDS(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_player.id), true); // Attack RELEASED if (PAD::IS_DISABLED_CONTROL_PRESSED(0, 24) && entity == 0) @@ -59,7 +60,7 @@ namespace big if (ENTITY::IS_ENTITY_A_PED(entity) && !PED::IS_PED_RAGDOLL(entity)) TASK::SET_HIGH_FALL_TASK(entity, 0, 0, 0); - features::notify::above_map("Selected entity at crosshair."); + notify::above_map("Selected entity at crosshair."); } } } @@ -67,7 +68,7 @@ namespace big { entity = 0; - features::notify::above_map("No entity found."); + notify::above_map("No entity found."); } } @@ -108,7 +109,7 @@ namespace big entity = 0; - features::notify::above_map("Released entity."); + notify::above_map("Released entity."); } } } diff --git a/BigBaseV2/src/features/looped/custom_guns/money_gun.cpp b/BigBaseV2/src/features/looped/custom_guns/money_gun.cpp index 758f775a..cbaf5a9d 100644 --- a/BigBaseV2/src/features/looped/custom_guns/money_gun.cpp +++ b/BigBaseV2/src/features/looped/custom_guns/money_gun.cpp @@ -1,4 +1,6 @@ -#include "features.hpp" +#include "features/custom_guns.hpp" +#include "fiber_pool.hpp" +#include "script.hpp" namespace big { @@ -7,13 +9,13 @@ namespace big static bool busy = false; static Entity entity = 0; - void features::money_gun() + void custom_guns::money_gun() { bool bMoneyGun = g_settings.options["custom_gun"]["type"] == 3; if (bMoneyGun) { - Ped player = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_playerId); + Ped player = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_player.id); Hash currWeapon; WEAPON::GET_CURRENT_PED_WEAPON(player, &currWeapon, 1); @@ -22,7 +24,7 @@ namespace big if (PAD::IS_DISABLED_CONTROL_PRESSED(0, 25)) { - PLAYER::DISABLE_PLAYER_FIRING(g_playerId, true); + PLAYER::DISABLE_PLAYER_FIRING(g_player.id, true); for (int control : controls) PAD::DISABLE_CONTROL_ACTION(0, control, true); @@ -30,7 +32,7 @@ namespace big { busy = true; - QUEUE_JOB_BEGIN_CLAUSE(&) + g_fiber_pool->queue_job([&] { if (func::raycast_entity(&entity)) { @@ -49,7 +51,7 @@ namespace big busy = false; } - }QUEUE_JOB_END_CLAUSE + }); } } } diff --git a/BigBaseV2/src/features/looped/custom_guns/repair_vehicle.cpp b/BigBaseV2/src/features/looped/custom_guns/repair_gun.cpp similarity index 83% rename from BigBaseV2/src/features/looped/custom_guns/repair_vehicle.cpp rename to BigBaseV2/src/features/looped/custom_guns/repair_gun.cpp index 149167d6..c77e2ab1 100644 --- a/BigBaseV2/src/features/looped/custom_guns/repair_vehicle.cpp +++ b/BigBaseV2/src/features/looped/custom_guns/repair_gun.cpp @@ -1,46 +1,47 @@ -#include "features.hpp" - -namespace big -{ - static const int controls[] = { 14, 15, 24 }; - - void features::repair_gun() - { - bool bRepairGun = g_settings.options["custom_gun"]["type"] == 6; - - if (bRepairGun) - { - Hash currWeapon; - WEAPON::GET_CURRENT_PED_WEAPON(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_playerId), &currWeapon, 1); - - if (currWeapon != RAGE_JOAAT("weapon_pistol") && currWeapon != RAGE_JOAAT("weapon_pistol_mk2")) return; - - if (PAD::IS_DISABLED_CONTROL_PRESSED(0, 25)) - { - PLAYER::DISABLE_PLAYER_FIRING(g_playerId, true); - for (int control : controls) - PAD::DISABLE_CONTROL_ACTION(0, control, true); - - if (PAD::IS_DISABLED_CONTROL_JUST_RELEASED(0, 24)) - { - Entity entity; - - if (func::raycast_entity(&entity)) - { - if (ENTITY::IS_ENTITY_A_VEHICLE(entity)) - { - VEHICLE::SET_VEHICLE_FIXED(entity); - VEHICLE::SET_VEHICLE_DEFORMATION_FIXED(entity); - VEHICLE::SET_VEHICLE_DIRT_LEVEL(entity, 0.f); - } - else - { - notify::above_map("Entity is not a vehicle."); - } - } - else notify::above_map("No entity found."); - } - } - } - } +#include "features/custom_guns.hpp" +#include "features/notify.hpp" + +namespace big +{ + static const int controls[] = { 14, 15, 24 }; + + void custom_guns::repair_gun() + { + bool bRepairGun = g_settings.options["custom_gun"]["type"] == 6; + + if (bRepairGun) + { + Hash currWeapon; + WEAPON::GET_CURRENT_PED_WEAPON(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_player.id), &currWeapon, 1); + + if (currWeapon != RAGE_JOAAT("weapon_pistol") && currWeapon != RAGE_JOAAT("weapon_pistol_mk2")) return; + + if (PAD::IS_DISABLED_CONTROL_PRESSED(0, 25)) + { + PLAYER::DISABLE_PLAYER_FIRING(g_player.id, true); + for (int control : controls) + PAD::DISABLE_CONTROL_ACTION(0, control, true); + + if (PAD::IS_DISABLED_CONTROL_JUST_RELEASED(0, 24)) + { + Entity entity; + + if (func::raycast_entity(&entity)) + { + if (ENTITY::IS_ENTITY_A_VEHICLE(entity)) + { + VEHICLE::SET_VEHICLE_FIXED(entity); + VEHICLE::SET_VEHICLE_DEFORMATION_FIXED(entity); + VEHICLE::SET_VEHICLE_DIRT_LEVEL(entity, 0.f); + } + else + { + notify::above_map("Entity is not a vehicle."); + } + } + else notify::above_map("No entity found."); + } + } + } + } } \ No newline at end of file diff --git a/BigBaseV2/src/features/looped/custom_guns/vehicle_gun.cpp b/BigBaseV2/src/features/looped/custom_guns/vehicle_gun.cpp index b14dba0b..8039d18f 100644 --- a/BigBaseV2/src/features/looped/custom_guns/vehicle_gun.cpp +++ b/BigBaseV2/src/features/looped/custom_guns/vehicle_gun.cpp @@ -1,16 +1,16 @@ -#include "features.hpp" +#include "features/custom_guns.hpp" namespace big { static const int controls[] = { 14, 15, 24 }; - void features::vehicle_gun() + void custom_guns::vehicle_gun() { bool bVehicleGun = g_settings.options["custom_gun"]["type"] == 4; if (bVehicleGun) { - Ped player = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_playerId); + Ped player = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_player.id); Hash currWeapon; WEAPON::GET_CURRENT_PED_WEAPON(player, &currWeapon, 1); @@ -19,7 +19,7 @@ namespace big if (PAD::IS_DISABLED_CONTROL_PRESSED(0, 25)) { - PLAYER::DISABLE_PLAYER_FIRING(g_playerId, true); + PLAYER::DISABLE_PLAYER_FIRING(g_player.id, true); for (int control : controls) PAD::DISABLE_CONTROL_ACTION(0, control, true); @@ -44,8 +44,6 @@ namespace big velocity.y = dist * sin(yaw) * cos(pitch); velocity.z = dist * sin(pitch); - script::get_current()->yield(); - ENTITY::SET_ENTITY_ROTATION(veh, rot.x, rot.y, rot.z, 2, 1); ENTITY::SET_ENTITY_VELOCITY(veh, velocity.x, velocity.y, velocity.z); } diff --git a/BigBaseV2/src/features/looped/protections/replay_interface.cpp b/BigBaseV2/src/features/looped/protections/replay_interface.cpp index 7b334323..18caffd2 100644 --- a/BigBaseV2/src/features/looped/protections/replay_interface.cpp +++ b/BigBaseV2/src/features/looped/protections/replay_interface.cpp @@ -1,10 +1,14 @@ -#include "features.hpp" +#include "features/protections.hpp" +#include "features/functions.hpp" +#include "gta/joaat.hpp" #include "gta/replay.hpp" #include "pointers.hpp" +#include "natives.hpp" +#include "script.hpp" namespace big { - void features::replay_interface() + void protections::replay_interface() { Ped player = PLAYER::PLAYER_PED_ID(); @@ -32,6 +36,8 @@ namespace big if (protections["cage"] && ENTITY::GET_ENTITY_MODEL(ent) == RAGE_JOAAT("prop_gold_cont_01")) func::delete_entity(ent); + + script::get_current()->yield(); } } } \ No newline at end of file diff --git a/BigBaseV2/src/features/looped/self/god_mode.cpp b/BigBaseV2/src/features/looped/self/god_mode.cpp index 8694edd5..1fa151f6 100644 --- a/BigBaseV2/src/features/looped/self/god_mode.cpp +++ b/BigBaseV2/src/features/looped/self/god_mode.cpp @@ -1,11 +1,11 @@ -#include "features.hpp" +#include "features/self.hpp" #include "gta_util.hpp" namespace big { static bool bLastGodMode = false; - void features::god_mode() + void self::god_mode() { bool bGodMode = g_settings.options["god_mode"].get(); @@ -15,7 +15,7 @@ namespace big ped->m_godmode = bGodMode ? 0x1 : 0x0; - //ENTITY::SET_ENTITY_INVINCIBLE(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_playerId), bGodMode); + //ENTITY::SET_ENTITY_INVINCIBLE(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_player.id), bGodMode); bLastGodMode = bGodMode; } diff --git a/BigBaseV2/src/features/looped/self/never_wanted.cpp b/BigBaseV2/src/features/looped/self/never_wanted.cpp index 1906db3f..2092ad86 100644 --- a/BigBaseV2/src/features/looped/self/never_wanted.cpp +++ b/BigBaseV2/src/features/looped/self/never_wanted.cpp @@ -1,26 +1,24 @@ -#include "features.hpp" +#include "features/self.hpp" +#include "natives.hpp" namespace big { static bool bLastNeverWanted = false; - void features::never_wanted() + void self::never_wanted() { - QUEUE_JOB_BEGIN_CLAUSE() + bool bNeverWanted = g_settings.options["never_wanted"].get(); + + if (bNeverWanted && PLAYER::GET_PLAYER_WANTED_LEVEL(g_player.id) > 0) { - bool bNeverWanted = g_settings.options["never_wanted"].get(); + PLAYER::SET_PLAYER_WANTED_LEVEL(g_player.id, 0, true); + PLAYER::SET_MAX_WANTED_LEVEL(0); + } + else if (!bNeverWanted && bNeverWanted != bLastNeverWanted) + { + PLAYER::SET_MAX_WANTED_LEVEL(5); + } - if (bNeverWanted && PLAYER::GET_PLAYER_WANTED_LEVEL(g_playerId) > 0) - { - PLAYER::SET_PLAYER_WANTED_LEVEL(g_playerId, 0, true); - PLAYER::SET_MAX_WANTED_LEVEL(0); - } - else if (!bNeverWanted && bNeverWanted != bLastNeverWanted) - { - PLAYER::SET_MAX_WANTED_LEVEL(5); - } - - bLastNeverWanted = bNeverWanted; - }QUEUE_JOB_END_CLAUSE + bLastNeverWanted = bNeverWanted; } } \ No newline at end of file diff --git a/BigBaseV2/src/features/looped/self/no_ragdoll.cpp b/BigBaseV2/src/features/looped/self/no_ragdoll.cpp index 6cce032e..74585320 100644 --- a/BigBaseV2/src/features/looped/self/no_ragdoll.cpp +++ b/BigBaseV2/src/features/looped/self/no_ragdoll.cpp @@ -1,25 +1,23 @@ -#include "features.hpp" +#include "features/self.hpp" +#include "natives.hpp" namespace big { static bool bLastNoRagdoll = false; - void features::no_ragdoll() + void self::no_ragdoll() { bool bNoRagdoll = g_settings.options["ragdoll"].get(); if (bNoRagdoll || (!bNoRagdoll && bNoRagdoll != bLastNoRagdoll)) { - QUEUE_JOB_BEGIN_CLAUSE(= ) - { - Ped player = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_playerId); + Ped player = PLAYER::PLAYER_PED_ID(); - PED::SET_PED_CAN_RAGDOLL(player, !bNoRagdoll); - PED::SET_PED_CAN_RAGDOLL_FROM_PLAYER_IMPACT(player, !bNoRagdoll); - PED::SET_PED_RAGDOLL_ON_COLLISION(player, !bNoRagdoll); - }QUEUE_JOB_END_CLAUSE + PED::SET_PED_CAN_RAGDOLL(player, !bNoRagdoll); + PED::SET_PED_CAN_RAGDOLL_FROM_PLAYER_IMPACT(player, !bNoRagdoll); + PED::SET_PED_RAGDOLL_ON_COLLISION(player, !bNoRagdoll); - bLastNoRagdoll = bNoRagdoll; + bLastNoRagdoll = bNoRagdoll; } } } \ No newline at end of file diff --git a/BigBaseV2/src/features/looped/self/noclip.cpp b/BigBaseV2/src/features/looped/self/noclip.cpp index ddcd7f83..89a0d12c 100644 --- a/BigBaseV2/src/features/looped/self/noclip.cpp +++ b/BigBaseV2/src/features/looped/self/noclip.cpp @@ -1,4 +1,6 @@ -#include "features.hpp" +#include "features/self.hpp" +#include "features/functions.hpp" +#include "natives.hpp" namespace big { @@ -8,13 +10,13 @@ namespace big static bool bLastNoClip; - void features::noclip() + void self::noclip() { bool bNoclip = g_settings.options["noclip"]["enabled"]; float fHorizontal = g_settings.options["noclip"]["horizontal"]; float fVertical = g_settings.options["noclip"]["vertical"]; - Entity ent = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_playerId); + Entity ent = PLAYER::PLAYER_PED_ID(); bool inVehicle = PED::IS_PED_IN_ANY_VEHICLE(ent, true); if (inVehicle) ent = PED::GET_VEHICLE_PED_IS_IN(ent, false); diff --git a/BigBaseV2/src/features/looped/self/off_radar.cpp b/BigBaseV2/src/features/looped/self/off_radar.cpp index 96da5d01..82a95e02 100644 --- a/BigBaseV2/src/features/looped/self/off_radar.cpp +++ b/BigBaseV2/src/features/looped/self/off_radar.cpp @@ -1,20 +1,18 @@ -#include "features.hpp" +#include "features/self.hpp" +#include "natives.hpp" #include "script_global.hpp" namespace big { - void features::off_radar() + void self::off_radar() { if (g_settings.options["off_radar"].get()) { - QUEUE_JOB_BEGIN_CLAUSE() + if (PLAYER::IS_PLAYER_ONLINE()) { - if (PLAYER::IS_PLAYER_ONLINE()) - { - *script_global(2425869).at(1 + (g_playerId * 443)).at(204).as() = 1; - *script_global(2440049).at(70).as() = NETWORK::GET_NETWORK_TIME() + 999; - } - }QUEUE_JOB_END_CLAUSE + *script_global(2425869).at(g_player.id, 443).at(204).as() = 1; + *script_global(2440049).at(70).as() = NETWORK::GET_NETWORK_TIME() + 999; + } } } } \ No newline at end of file diff --git a/BigBaseV2/src/features/looped/self/spoof_rank.cpp b/BigBaseV2/src/features/looped/self/spoof_rank.cpp index 23922f85..7c379c31 100644 --- a/BigBaseV2/src/features/looped/self/spoof_rank.cpp +++ b/BigBaseV2/src/features/looped/self/spoof_rank.cpp @@ -1,18 +1,14 @@ -#include "features.hpp" +#include "features/self.hpp" +#include "features/functions.hpp" #include "script_global.hpp" namespace big { - void features::spoof_rank() + void self::spoof_rank() { bool bSpoofRank = g_settings.options["spoof_rank"].get(); if (bSpoofRank) - { - QUEUE_JOB_BEGIN_CLAUSE() - { - func::spoof_rank(g_settings.options["rank"].get()); - }QUEUE_JOB_END_CLAUSE - } + func::spoof_rank(g_settings.options["rank"].get()); } } \ No newline at end of file diff --git a/BigBaseV2/src/features/looped/self/super_sprint.cpp b/BigBaseV2/src/features/looped/self/super_sprint.cpp index e2ee1322..918f5140 100644 --- a/BigBaseV2/src/features/looped/self/super_sprint.cpp +++ b/BigBaseV2/src/features/looped/self/super_sprint.cpp @@ -1,13 +1,14 @@ -#include "features.hpp" +#include "features/self.hpp" +#include "natives.hpp" namespace big { static bool bLastSuperSprint = false; static bool bSkyDiving = false; - void features::super_sprint() + void self::super_sprint() { - Ped player = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_playerId); + Ped player = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_player.id); if (PED::IS_PED_IN_ANY_VEHICLE(player, true)) return; @@ -15,39 +16,22 @@ namespace big if (bSuperSprint) { - float height = ENTITY::GET_ENTITY_HEIGHT_ABOVE_GROUND(player); - - bool flying = height > 5; - if (flying && !bSkyDiving) - { - TASK::TASK_SKY_DIVE(player, true); - - bSkyDiving = true; - } - else if (!flying && bSkyDiving) - { - bSkyDiving = false; - flying = false; - - TASK::TASK_SKY_DIVE(player, false); - } - - if (TASK::IS_PED_SPRINTING(player) || flying) + if (TASK::IS_PED_SPRINTING(player)) { Vector3 offset = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(player, 0, 0.6, 0); ENTITY::APPLY_FORCE_TO_ENTITY(player, 1, 0.0f, 1.3, bSkyDiving ? 1.f : 0.f, 0.0f, 0.0f, 0.0f, 0, 1, 1, 1, 0, 1); - PLAYER::SET_PLAYER_SPRINT(g_playerId, 1); - PLAYER::SET_RUN_SPRINT_MULTIPLIER_FOR_PLAYER(g_playerId, 1.49); + PLAYER::SET_PLAYER_SPRINT(g_player.id, 1); + PLAYER::SET_RUN_SPRINT_MULTIPLIER_FOR_PLAYER(g_player.id, 1.49); } else { - PLAYER::SET_RUN_SPRINT_MULTIPLIER_FOR_PLAYER(g_playerId, 1.0); + PLAYER::SET_RUN_SPRINT_MULTIPLIER_FOR_PLAYER(g_player.id, 1.0); } } else if (!bSuperSprint && bSuperSprint != bLastSuperSprint) { - PLAYER::SET_RUN_SPRINT_MULTIPLIER_FOR_PLAYER(g_playerId, 1.0); + PLAYER::SET_RUN_SPRINT_MULTIPLIER_FOR_PLAYER(g_player.id, 1.0); } bLastSuperSprint = bSuperSprint; diff --git a/BigBaseV2/src/features/looped/system/update_player_structs.cpp b/BigBaseV2/src/features/looped/system/update_player_structs.cpp index b3ff00cd..0b88aa63 100644 --- a/BigBaseV2/src/features/looped/system/update_player_structs.cpp +++ b/BigBaseV2/src/features/looped/system/update_player_structs.cpp @@ -1,51 +1,50 @@ +#include "features/sys.hpp" #include -#include "features.hpp" +#include "fiber_pool.hpp" +#include "script.hpp" namespace big { - static bool busy = false; - - void features::update_player_structs() + void sys::update_player_structs() { - if (busy) return; + player players[32]; - QUEUE_JOB_BEGIN_CLAUSE() + for (uint8_t i = 0; i < 32; i++) { - busy = true; - player players[32]; - - for (uint8_t i = 0; i < 32; i++) + if (NETWORK::NETWORK_IS_PLAYER_CONNECTED(i)) { - if (NETWORK::NETWORK_IS_PLAYER_CONNECTED(i)) - { - // if (!g_players[i].is_online) features::join_message((Player)i); + // if (!g_players[i].is_online) features::join_message((Player)i); - players[i].id = i; - players[i].is_online = true; + players[i].id = i; + players[i].is_online = true; - int iNetworkHandle[26]; - NETWORK::NETWORK_HANDLE_FROM_PLAYER(i, &iNetworkHandle[0], 13); - NETWORK::NETWORK_IS_HANDLE_VALID(&iNetworkHandle[0], 13) && NETWORK::NETWORK_IS_FRIEND(&iNetworkHandle[0]); + int iNetworkHandle[26]; + NETWORK::NETWORK_HANDLE_FROM_PLAYER(i, &iNetworkHandle[0], 13); + NETWORK::NETWORK_IS_HANDLE_VALID(&iNetworkHandle[0], 13) && NETWORK::NETWORK_IS_FRIEND(&iNetworkHandle[0]); - players[i].is_friend = NETWORK::NETWORK_IS_HANDLE_VALID(iNetworkHandle, 13) && NETWORK::NETWORK_IS_FRIEND(iNetworkHandle); + players[i].is_friend = NETWORK::NETWORK_IS_HANDLE_VALID(iNetworkHandle, 13) && NETWORK::NETWORK_IS_FRIEND(iNetworkHandle); - strcpy(players[i].name, PLAYER::GET_PLAYER_NAME(i)); - } - else - { - players[i].is_online = false; - players[i].is_friend = false; - } - - script::get_current()->yield(); + strcpy(players[i].name, PLAYER::GET_PLAYER_NAME(i)); + } + else + { + players[i].is_online = false; + players[i].is_friend = false; } - std::sort(std::begin(players), std::end(players)); + script::get_current()->yield(); + } - for (uint8_t i = 0; i < 32; i++) - g_players[i] = players[i]; + std::sort(std::begin(players), std::end(players)); - busy = false; - }QUEUE_JOB_END_CLAUSE + g_players.clear(); + for (uint8_t i = 0; i < 32; i++) + { + player player = players[i]; + + if (player.id == PLAYER::PLAYER_ID()) g_player = player; + + g_players.emplace(player.id, player); + } } } \ No newline at end of file diff --git a/BigBaseV2/src/features/looped/system/update_screen_sizes.cpp b/BigBaseV2/src/features/looped/system/update_screen_sizes.cpp index c374db3f..07e60c64 100644 --- a/BigBaseV2/src/features/looped/system/update_screen_sizes.cpp +++ b/BigBaseV2/src/features/looped/system/update_screen_sizes.cpp @@ -1,12 +1,13 @@ -#include "features.hpp" +#include "features/sys.hpp" +#include "fiber_pool.hpp" namespace big { - void features::update_screen_sizes() + void sys::update_screen_sizes() { - QUEUE_JOB_BEGIN_CLAUSE() + g_fiber_pool->queue_job([] { GRAPHICS::_GET_ACTIVE_SCREEN_RESOLUTION(&x, &y); - }QUEUE_JOB_END_CLAUSE + }); } } \ No newline at end of file diff --git a/BigBaseV2/src/features/looped/tunables/disable_phone.cpp b/BigBaseV2/src/features/looped/tunables/disable_phone.cpp index 901d28f4..2d3f3ef7 100644 --- a/BigBaseV2/src/features/looped/tunables/disable_phone.cpp +++ b/BigBaseV2/src/features/looped/tunables/disable_phone.cpp @@ -1,9 +1,9 @@ -#include "features.hpp" +#include "features/tunables.hpp" #include "script_global.hpp" namespace big { - void features::disable_phone() + void tunables::disable_phone() { if (g_settings.options["disable_phone"]) *script_global(19664).as() = 1; diff --git a/BigBaseV2/src/features/looped/tunables/no_idle_kick.cpp b/BigBaseV2/src/features/looped/tunables/no_idle_kick.cpp index 9180b57a..33549a94 100644 --- a/BigBaseV2/src/features/looped/tunables/no_idle_kick.cpp +++ b/BigBaseV2/src/features/looped/tunables/no_idle_kick.cpp @@ -1,9 +1,9 @@ -#include "features.hpp" +#include "features/tunables.hpp" #include "script_global.hpp" namespace big { - void features::no_idle_kick() + void tunables::no_idle_kick() { bool bNoIdleKick = g_settings.options["no_idle_kick"].get(); diff --git a/BigBaseV2/src/features/looped/util/spectate_player.cpp b/BigBaseV2/src/features/looped/util/spectate_player.cpp index 11c57342..14dadd04 100644 --- a/BigBaseV2/src/features/looped/util/spectate_player.cpp +++ b/BigBaseV2/src/features/looped/util/spectate_player.cpp @@ -1,14 +1,16 @@ -#include "features.hpp" +#include "features/util.hpp" #include "pointers.hpp" +#include "natives.hpp" namespace big { static bool bReset = true; - void features::spectate_player() + + void util::spectate_player() { - if (g_selectedPlayerId == -1 || !g_selectedPlayer.is_online || !g_temp.spectate_player) + if (g_selectedPlayer.id == -1 || !g_selectedPlayer.is_online || !g_temp.is_spectating) { - if (g_temp.spectate_player) g_temp.spectate_player = false; + if (g_temp.is_spectating) g_temp.is_spectating = false; if (!bReset) { @@ -20,7 +22,7 @@ namespace big return; } - g_pointers->m_spectate_player(true, PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_selectedPlayerId)); + g_pointers->m_spectate_player(true, PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_selectedPlayer.id)); bReset = false; } diff --git a/BigBaseV2/src/features/looped/vehicle/handling.cpp b/BigBaseV2/src/features/looped/vehicle/handling.cpp index 7511c29e..d7aea8e9 100644 --- a/BigBaseV2/src/features/looped/vehicle/handling.cpp +++ b/BigBaseV2/src/features/looped/vehicle/handling.cpp @@ -1,17 +1,18 @@ -#include "features.hpp" +#include "features/vehicle.hpp" #include "gta_util.hpp" +#include "natives.hpp" namespace big { static Vehicle veh = -1; - void features::handling() + void vehicle::handling() { CPed* ped = gta_util::get_local_ped(); - g_in_vehicle = ped->m_in_vehicle == 0; + g_temp.in_vehicle = ped->m_in_vehicle == 0; - if (g_in_vehicle) + if (g_temp.in_vehicle) { Vehicle currVeh = PED::GET_VEHICLE_PED_IS_IN(PLAYER::PLAYER_PED_ID(), false); if (veh != currVeh && ped->m_vehicle != nullptr) diff --git a/BigBaseV2/src/features/looped/vehicle/no_bike_fall.cpp b/BigBaseV2/src/features/looped/vehicle/no_bike_fall.cpp index 8c83ff02..fc41a336 100644 --- a/BigBaseV2/src/features/looped/vehicle/no_bike_fall.cpp +++ b/BigBaseV2/src/features/looped/vehicle/no_bike_fall.cpp @@ -1,14 +1,17 @@ -#include "features.hpp" +#include "features/vehicle.hpp" +#include "natives.hpp" namespace big { - void features::no_bike_fall() + static bool bLastNoBikeFall = false; + + void vehicle::no_bike_fall() { bool bNoBikeFall = g_settings.options["no_bike_fall"].get(); - QUEUE_JOB_BEGIN_CLAUSE(= ) - { + if (bNoBikeFall || bLastNoBikeFall != bNoBikeFall) PED::SET_PED_CAN_BE_KNOCKED_OFF_VEHICLE(PLAYER::PLAYER_PED_ID(), bNoBikeFall); - }QUEUE_JOB_END_CLAUSE + + bLastNoBikeFall = bNoBikeFall; } } \ No newline at end of file diff --git a/BigBaseV2/src/features/looped/vehicle/speedo_meter.cpp b/BigBaseV2/src/features/looped/vehicle/speedo_meter.cpp index 89891cfb..e7cc43ab 100644 --- a/BigBaseV2/src/features/looped/vehicle/speedo_meter.cpp +++ b/BigBaseV2/src/features/looped/vehicle/speedo_meter.cpp @@ -1,8 +1,9 @@ -#include "features.hpp" +#include "features/vehicle.hpp" +#include "natives.hpp" namespace big { - void features::speedo_meter() + void vehicle::speedo_meter() { static const float x = .9f; static const float y = .72f; @@ -11,7 +12,7 @@ namespace big if (speedo_type == 0 || HUD::IS_PAUSE_MENU_ACTIVE()) return; - Vehicle veh = PED::GET_VEHICLE_PED_IS_IN(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_playerId), false); + Vehicle veh = PED::GET_VEHICLE_PED_IS_IN(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_player.id), false); if (veh == 0) return; diff --git a/BigBaseV2/src/features/looped/vehicle/sticky_tyres.cpp b/BigBaseV2/src/features/looped/vehicle/sticky_tyres.cpp index 7a3703e7..3d075ecc 100644 --- a/BigBaseV2/src/features/looped/vehicle/sticky_tyres.cpp +++ b/BigBaseV2/src/features/looped/vehicle/sticky_tyres.cpp @@ -1,28 +1,22 @@ -#include "features.hpp" +#include "features/vehicle.hpp" +#include "features/functions.hpp" +#include "natives.hpp" +#include "script.hpp" namespace big { - void features::sticky_tyres() + void vehicle::sticky_tyres() { if (g_settings.options["sticky_tyres"].get()) { - QUEUE_JOB_BEGIN_CLAUSE() + Vehicle veh = PED::GET_VEHICLE_PED_IS_IN(PLAYER::PLAYER_PED_ID(), false); + + if (veh) { + func::take_control_of_entity(veh); - Vehicle veh = PED::GET_VEHICLE_PED_IS_IN(PLAYER::PLAYER_PED_ID(), false); - - if (veh) - { - while (!NETWORK::NETWORK_HAS_CONTROL_OF_ENTITY(veh)) - { - NETWORK::NETWORK_REQUEST_CONTROL_OF_ENTITY(veh); - - script::get_current()->yield(); - } - - VEHICLE::SET_VEHICLE_ON_GROUND_PROPERLY(veh, 5.f); - } - }QUEUE_JOB_END_CLAUSE + VEHICLE::SET_VEHICLE_ON_GROUND_PROPERLY(veh, 5.f); + } } } } \ No newline at end of file diff --git a/BigBaseV2/src/features/looped/world/population_modifiers.cpp b/BigBaseV2/src/features/looped/world/population_modifiers.cpp index c8c6ae6a..6d87b5f9 100644 --- a/BigBaseV2/src/features/looped/world/population_modifiers.cpp +++ b/BigBaseV2/src/features/looped/world/population_modifiers.cpp @@ -1,8 +1,9 @@ -#include "features.hpp" +#include "features/world.hpp" +#include "natives.hpp" namespace big { - void features::population_modifiers() + void world::population_modifiers() { auto& population = g_settings.options["world"]["population"]; diff --git a/BigBaseV2/src/features/notify.cpp b/BigBaseV2/src/features/notify.cpp index 552c7c1d..f79f49b8 100644 --- a/BigBaseV2/src/features/notify.cpp +++ b/BigBaseV2/src/features/notify.cpp @@ -1,8 +1,9 @@ #include "notify.hpp" +#include "natives.hpp" -namespace big::features::notify +namespace big { - void above_map(const char* text) + void notify::above_map(const char* text) { HUD::SET_TEXT_OUTLINE(); HUD::BEGIN_TEXT_COMMAND_THEFEED_POST("STRING"); diff --git a/BigBaseV2/src/features/notify.hpp b/BigBaseV2/src/features/notify.hpp index a2ba9c90..36de713d 100644 --- a/BigBaseV2/src/features/notify.hpp +++ b/BigBaseV2/src/features/notify.hpp @@ -1,7 +1,14 @@ #pragma once -#include "natives.hpp" +#include "common.hpp" -namespace big::features::notify +namespace big { - void above_map(const char* text); + class notify + { + public: + static void above_map(const char* text); + + private: + + }; } \ No newline at end of file diff --git a/BigBaseV2/src/features/protections.cpp b/BigBaseV2/src/features/protections.cpp new file mode 100644 index 00000000..98d6a2fb --- /dev/null +++ b/BigBaseV2/src/features/protections.cpp @@ -0,0 +1,21 @@ +#include "protections.hpp" +#include "fiber_pool.hpp" +#include "script.hpp" + +namespace big +{ + static bool busy = false; + + void protections::loop() + { + if (busy) return; + busy = true; + + QUEUE_JOB_BEGIN_CLAUSE() + { + replay_interface(); + + busy = false; + }QUEUE_JOB_END_CLAUSE + } +} \ No newline at end of file diff --git a/BigBaseV2/src/features/protections.hpp b/BigBaseV2/src/features/protections.hpp new file mode 100644 index 00000000..2f7da977 --- /dev/null +++ b/BigBaseV2/src/features/protections.hpp @@ -0,0 +1,15 @@ +#pragma once +#include "common.hpp" + +namespace big +{ + class protections + { + public: + static void loop(); + + private: + static void replay_interface(); + + }; +} \ No newline at end of file diff --git a/BigBaseV2/src/features/self.cpp b/BigBaseV2/src/features/self.cpp new file mode 100644 index 00000000..80f0bbad --- /dev/null +++ b/BigBaseV2/src/features/self.cpp @@ -0,0 +1,27 @@ +#include "self.hpp" +#include "fiber_pool.hpp" +#include "script.hpp" + +namespace big +{ + static bool busy = false; + + void self::loop() + { + if (busy) return; + busy = true; + + QUEUE_JOB_BEGIN_CLAUSE() + { + god_mode(); + never_wanted(); + no_ragdoll(); + noclip(); + off_radar(); + spoof_rank(); + super_sprint(); + + busy = false; + }QUEUE_JOB_END_CLAUSE + } +} \ No newline at end of file diff --git a/BigBaseV2/src/features/self.hpp b/BigBaseV2/src/features/self.hpp new file mode 100644 index 00000000..625643d0 --- /dev/null +++ b/BigBaseV2/src/features/self.hpp @@ -0,0 +1,21 @@ +#pragma once +#include "common.hpp" + +namespace big +{ + class self + { + public: + static void loop(); + + private: + static void god_mode(); + static void never_wanted(); + static void no_ragdoll(); + static void noclip(); + static void off_radar(); + static void spoof_rank(); + static void super_sprint(); + + }; +} \ No newline at end of file diff --git a/BigBaseV2/src/features/stats.cpp b/BigBaseV2/src/features/stats.cpp index 1a47c7e5..88ea0ef5 100644 --- a/BigBaseV2/src/features/stats.cpp +++ b/BigBaseV2/src/features/stats.cpp @@ -1,8 +1,9 @@ #include "stats.hpp" -#include "script.hpp" #include "gta/joaat.hpp" +#include "natives.hpp" +#include "script.hpp" -namespace big::features +namespace big { static const char character_stats[][64] = { "MP%d_SCRIPT_INCREASE_STAM", diff --git a/BigBaseV2/src/features/stats.hpp b/BigBaseV2/src/features/stats.hpp index 66628ba1..d7651ed6 100644 --- a/BigBaseV2/src/features/stats.hpp +++ b/BigBaseV2/src/features/stats.hpp @@ -1,9 +1,7 @@ #pragma once -#include "natives.hpp" -#include "script.hpp" -#include "fiber_pool.hpp" +#include "common.hpp" -namespace big::features +namespace big { class stats { diff --git a/BigBaseV2/src/features/sys.cpp b/BigBaseV2/src/features/sys.cpp new file mode 100644 index 00000000..296d0cbb --- /dev/null +++ b/BigBaseV2/src/features/sys.cpp @@ -0,0 +1,22 @@ +#include "sys.hpp" +#include "fiber_pool.hpp" +#include "script.hpp" + +namespace big +{ + static bool busy = false; + + void sys::loop() + { + if (busy) return; + busy = true; + + QUEUE_JOB_BEGIN_CLAUSE() + { + update_player_structs(); + update_screen_sizes(); + + busy = false; + }QUEUE_JOB_END_CLAUSE + } +} \ No newline at end of file diff --git a/BigBaseV2/src/features/sys.hpp b/BigBaseV2/src/features/sys.hpp new file mode 100644 index 00000000..fa7fd7c7 --- /dev/null +++ b/BigBaseV2/src/features/sys.hpp @@ -0,0 +1,17 @@ +#pragma once +#include "common.hpp" +#include "natives.hpp" + +namespace big +{ + class sys + { + public: + static void loop(); + + private: + static void update_player_structs(); + static void update_screen_sizes(); + + }; +} \ No newline at end of file diff --git a/BigBaseV2/src/features/teleport.cpp b/BigBaseV2/src/features/teleport.cpp index 5464cdf9..ec3ded72 100644 --- a/BigBaseV2/src/features/teleport.cpp +++ b/BigBaseV2/src/features/teleport.cpp @@ -1,8 +1,11 @@ #include "teleport.hpp" +#include "natives.hpp" +#include "notify.hpp" +#include "script.hpp" -namespace big::features::teleport +namespace big { - bool load_ground_at_3dcoord(Vector3 location) + bool teleport::load_ground_at_3dcoord(Vector3 location) { float groundZ; uint8_t attempts = 10; @@ -25,7 +28,7 @@ namespace big::features::teleport return false; } - Vector3 get_ground_at_3dcoord(Vector3 location) + Vector3 teleport::get_ground_at_3dcoord(Vector3 location) { float groundZ; uint8_t attempts = 10; @@ -54,7 +57,7 @@ namespace big::features::teleport return location; } - bool bring_blip(int blipSprite, int blipColor, int flag) + bool teleport::bring_blip(int blipSprite, int blipColor, int flag) { Blip blipHandle = HUD::GET_FIRST_BLIP_INFO_ID(blipSprite); while (HUD::DOES_BLIP_EXIST(blipHandle) && (blipColor != -1 && HUD::GET_BLIP_COLOUR(blipHandle) != blipColor)) @@ -78,14 +81,14 @@ namespace big::features::teleport script::get_current()->yield(); } - Ped player = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_playerId); + Ped player = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_player.id); location = ENTITY::GET_ENTITY_COORDS(player, true); ENTITY::SET_ENTITY_COORDS(veh, location.x, location.y, location.z + 1.f, 0, 0, 0, true); if (!VEHICLE::ARE_ANY_VEHICLE_SEATS_FREE(veh)) { - features::notify::above_map("The vehicle is full."); + notify::above_map("The vehicle is full."); ENTITY::SET_ENTITY_COORDS(player, location.x, location.y, location.z + 3.f, 0, 0, 0, true); } else @@ -96,9 +99,9 @@ namespace big::features::teleport return true; } - bool teleport_to_blip(int blipSprite, int blipColor) + bool teleport::teleport_to_blip(int blipSprite, int blipColor) { - Ped player = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_playerId); + Ped player = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_player.id); Blip blipHandle = HUD::GET_FIRST_BLIP_INFO_ID(blipSprite); while (HUD::DOES_BLIP_EXIST(blipHandle) && (blipColor != -1 && HUD::GET_BLIP_COLOUR(blipHandle) != blipColor)) @@ -117,13 +120,13 @@ namespace big::features::teleport return true; } - void teleport_into_player_vehicle(Player player) + void teleport::teleport_into_player_vehicle(Player player) { Ped target = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(player); if (!PED::IS_PED_IN_ANY_VEHICLE(target, true)) { - features::notify::above_map("This player is not in a vehicle right now."); + notify::above_map("This player is not in a vehicle right now."); return; } @@ -133,14 +136,14 @@ namespace big::features::teleport for (uint8_t i = 0; !load_ground_at_3dcoord(location); i++) if (i == 5) break; - Ped current = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_playerId); + Ped current = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_player.id); Vehicle veh; for (veh = 0; !veh; veh = PED::GET_VEHICLE_PED_IS_IN(target, false)) { if (!PED::IS_PED_IN_ANY_VEHICLE(target, true)) { - features::notify::above_map("Player is no longer in a vehicle."); + notify::above_map("Player is no longer in a vehicle."); return; } @@ -161,20 +164,20 @@ namespace big::features::teleport PED::SET_PED_INTO_VEHICLE(current, veh, seatIndex); } - void teleport_to_player(Player player) + void teleport::teleport_to_player(Player player) { Ped target = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(player); Vector3 location = ENTITY::GET_ENTITY_COORDS(target, true); load_ground_at_3dcoord(location); - PED::SET_PED_COORDS_KEEP_VEHICLE(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_playerId), location.x, location.y, location.z); + PED::SET_PED_COORDS_KEEP_VEHICLE(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_player.id), location.x, location.y, location.z); } // Teleport the player (with/without car to a waypoint) - bool waypoint() + bool teleport::waypoint() { - Ped player = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_playerId); + Ped player = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_player.id); Blip blipHandle = HUD::GET_FIRST_BLIP_INFO_ID(8); if (!HUD::DOES_BLIP_EXIST(blipHandle)) return false; diff --git a/BigBaseV2/src/features/teleport.hpp b/BigBaseV2/src/features/teleport.hpp index 0642a034..487e8ae2 100644 --- a/BigBaseV2/src/features/teleport.hpp +++ b/BigBaseV2/src/features/teleport.hpp @@ -1,15 +1,20 @@ #pragma once -#include "features.hpp" -#include "natives.hpp" -#include "script.hpp" +#include "common.hpp" -namespace big::features::teleport +namespace big { - bool bring_blip(int blipSprite, int blipColor, int flag = 70); - bool load_ground_at_3dcoord(Vector3 location); - Vector3 get_ground_at_3dcoord(Vector3 location); - bool teleport_to_blip(int blipSprite, int blipColor = -1); - void teleport_into_player_vehicle(Player player); - void teleport_to_player(Player player); - bool waypoint(); + class teleport + { + public: + static bool bring_blip(int blipSprite, int blipColor, int flag = 70); + static bool load_ground_at_3dcoord(Vector3 location); + static Vector3 get_ground_at_3dcoord(Vector3 location); + static bool teleport_to_blip(int blipSprite, int blipColor = -1); + static void teleport_into_player_vehicle(Player player); + static void teleport_to_player(Player player); + static bool waypoint(); + + private: + + }; } \ No newline at end of file diff --git a/BigBaseV2/src/features/tunables.cpp b/BigBaseV2/src/features/tunables.cpp new file mode 100644 index 00000000..74ea7c03 --- /dev/null +++ b/BigBaseV2/src/features/tunables.cpp @@ -0,0 +1,10 @@ +#include "tunables.hpp" + +namespace big +{ + void tunables::loop() + { + disable_phone(); + no_idle_kick(); + } +} \ No newline at end of file diff --git a/BigBaseV2/src/features/tunables.hpp b/BigBaseV2/src/features/tunables.hpp new file mode 100644 index 00000000..6eebd09e --- /dev/null +++ b/BigBaseV2/src/features/tunables.hpp @@ -0,0 +1,16 @@ +#pragma once +#include "common.hpp" + +namespace big +{ + class tunables + { + public: + static void loop(); + + private: + static void disable_phone(); + static void no_idle_kick(); + + }; +} \ No newline at end of file diff --git a/BigBaseV2/src/features/util.cpp b/BigBaseV2/src/features/util.cpp new file mode 100644 index 00000000..4fe4647e --- /dev/null +++ b/BigBaseV2/src/features/util.cpp @@ -0,0 +1,21 @@ +#include "util.hpp" +#include "fiber_pool.hpp" +#include "script.hpp" + +namespace big +{ + static bool busy = false; + + void util::loop() + { + if (busy) return; + busy = true; + + QUEUE_JOB_BEGIN_CLAUSE() + { + spectate_player(); + + busy = false; + }QUEUE_JOB_END_CLAUSE + } +} \ No newline at end of file diff --git a/BigBaseV2/src/features/util.hpp b/BigBaseV2/src/features/util.hpp new file mode 100644 index 00000000..7d969b2f --- /dev/null +++ b/BigBaseV2/src/features/util.hpp @@ -0,0 +1,14 @@ +#pragma once + +namespace big +{ + class util + { + public: + static void loop(); + + private: + static void spectate_player(); + + }; +} \ No newline at end of file diff --git a/BigBaseV2/src/features/vehicle.cpp b/BigBaseV2/src/features/vehicle.cpp new file mode 100644 index 00000000..d41749c3 --- /dev/null +++ b/BigBaseV2/src/features/vehicle.cpp @@ -0,0 +1,24 @@ +#include "vehicle.hpp" +#include "fiber_pool.hpp" +#include "script.hpp" + +namespace big +{ + static bool busy = false; + + void vehicle::loop() + { + if (busy) return; + busy = true; + + QUEUE_JOB_BEGIN_CLAUSE() + { + handling(); + no_bike_fall(); + speedo_meter(); + sticky_tyres(); + + busy = false; + }QUEUE_JOB_END_CLAUSE + } +} \ No newline at end of file diff --git a/BigBaseV2/src/features/vehicle.hpp b/BigBaseV2/src/features/vehicle.hpp new file mode 100644 index 00000000..65c3cc6c --- /dev/null +++ b/BigBaseV2/src/features/vehicle.hpp @@ -0,0 +1,18 @@ +#pragma once +#include "common.hpp" + +namespace big +{ + class vehicle + { + public: + static void loop(); + + private: + static void handling(); + static void no_bike_fall(); + static void speedo_meter(); + static void sticky_tyres(); + + }; +} \ No newline at end of file diff --git a/BigBaseV2/src/features/world.cpp b/BigBaseV2/src/features/world.cpp new file mode 100644 index 00000000..3d25f9c8 --- /dev/null +++ b/BigBaseV2/src/features/world.cpp @@ -0,0 +1,21 @@ +#include "world.hpp" +#include "fiber_pool.hpp" +#include "script.hpp" + +namespace big +{ + static bool busy = false; + + void world::loop() + { + if (busy) return; + busy = true; + + QUEUE_JOB_BEGIN_CLAUSE() + { + population_modifiers(); + + busy = false; + }QUEUE_JOB_END_CLAUSE + } +} \ No newline at end of file diff --git a/BigBaseV2/src/features/world.hpp b/BigBaseV2/src/features/world.hpp new file mode 100644 index 00000000..16767f5f --- /dev/null +++ b/BigBaseV2/src/features/world.hpp @@ -0,0 +1,15 @@ +#pragma once +#include "common.hpp" + +namespace big +{ + class world + { + public: + static void loop(); + + private: + static void population_modifiers(); + + }; +} \ No newline at end of file diff --git a/BigBaseV2/src/gui.cpp b/BigBaseV2/src/gui.cpp index cb8427d8..b2164d3f 100644 --- a/BigBaseV2/src/gui.cpp +++ b/BigBaseV2/src/gui.cpp @@ -135,7 +135,7 @@ namespace big g_custom_text->add_text(RAGE_JOAAT("HUD_SAVDNWARN"), "Rockstar crashed their toaster again..."); - features::notify::above_map("Yim's Menu is ready."); + notify::above_map("Yim's Menu is ready."); } void gui::script_on_tick() diff --git a/BigBaseV2/src/gui/tab_bar/main/misc.cpp b/BigBaseV2/src/gui/tab_bar/main/misc.cpp index f36b2582..18fcde36 100644 --- a/BigBaseV2/src/gui/tab_bar/main/misc.cpp +++ b/BigBaseV2/src/gui/tab_bar/main/misc.cpp @@ -1,4 +1,6 @@ #include "gui/tab_bar.hpp" +#include "features/functions.hpp" +#include "features/stats.hpp" #include "natives.hpp" namespace big @@ -21,7 +23,7 @@ namespace big { QUEUE_JOB_BEGIN_CLAUSE() { - features::stats::unlock_achievements(); + stats::unlock_achievements(); }QUEUE_JOB_END_CLAUSE } @@ -32,7 +34,7 @@ namespace big int character_index; func::get_active_character_slot(&character_index); - features::stats::max_stats(character_index); + stats::max_stats(character_index); }QUEUE_JOB_END_CLAUSE } @@ -40,7 +42,7 @@ namespace big { QUEUE_JOB_BEGIN_CLAUSE() { - features::stats::unlock_all(); + stats::unlock_all(); }QUEUE_JOB_END_CLAUSE } diff --git a/BigBaseV2/src/gui/tab_bar/main/online.cpp b/BigBaseV2/src/gui/tab_bar/main/online.cpp index 02f5e08e..7c2fedec 100644 --- a/BigBaseV2/src/gui/tab_bar/main/online.cpp +++ b/BigBaseV2/src/gui/tab_bar/main/online.cpp @@ -1,4 +1,5 @@ #include "gui/tab_bar.hpp" +#include "features/functions.hpp" #include "pointers.hpp" #include "script_global.hpp" diff --git a/BigBaseV2/src/gui/tab_bar/main/self.cpp b/BigBaseV2/src/gui/tab_bar/main/self.cpp index f7b9cc01..a8a6e7be 100644 --- a/BigBaseV2/src/gui/tab_bar/main/self.cpp +++ b/BigBaseV2/src/gui/tab_bar/main/self.cpp @@ -10,7 +10,7 @@ namespace big { QUEUE_JOB_BEGIN_CLAUSE() { - Entity player = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_playerId); + Entity player = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_player.id); ENTITY::SET_ENTITY_HEALTH(player, ENTITY::GET_ENTITY_MAX_HEALTH(player), 0); }QUEUE_JOB_END_CLAUSE @@ -20,7 +20,7 @@ namespace big { QUEUE_JOB_BEGIN_CLAUSE() { - ENTITY::SET_ENTITY_HEALTH(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_playerId), 0, 0); + ENTITY::SET_ENTITY_HEALTH(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_player.id), 0, 0); }QUEUE_JOB_END_CLAUSE } @@ -79,18 +79,18 @@ namespace big { QUEUE_JOB_BEGIN_CLAUSE() { - PLAYER::CLEAR_PLAYER_WANTED_LEVEL(g_playerId); + PLAYER::CLEAR_PLAYER_WANTED_LEVEL(g_player.id); }QUEUE_JOB_END_CLAUSE } if (ImGui::Button("Cops Ignore")) { QUEUE_JOB_BEGIN_CLAUSE() { - if (PLAYER::GET_PLAYER_WANTED_LEVEL(g_playerId) > 0) + if (PLAYER::GET_PLAYER_WANTED_LEVEL(g_player.id) > 0) { - PLAYER::CLEAR_PLAYER_WANTED_LEVEL(g_playerId); + PLAYER::CLEAR_PLAYER_WANTED_LEVEL(g_player.id); } - PLAYER::SET_POLICE_IGNORE_PLAYER(g_playerId, true); + PLAYER::SET_POLICE_IGNORE_PLAYER(g_player.id, true); }QUEUE_JOB_END_CLAUSE } @@ -103,8 +103,8 @@ namespace big { QUEUE_JOB_BEGIN_CLAUSE(= ) { - PLAYER::SET_PLAYER_WANTED_LEVEL(g_playerId, g_temp.wanted_level, true); - PLAYER::SET_PLAYER_WANTED_LEVEL_NOW(g_playerId, true); + PLAYER::SET_PLAYER_WANTED_LEVEL(g_player.id, g_temp.wanted_level, true); + PLAYER::SET_PLAYER_WANTED_LEVEL_NOW(g_player.id, true); }QUEUE_JOB_END_CLAUSE } } diff --git a/BigBaseV2/src/gui/tab_bar/main/settings.cpp b/BigBaseV2/src/gui/tab_bar/main/settings.cpp index 381075d2..3be39119 100644 --- a/BigBaseV2/src/gui/tab_bar/main/settings.cpp +++ b/BigBaseV2/src/gui/tab_bar/main/settings.cpp @@ -1,4 +1,5 @@ #include "gui/tab_bar.hpp" +#include "features/functions.hpp" #include "pointers.hpp" namespace big diff --git a/BigBaseV2/src/gui/tab_bar/main/spawn.cpp b/BigBaseV2/src/gui/tab_bar/main/spawn.cpp index 2f337ee4..d79bcc90 100644 --- a/BigBaseV2/src/gui/tab_bar/main/spawn.cpp +++ b/BigBaseV2/src/gui/tab_bar/main/spawn.cpp @@ -1,4 +1,5 @@ #include "gui/tab_bar.hpp" +#include "features/functions.hpp" #include "pointers.hpp" namespace big @@ -21,7 +22,7 @@ namespace big { QUEUE_JOB_BEGIN_CLAUSE(= ) { - Ped player = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_playerId); + Ped player = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_player.id); Vector3 location = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(player, .0, 8.0, .5); func::spawn_vehicle((const char*)model, location, ENTITY::GET_ENTITY_HEADING(player) + 90.f); diff --git a/BigBaseV2/src/gui/tab_bar/main/teleport.cpp b/BigBaseV2/src/gui/tab_bar/main/teleport.cpp index ff1ab245..ecef8f5a 100644 --- a/BigBaseV2/src/gui/tab_bar/main/teleport.cpp +++ b/BigBaseV2/src/gui/tab_bar/main/teleport.cpp @@ -1,4 +1,6 @@ #include "gui/tab_bar.hpp" +#include "features/notify.hpp" +#include "features/teleport.hpp" namespace big { @@ -10,13 +12,13 @@ namespace big { QUEUE_JOB_BEGIN_CLAUSE() { - if (features::teleport::waypoint()) + if (teleport::waypoint()) { - features::notify::above_map("You've been teleported."); + notify::above_map("You've been teleported."); } else { - features::notify::above_map("No waypoint set."); + notify::above_map("No waypoint set."); } } QUEUE_JOB_END_CLAUSE } @@ -25,7 +27,7 @@ namespace big { QUEUE_JOB_BEGIN_CLAUSE() { - features::teleport::teleport_to_blip(1, 5); + teleport::teleport_to_blip(1, 5); }QUEUE_JOB_END_CLAUSE } @@ -35,7 +37,7 @@ namespace big { QUEUE_JOB_BEGIN_CLAUSE() { - features::teleport::teleport_to_blip(225); + teleport::teleport_to_blip(225); }QUEUE_JOB_END_CLAUSE } ImGui::SameLine(); @@ -43,7 +45,7 @@ namespace big { QUEUE_JOB_BEGIN_CLAUSE() { - features::teleport::bring_blip(225, 0); + teleport::bring_blip(225, 0); }QUEUE_JOB_END_CLAUSE } diff --git a/BigBaseV2/src/gui/tab_bar/main/vehicle.cpp b/BigBaseV2/src/gui/tab_bar/main/vehicle.cpp index 2f7bb5a5..5f3bc03c 100644 --- a/BigBaseV2/src/gui/tab_bar/main/vehicle.cpp +++ b/BigBaseV2/src/gui/tab_bar/main/vehicle.cpp @@ -1,4 +1,6 @@ #include "gui/tab_bar.hpp" +#include "features/notify.hpp" +#include "features/teleport.hpp" #include "gta_util.hpp" namespace big @@ -41,7 +43,7 @@ namespace big ImGui::Separator(); - ImGui::Checkbox("Handling", &g_handling_window); + ImGui::Checkbox("Handling", &g_temp.windows.handling); ImGui::Separator(); @@ -53,14 +55,14 @@ namespace big Vehicle veh = PED::GET_VEHICLE_PED_IS_IN(PLAYER::PLAYER_PED_ID(), false); if (!veh) - features::notify::above_map("~r~Make sure you are in a vehicle."); + notify::above_map("~r~Make sure you are in a vehicle."); else if (!HUD::DOES_BLIP_EXIST(blipHandle)) - features::notify::above_map("~r~Waypoint needs to be set."); + notify::above_map("~r~Waypoint needs to be set."); else { Vector3 location = HUD::GET_BLIP_COORDS(blipHandle); // Make sure the AI can reach this - location = features::teleport::get_ground_at_3dcoord(location); + location = teleport::get_ground_at_3dcoord(location); TASK::TASK_VEHICLE_DRIVE_TO_COORD(PLAYER::PLAYER_PED_ID(), veh, location.x, location.y, location.z, 35.f, 0, veh, 2883620, 10.f, true); } @@ -89,13 +91,13 @@ namespace big { QUEUE_JOB_BEGIN_CLAUSE() { - Vehicle veh = PED::GET_VEHICLE_PED_IS_IN(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_playerId), false); + Vehicle veh = PED::GET_VEHICLE_PED_IS_IN(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_player.id), false); if (veh) { VEHICLE::SET_VEHICLE_FIXED(veh); - features::notify::above_map("Vehicle has been repaired."); + notify::above_map("Vehicle has been repaired."); } }QUEUE_JOB_END_CLAUSE } @@ -104,13 +106,13 @@ namespace big { QUEUE_JOB_BEGIN_CLAUSE() { - Vehicle veh = PED::GET_VEHICLE_PED_IS_IN(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_playerId), false); + Vehicle veh = PED::GET_VEHICLE_PED_IS_IN(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_player.id), false); if (veh) { VEHICLE::SET_VEHICLE_DIRT_LEVEL(veh, 0.0); - features::notify::above_map("Vehicle has been cleaned."); + notify::above_map("Vehicle has been cleaned."); } }QUEUE_JOB_END_CLAUSE } @@ -119,7 +121,7 @@ namespace big { QUEUE_JOB_BEGIN_CLAUSE() { - Vehicle veh = PED::GET_VEHICLE_PED_IS_IN(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_playerId), false); + Vehicle veh = PED::GET_VEHICLE_PED_IS_IN(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_player.id), false); if (veh) { diff --git a/BigBaseV2/src/gui/tab_bar/player/drop.cpp b/BigBaseV2/src/gui/tab_bar/player/drop.cpp index 72ccf060..d1a4841a 100644 --- a/BigBaseV2/src/gui/tab_bar/player/drop.cpp +++ b/BigBaseV2/src/gui/tab_bar/player/drop.cpp @@ -1,4 +1,5 @@ #include "gui/tab_bar.hpp" +#include "features/functions.hpp" namespace big { diff --git a/BigBaseV2/src/gui/tab_bar/player/griefing.cpp b/BigBaseV2/src/gui/tab_bar/player/griefing.cpp index 5b9aa8ed..f780a596 100644 --- a/BigBaseV2/src/gui/tab_bar/player/griefing.cpp +++ b/BigBaseV2/src/gui/tab_bar/player/griefing.cpp @@ -1,4 +1,6 @@ #include "gui/tab_bar.hpp" +#include "features/functions.hpp" +#include "features/notify.hpp" #include "pointers.hpp" #include "script_global.hpp" @@ -41,7 +43,7 @@ namespace big } else { - features::notify::above_map("You aren't the host"); + notify::above_map("You aren't the host"); } }QUEUE_JOB_END_CLAUSE } diff --git a/BigBaseV2/src/gui/tab_bar/player/info.cpp b/BigBaseV2/src/gui/tab_bar/player/info.cpp index 3c735480..76788c7f 100644 --- a/BigBaseV2/src/gui/tab_bar/player/info.cpp +++ b/BigBaseV2/src/gui/tab_bar/player/info.cpp @@ -6,7 +6,7 @@ namespace big { if (ImGui::BeginTabItem("Info")) { - ImGui::Checkbox("Spectate Player", &g_temp.spectate_player); + ImGui::Checkbox("Spectate Player", &g_temp.is_spectating); ImGui::EndTabItem(); } diff --git a/BigBaseV2/src/gui/tab_bar/player/teleport.cpp b/BigBaseV2/src/gui/tab_bar/player/teleport.cpp index 442a3bac..0d5a4113 100644 --- a/BigBaseV2/src/gui/tab_bar/player/teleport.cpp +++ b/BigBaseV2/src/gui/tab_bar/player/teleport.cpp @@ -1,4 +1,5 @@ #include "gui/tab_bar.hpp" +#include "features/teleport.hpp" namespace big { @@ -10,7 +11,7 @@ namespace big { QUEUE_JOB_BEGIN_CLAUSE() { - features::teleport::teleport_to_player(g_selectedPlayer.id); + teleport::teleport_to_player(g_selectedPlayer.id); }QUEUE_JOB_END_CLAUSE } @@ -18,7 +19,7 @@ namespace big { QUEUE_JOB_BEGIN_CLAUSE() { - features::teleport::teleport_into_player_vehicle(g_selectedPlayer.id); + teleport::teleport_into_player_vehicle(g_selectedPlayer.id); }QUEUE_JOB_END_CLAUSE } diff --git a/BigBaseV2/src/gui/window.hpp b/BigBaseV2/src/gui/window.hpp index 7dff3f13..b5e6948c 100644 --- a/BigBaseV2/src/gui/window.hpp +++ b/BigBaseV2/src/gui/window.hpp @@ -1,4 +1,5 @@ #pragma once +#include "common.hpp" #include "imgui.h" namespace big diff --git a/BigBaseV2/src/gui/windows/handling.cpp b/BigBaseV2/src/gui/windows/handling.cpp index 58971791..17f8c225 100644 --- a/BigBaseV2/src/gui/windows/handling.cpp +++ b/BigBaseV2/src/gui/windows/handling.cpp @@ -7,9 +7,9 @@ namespace big void window::render_handling_window() { ImGui::SetNextWindowSize({ 500, 780 }, ImGuiCond_FirstUseEver); - if (g_handling_window && ImGui::Begin("Handling", &g_handling_window)) + if (g_temp.windows.handling && ImGui::Begin("Handling", &g_temp.windows.handling)) { - if (g_in_vehicle && g_vehicle != nullptr) + if (g_temp.in_vehicle && g_vehicle != nullptr) { ImGui::BeginTabBar("handling_tabbar"); tabbar::handling_physics(); diff --git a/BigBaseV2/src/gui/windows/player.cpp b/BigBaseV2/src/gui/windows/player.cpp index 4aaacad1..272c1e46 100644 --- a/BigBaseV2/src/gui/windows/player.cpp +++ b/BigBaseV2/src/gui/windows/player.cpp @@ -5,7 +5,7 @@ namespace big { void window::render_player_window() { - if (g_selectedPlayer.id != g_selectedPlayerId || !g_selectedPlayer.is_online) return; + if (g_selectedPlayer.id != g_selectedPlayer.id || !g_selectedPlayer.is_online) return; char title[64]; strcpy(title, "Player Options: "); @@ -13,13 +13,8 @@ namespace big strcat(title, "###player_options"); ImGui::SetNextWindowSize({ 350.f, 300.f }, ImGuiCond_FirstUseEver); - if (ImGui::Begin(title)) + if (g_temp.windows.player && ImGui::Begin(title, &g_temp.windows.player)) { - if (ImGui::Button("Close")) - { - g_selectedPlayerId = -2; - } - ImGui::BeginTabBar("tabbar_player"); tabbar::player_info(); tabbar::player_griefing(); diff --git a/BigBaseV2/src/gui/windows/top_bar.cpp b/BigBaseV2/src/gui/windows/top_bar.cpp index 473c567c..c343179d 100644 --- a/BigBaseV2/src/gui/windows/top_bar.cpp +++ b/BigBaseV2/src/gui/windows/top_bar.cpp @@ -1,34 +1,26 @@ #include "gui/window.hpp" -#include "features.hpp" +#include "features/functions.hpp" +#include "features/notify.hpp" #include "natives.hpp" #include "script.hpp" #include "fiber_pool.hpp" -#include "structs/lists.hpp" namespace big { - static char* player_name = ""; - void window::render_top_bar() { if (ImGui::BeginMainMenuBar()) { if (ImGui::BeginMenu("Info")) { - if (strlen(player_name) == 0) - QUEUE_JOB_BEGIN_CLAUSE(&) - { - player_name = (char*)PLAYER::GET_PLAYER_NAME(g_playerId); - }QUEUE_JOB_END_CLAUSE - - ImGui::MenuItem("Logged in as:", NULL, false, false); - ImGui::MenuItem(player_name, NULL, false, false); + ImGui::MenuItem("Logged in as:", NULL, false, false); + ImGui::MenuItem(g_player.name, NULL, false, false); if (ImGui::MenuItem("Am I lobby host?")) { QUEUE_JOB_BEGIN_CLAUSE() { - features::notify::above_map(NETWORK::NETWORK_IS_HOST() ? "~g~Yes you are the host." : "You aren't the host."); + notify::above_map(NETWORK::NETWORK_IS_HOST() ? "~g~Yes you are the host." : "You aren't the host."); } QUEUE_JOB_END_CLAUSE @@ -38,7 +30,7 @@ namespace big { QUEUE_JOB_BEGIN_CLAUSE() { - features::notify::above_map(NETWORK::NETWORK_PLAYER_IS_BADSPORT() ? "You have been ~r~reported multiple times!" : "Your account is in good standing."); + notify::above_map(NETWORK::NETWORK_PLAYER_IS_BADSPORT() ? "You have been ~r~reported multiple times!" : "Your account is in good standing."); } QUEUE_JOB_END_CLAUSE } @@ -55,7 +47,7 @@ namespace big if (CUTSCENE::IS_CUTSCENE_ACTIVE()) CUTSCENE::STOP_CUTSCENE_IMMEDIATELY(); else - features::notify::above_map("There's no cutscene active at the moment."); + notify::above_map("There's no cutscene active at the moment."); } QUEUE_JOB_END_CLAUSE } diff --git a/BigBaseV2/src/gui/windows/user_sidebar.cpp b/BigBaseV2/src/gui/windows/user_sidebar.cpp index d29c1687..030aa465 100644 --- a/BigBaseV2/src/gui/windows/user_sidebar.cpp +++ b/BigBaseV2/src/gui/windows/user_sidebar.cpp @@ -16,16 +16,10 @@ namespace big ImGui::TextColored({ 255,255,255,255 }, "YOU:"); - for (uint8_t i = 0; i < 32; i++) + if (ImGui::Button(g_player.name, vecButtonWidth)) { - player player = g_players[i]; - - if (player.id == g_playerId) g_currentPlayer = player; - } - if (ImGui::Button(g_currentPlayer.name, vecButtonWidth)) - { - g_selectedPlayer = g_currentPlayer; - g_selectedPlayerId = g_currentPlayer.id; + g_selectedPlayer = g_player; + g_temp.windows.player = true; } ImGui::Separator(); @@ -36,9 +30,9 @@ namespace big bool friendInLobby = false; - for (int i = 0; i < 32; i++) + for (auto& pair : g_players) { - player player = g_players[i]; + player player = pair.second; if (player.is_friend && player.is_online) { @@ -47,7 +41,7 @@ namespace big if (ImGui::Button(player.name, vecButtonWidth)) { g_selectedPlayer = player; - g_selectedPlayerId = player.id; + g_temp.windows.player = true; } } } @@ -66,16 +60,16 @@ namespace big { ImGui::Unindent(); - for (int i = 0; i < 32; i++) + for (auto& pair : g_players) { - player player = g_players[i]; + player player = pair.second; - if (!player.is_friend && player.is_online && player.id != g_playerId) + if (!player.is_friend && player.is_online && player.id != g_player.id) { if (ImGui::Button(player.name, vecButtonWidth)) { g_selectedPlayer = player; - g_selectedPlayerId = player.id; + g_temp.windows.player = true; } } } diff --git a/BigBaseV2/src/hooks/get_event_data.cpp b/BigBaseV2/src/hooks/get_event_data.cpp index e4a9f3f6..9fd65e51 100644 --- a/BigBaseV2/src/hooks/get_event_data.cpp +++ b/BigBaseV2/src/hooks/get_event_data.cpp @@ -1,4 +1,5 @@ #include "features.hpp" +#include "features/notify.hpp" #include "hooking.hpp" #include "pointers.hpp" #include "natives.hpp" @@ -140,7 +141,7 @@ namespace big strcat(msg, "\nEvent Type: ~b~"); strcat(msg, type); - features::notify::above_map(msg); + notify::above_map(msg); return false; } diff --git a/BigBaseV2/src/hooks/increment_stat_event.cpp b/BigBaseV2/src/hooks/increment_stat_event.cpp index beb0493f..13ef9cc4 100644 --- a/BigBaseV2/src/hooks/increment_stat_event.cpp +++ b/BigBaseV2/src/hooks/increment_stat_event.cpp @@ -21,7 +21,7 @@ namespace big strcat(report, PLAYER::GET_PLAYER_NAME(sender_id)); strcat(report, ""); - features::notify::above_map(report); + notify::above_map(report); return true; } diff --git a/BigBaseV2/src/hooks/script_event_handler.cpp b/BigBaseV2/src/hooks/script_event_handler.cpp index 9225a992..05954520 100644 --- a/BigBaseV2/src/hooks/script_event_handler.cpp +++ b/BigBaseV2/src/hooks/script_event_handler.cpp @@ -1,8 +1,9 @@ #include "hooking.hpp" #include "features.hpp" +#include "features/notify.hpp" +#include "gta/enums.hpp" #include "pointers.hpp" #include "natives.hpp" -#include "gta/enums.hpp" namespace big { @@ -21,7 +22,7 @@ namespace big char join_msg[128]; sprintf(join_msg, "%s is joining...", g_pointers->m_get_player_name((Player)args[1])); - features::notify::above_map(join_msg); + notify::above_map(join_msg); } } diff --git a/BigBaseV2/src/structs/temp.hpp b/BigBaseV2/src/structs/temp.hpp index 04d4201d..d7f721c6 100644 --- a/BigBaseV2/src/structs/temp.hpp +++ b/BigBaseV2/src/structs/temp.hpp @@ -2,21 +2,32 @@ namespace big { - struct game_time - { - int hour = 0; - int minutes = 0; - }; - struct temp { + struct game_time + { + int hour = 0; + int minutes = 0; + }; + + struct window + { + bool handling = false; + bool player = false; + }; + + bool in_vehicle = false; + bool is_spectating = false; + int character_slot = 0; + int set_level = 0; int spoofed_rank = 0; - game_time time = game_time{}; - bool spectate_player = false; int teleport_location = 0; int wanted_level = 0; int weather_type = 0; + + game_time time = game_time{}; + window windows = window{}; }; } \ No newline at end of file