diff --git a/src/backend/commands/player/misc/enter_interior.cpp b/src/backend/commands/player/misc/enter_interior.cpp index dad6e6f8..db32b1fe 100644 --- a/src/backend/commands/player/misc/enter_interior.cpp +++ b/src/backend/commands/player/misc/enter_interior.cpp @@ -33,11 +33,11 @@ namespace big } else if (scr_globals::globalplayer_bd.as()->Entries[id].SimpleInteriorData.Index != eSimpleInteriorIndex::SIMPLE_INTERIOR_INVALID) { - *script_global(1950844).at(3347).as() = + *scr_globals::interiors.at(3347).as() = scr_globals::globalplayer_bd.as()->Entries[id].SimpleInteriorData.Owner; - *script_global(1950844).at(3684).as() = + *scr_globals::interiors.at(3684).as() = scr_globals::globalplayer_bd.as()->Entries[id].SimpleInteriorData.Index; - *script_global(1950844).at(3683).as() = true; + *scr_globals::interiors.at(3683).as() = true; scr_globals::globalplayer_bd.as()->Entries[self::id].SimpleInteriorData.InteriorSubtype = scr_globals::globalplayer_bd.as()->Entries[id].SimpleInteriorData.InteriorSubtype; } diff --git a/src/backend/looped/self/dance_mode.cpp b/src/backend/looped/self/dance_mode.cpp index 2d744d32..c33fea6c 100644 --- a/src/backend/looped/self/dance_mode.cpp +++ b/src/backend/looped/self/dance_mode.cpp @@ -60,7 +60,7 @@ namespace big if (g.self.dance_mode && g.m_dance_thread->m_handler) { - *script_global(1950837).as() = true; + *scr_globals::dance_state.as() = TRUE; //Never once do the scripts read this as a boolean. It seems to be some kind of state the player is in. Runs from 4 to 35. scr_functions::dance_loop.call(g.m_dance_thread, g.m_dance_program, {}); } } diff --git a/src/backend/looped/self/off_radar.cpp b/src/backend/looped/self/off_radar.cpp index 8b9068e1..b456bf0f 100644 --- a/src/backend/looped/self/off_radar.cpp +++ b/src/backend/looped/self/off_radar.cpp @@ -14,15 +14,15 @@ namespace big virtual void on_tick() override { if (g.self.ghost_org) - MISC::SET_BIT(script_global(2794162).at(4667).as(), 2); + MISC::SET_BIT(scr_globals::freemode_global.at(4667).as(), 2); scr_globals::globalplayer_bd.as()->Entries[self::id].OffRadarActive = true; - *scr_globals::offradar_time.at(57).as() = NETWORK::GET_NETWORK_TIME() + 1; + *scr_globals::freemode_properties.at(57).as() = NETWORK::GET_NETWORK_TIME() + 1; } virtual void on_disable() override { if (!g.self.ghost_org) - MISC::CLEAR_BIT(script_global(2794162).at(4667).as(), 2); + MISC::CLEAR_BIT(scr_globals::freemode_global.at(4667).as(), 2); scr_globals::globalplayer_bd.as()->Entries[self::id].OffRadarActive = false; } }; diff --git a/src/backend/looped/tunables/disable_phone.cpp b/src/backend/looped/tunables/disable_phone.cpp index 9e37283b..ad6c043f 100644 --- a/src/backend/looped/tunables/disable_phone.cpp +++ b/src/backend/looped/tunables/disable_phone.cpp @@ -10,12 +10,12 @@ namespace big virtual void on_tick() override { - *script_global(20483).as() = true; + *scr_globals::mobile.as() = TRUE; } virtual void on_disable() override { - *script_global(20483).as() = false; + *scr_globals::mobile.as() = FALSE; } }; diff --git a/src/core/scr_globals.hpp b/src/core/scr_globals.hpp index d8557873..ee1c9579 100644 --- a/src/core/scr_globals.hpp +++ b/src/core/scr_globals.hpp @@ -14,6 +14,7 @@ namespace big::scr_globals static inline const script_global globalplayer_bd(2657704); static inline const script_global gpbd_fm_3(1895156); static inline const script_global gpbd_fm_1(1853988); + static inline const script_global interiors(1950844); static inline const script_global launcher_global(2756336); @@ -32,15 +33,32 @@ namespace big::scr_globals static inline const script_global sctv_spectator(2695969); // pausemenu_multiplayer function 0xE49C42EC static inline const script_global vehicle_global(1586488); - static inline const script_global mechanic_global(2794162); + + static inline const script_global freemode_properties(2672524); + static inline const script_global freemode_global(2794162); static inline const script_global spawn_global(2694613); - static inline const script_global offradar_time(2672524); - static inline const script_global session_info(1654054); static inline const script_global tuneables(262145); + + static inline const script_global dance_state(1950837); + + static inline const script_global mobile(20483); + + static inline const script_global transaction_overlimit(20483); + + static inline const script_global stats(2359296); + + static inline const script_global session(1574589); + static inline const script_global session2(1575020); + static inline const script_global session3(32284); + static inline const script_global session4(1574934); + static inline const script_global session5(1574995); + static inline const script_global session6(2694534); + + static inline const script_global gooch(1890378); } namespace big::scr_locals diff --git a/src/native_hooks/shop_controller.hpp b/src/native_hooks/shop_controller.hpp index a83c3112..52047379 100644 --- a/src/native_hooks/shop_controller.hpp +++ b/src/native_hooks/shop_controller.hpp @@ -1,6 +1,6 @@ #pragma once #include "native_hooks.hpp" -#include "script_global.hpp" +#include "core/scr_globals.hpp" namespace big { @@ -15,7 +15,7 @@ namespace big if (g.notifications.transaction_rate_limit.notify) g_notification_service->push_warning("Transaction Rate Limit", "You're receiving transaction rate limits, whatever you're doing do it less."); - *script_global(4536677).as() = 0; + *scr_globals::transaction_overlimit.as() = FALSE; return; } diff --git a/src/util/mobile.hpp b/src/util/mobile.hpp index 18c5378c..7d7e6fdb 100644 --- a/src/util/mobile.hpp +++ b/src/util/mobile.hpp @@ -7,14 +7,12 @@ #include "natives.hpp" #include "notify.hpp" #include "script.hpp" -#include "script_global.hpp" +#include "core/scr_globals.hpp" #include "script_local.hpp" #include "vehicle.hpp" namespace big::mobile { - inline auto player_global = script_global(2657704); - namespace util { int get_current_personal_vehicle(); // forward declare @@ -25,7 +23,7 @@ namespace big::mobile inline int get_current_personal_vehicle() { - return *script_global(2359296).at(0, 5568).at(681).at(2).as(); + return *scr_globals::stats.at(0, 5568).at(681).at(2).as(); } } @@ -33,27 +31,27 @@ namespace big::mobile { inline void request_ammo_drop() { - *script_global(scr_globals::mechanic_global).at(891).as() = 1; + *scr_globals::freemode_global.at(891).as() = 1; } inline void request_boat_pickup() { - *script_global(scr_globals::mechanic_global).at(892).as() = 1; + *scr_globals::freemode_global.at(892).as() = 1; } inline void request_helicopter_pickup() { - *script_global(scr_globals::mechanic_global).at(893).as() = 1; + *scr_globals::freemode_global.at(893).as() = 1; } inline void request_backup_helicopter() { - *script_global(scr_globals::mechanic_global).at(4491).as() = 1; + *scr_globals::freemode_global.at(4491).as() = 1; } inline void request_airstrike() { - *script_global(scr_globals::mechanic_global).at(4492).as() = 1; + *scr_globals::freemode_global.at(4492).as() = 1; } } @@ -92,12 +90,12 @@ namespace big::mobile { inline void request_bullshark_testosterone() { - *script_global(2672524).at(3690).as() = 1; + *scr_globals::freemode_properties.at(3690).as() = 1; } inline void request_ballistic_armor() //i think this is a ceo ability atleast? { - *script_global(scr_globals::mechanic_global).at(896).as() = 1; + *scr_globals::freemode_global.at(896).as() = 1; } } @@ -105,32 +103,32 @@ namespace big::mobile { inline void request_avenger() { - *script_global(scr_globals::mechanic_global).at(938).as() = 1; + *scr_globals::freemode_global.at(938).as() = 1; } inline void request_kosatka() { - *script_global(scr_globals::mechanic_global).at(960).as() = 1; + *scr_globals::freemode_global.at(960).as() = 1; } inline void request_mobile_operations_center() { - *script_global(scr_globals::mechanic_global).at(930).as() = 1; + *scr_globals::freemode_global.at(930).as() = 1; } inline void request_terrorbyte() { - *script_global(scr_globals::mechanic_global).at(943).as() = 1; + *scr_globals::freemode_global.at(943).as() = 1; } inline void request_acidlab() { - *script_global(scr_globals::mechanic_global).at(944).as() = 1; + *scr_globals::freemode_global.at(944).as() = 1; } inline void request_acidlab_bike() { - *script_global(scr_globals::mechanic_global).at(994).as() = 1; + *scr_globals::freemode_global.at(994).as() = 1; } } @@ -138,12 +136,12 @@ namespace big::mobile { inline Vehicle get_personal_vehicle() { - return *scr_globals::mechanic_global.at(299).as(); + return *scr_globals::freemode_global.at(299).as(); } inline void summon_vehicle_by_index(int veh_idx) { - if (*scr_globals::mechanic_global.at(985).as() != -1) + if (*scr_globals::freemode_global.at(985).as() != -1) return g_notification_service->push_warning("Vehicle", "Mechanic is not ready to deliver a vehicle right now."); if (g.clone_pv.spawn_inside && self::veh) @@ -158,11 +156,11 @@ namespace big::mobile // only do this when spawn inside is enabled otherwise the vehicle will spawn relatively far away from players if (g.clone_pv.spawn_inside) { - *scr_globals::mechanic_global.at(942).as() = 1; // disable vehicle node distance check + *scr_globals::freemode_global.at(942).as() = 1; // disable vehicle node distance check } - *scr_globals::mechanic_global.at(928).as() = 1; // tell freemode to spawn our vehicle - *scr_globals::mechanic_global.at(988).as() = 0; // required - *scr_globals::mechanic_global.at(985).as() = veh_idx; + *scr_globals::freemode_global.at(928).as() = 1; // tell freemode to spawn our vehicle + *scr_globals::freemode_global.at(988).as() = 0; // required + *scr_globals::freemode_global.at(985).as() = veh_idx; script::get_current()->yield(100ms); @@ -177,7 +175,7 @@ namespace big::mobile } // blocking call till vehicle is delivered - notify::busy_spinner("Delivering vehicle...", scr_globals::mechanic_global.at(985).as(), -1); + notify::busy_spinner("Delivering vehicle...", scr_globals::freemode_global.at(985).as(), -1); if (g.clone_pv.spawn_inside) { @@ -190,7 +188,7 @@ namespace big::mobile { inline void request_taxi() { - *script_global(scr_globals::mechanic_global).at(853).as() = 1; + *scr_globals::freemode_global.at(853).as() = 1; } } } diff --git a/src/util/outfit.hpp b/src/util/outfit.hpp index 7939a7a7..f83a4eb0 100644 --- a/src/util/outfit.hpp +++ b/src/util/outfit.hpp @@ -1,5 +1,5 @@ #pragma once -#include "script_global.hpp" +#include "core/scr_globals.hpp" namespace big::outfit { @@ -60,26 +60,26 @@ namespace big::outfit inline char* get_slot_name_address(int slot) { - return script_global(2359296).at(0, 5568).at(681).at(2460).at(slot, 8).as(); + return scr_globals::stats.at(0, 5568).at(681).at(2460).at(slot, 8).as(); } inline int* get_component_drawable_id_address(int slot, int id) { - return script_global(2359296).at(0, 5568).at(681).at(1336).at(slot, 13).at(id, 1).as(); + return scr_globals::stats.at(0, 5568).at(681).at(1336).at(slot, 13).at(id, 1).as(); } inline int* get_component_texture_id_address(int slot, int id) { - return script_global(2359296).at(0, 5568).at(681).at(1610).at(slot, 13).at(id, 1).as(); + return scr_globals::stats.at(0, 5568).at(681).at(1610).at(slot, 13).at(id, 1).as(); } inline int* get_prop_drawable_id_address(int slot, int id) { - return script_global(2359296).at(0, 5568).at(681).at(1884).at(slot, 10).at(id, 1).as(); + return scr_globals::stats.at(0, 5568).at(681).at(1884).at(slot, 10).at(id, 1).as(); } inline int* get_prop_texture_id_address(int slot, int id) { - return script_global(2359296).at(0, 5568).at(681).at(2095).at(slot, 10).at(id, 1).as(); + return scr_globals::stats.at(0, 5568).at(681).at(2095).at(slot, 10).at(id, 1).as(); } } \ No newline at end of file diff --git a/src/util/session.hpp b/src/util/session.hpp index 04b0c83a..06bf4686 100644 --- a/src/util/session.hpp +++ b/src/util/session.hpp @@ -9,7 +9,6 @@ #include "rage/rlSessionByGamerTaskResult.hpp" #include "script.hpp" #include "script_function.hpp" -#include "script_global.hpp" #include "services/api/api_service.hpp" #include "services/player_database/player_database_service.hpp" #include "services/players/player_service.hpp" @@ -45,14 +44,14 @@ namespace big::session *scr_globals::sctv_spectator.as() = (session == eSessionType::SC_TV ? 1 : 0); // If SCTV then enable spectator mode if (session == eSessionType::LEAVE_ONLINE) - *script_global(1574589).at(2).as() = -1; + *scr_globals::session.at(2).as() = -1; else { - *script_global(1574589).at(2).as() = 0; - *script_global(1575020).as() = (int)session; + *scr_globals::session.at(2).as() = 0; + *scr_globals::session2.as() = (int)session; } - *script_global(1574589).as() = 1; + *scr_globals::session.as() = 1; if (*g_pointers->m_gta.m_is_session_started && session != eSessionType::LEAVE_ONLINE) { @@ -64,15 +63,15 @@ namespace big::session } scr_functions::reset_session_data({true, true}); - *script_global(32284).as() = 0; - *script_global(1574934).as() = 1; - *script_global(1574995).as() = 32; + *scr_globals::session3.as() = 0; + *scr_globals::session4.as() = 1; + *scr_globals::session5.as() = 32; if (SCRIPT::GET_NUMBER_OF_THREADS_RUNNING_THE_SCRIPT_WITH_THIS_HASH(RAGE_JOAAT("maintransition")) == 0) { - *script_global(2694534).as() = 1; + *scr_globals::session6.as() = 1; script::get_current()->yield(200ms); - *script_global(1574589).as() = 0; + *scr_globals::session.as() = 0; } SCRIPT::SET_SCRIPT_WITH_NAME_HASH_AS_NO_LONGER_NEEDED(RAGE_JOAAT("pausemenu_multiplayer")); diff --git a/src/views/players/player/player_toxic.cpp b/src/views/players/player/player_toxic.cpp index c8bfe846..3bf714bf 100644 --- a/src/views/players/player/player_toxic.cpp +++ b/src/views/players/player/player_toxic.cpp @@ -20,7 +20,7 @@ namespace big components::player_command_button<"ceokick">(g_player_service->get_selected(), {}); ImGui::SameLine(); components::button("Gooch Test", [] { - *script_global(1890378).at(289).at(1).as() = g_player_service->get_selected()->id(); + *scr_globals::gooch.at(289).at(1).as() = g_player_service->get_selected()->id(); scripts::start_launcher_script(171); });