diff --git a/BigBaseV2/src/services/gui/gui_service.hpp b/BigBaseV2/src/services/gui/gui_service.hpp index b99b0966..9e0fac6a 100644 --- a/BigBaseV2/src/services/gui/gui_service.hpp +++ b/BigBaseV2/src/services/gui/gui_service.hpp @@ -25,6 +25,7 @@ namespace big WORLD, SPAWN_PED, + TIME_AND_WEATHER, NETWORK, SESSION, @@ -74,6 +75,7 @@ namespace big }}}, { tabs::WORLD, { "World", nullptr, { { tabs::SPAWN_PED, { "Spawn Ped", view::spawn_ped }}, + { tabs::TIME_AND_WEATHER, { "Time And Weather", view::time_and_weather }}, }}}, {tabs::NETWORK, { "Network", nullptr, { { tabs::SPOOFING, { "Spoofing", view::spoofing }}, diff --git a/BigBaseV2/src/util/globals.hpp b/BigBaseV2/src/util/globals.hpp index 356a7b1b..2083e93f 100644 --- a/BigBaseV2/src/util/globals.hpp +++ b/BigBaseV2/src/util/globals.hpp @@ -4,6 +4,16 @@ namespace big::globals { + namespace size + { + constexpr int globalplayer_bd = 453; + constexpr int gpbd_fm_3 = 599; + constexpr int gpbd_fm_1 = 888; + } + + static inline script_global gpbd_fm_3(1892703); + static inline script_global gsbd_fm_events(1920255); + inline void clear_wanted_player(Player target) { constexpr size_t arg_count = 3; @@ -20,4 +30,4 @@ namespace big::globals { *script_global(2815059).at(6753).as() = toggle; // "TRI_WARP" 2nd nested if statement below this text in freemode.c } -} \ No newline at end of file +} diff --git a/BigBaseV2/src/util/session.hpp b/BigBaseV2/src/util/session.hpp index 417ae981..7251d582 100644 --- a/BigBaseV2/src/util/session.hpp +++ b/BigBaseV2/src/util/session.hpp @@ -3,6 +3,8 @@ #include "script_global.hpp" #include "script.hpp" #include "natives.hpp" +#include "util/misc.hpp" +#include "util/globals.hpp" #include "gta/joaat.hpp" #include "rage/rlSessionByGamerTaskResult.hpp" #include "pointers.hpp" @@ -37,6 +39,22 @@ namespace big::session *script_global(262145).at(4723).as() = g->session.local_weather == 13; } + inline void set_fm_event_index(int index) + { + int idx = index / 32; + int bit = index % 32; + misc::set_bit(globals::gsbd_fm_events.at(11).at(341).at(idx, 1).as(), bit); + misc::set_bit(globals::gsbd_fm_events.at(11).at(348).at(idx, 1).as(), bit); + misc::set_bit(globals::gpbd_fm_3.at(self::id, globals::size::gpbd_fm_3).at(10).at(205).at(idx, 1).as(), bit); + } + + inline void force_thunder() + { + session::set_fm_event_index(9); + session::set_fm_event_index(10); + session::set_fm_event_index(11); + } + inline void join_by_rockstar_id(uint64_t rid) { if (SCRIPT::GET_NUMBER_OF_THREADS_RUNNING_THE_SCRIPT_WITH_THIS_HASH(RAGE_JOAAT("maintransition")) != 0 || diff --git a/BigBaseV2/src/views/network/view_session.cpp b/BigBaseV2/src/views/network/view_session.cpp index 986a2d0b..9765a3a7 100644 --- a/BigBaseV2/src/views/network/view_session.cpp +++ b/BigBaseV2/src/views/network/view_session.cpp @@ -25,37 +25,5 @@ namespace big } ImGui::EndListBox(); } - if (ImGui::TreeNode("Local Time")) - { - ImGui::Checkbox("Override Time", &g->session.override_time); - - if (g->session.override_time) - { - ImGui::SliderInt("Hour", &g->session.custom_time.hour, 0, 23); - ImGui::SliderInt("Minute", &g->session.custom_time.minute, 0, 59); - ImGui::SliderInt("Second", &g->session.custom_time.second, 0, 59); - } - - ImGui::TreePop(); - } - if (ImGui::TreeNode("Local Weather")) - { - components::button("Clear Override", [] - { - MISC::CLEAR_OVERRIDE_WEATHER(); - }); - - if(ImGui::ListBox("", &g->session.local_weather, session::weathers, 15)) - { - g_fiber_pool->queue_job([] - { - session::local_weather(); - }); - - ImGui::ListBoxFooter(); - } - - ImGui::TreePop(); - } } } diff --git a/BigBaseV2/src/views/view.hpp b/BigBaseV2/src/views/view.hpp index 27f3a636..6df5afdd 100644 --- a/BigBaseV2/src/views/view.hpp +++ b/BigBaseV2/src/views/view.hpp @@ -38,6 +38,7 @@ namespace big static void persist_car(); static void fun_vehicle(); static void spawn_ped(); + static void time_and_weather(); static void spoofing(); static void teleport(); static void view_player(); diff --git a/BigBaseV2/src/views/world/view_time_and_weather.cpp b/BigBaseV2/src/views/world/view_time_and_weather.cpp new file mode 100644 index 00000000..5eed7260 --- /dev/null +++ b/BigBaseV2/src/views/world/view_time_and_weather.cpp @@ -0,0 +1,48 @@ +#include "views/view.hpp" +#include "fiber_pool.hpp" +#include "util/session.hpp" + +namespace big +{ + void view::time_and_weather() + { + if (ImGui::TreeNode("Local Time")) + { + ImGui::Checkbox("Override Time", &g->session.override_time); + + if (g->session.override_time) + { + ImGui::SliderInt("Hour", &g->session.custom_time.hour, 0, 23); + ImGui::SliderInt("Minute", &g->session.custom_time.minute, 0, 59); + ImGui::SliderInt("Second", &g->session.custom_time.second, 0, 59); + } + + ImGui::TreePop(); + } + + if (ImGui::TreeNode("Local Weather")) + { + components::button("Clear Override", [] + { + MISC::CLEAR_OVERRIDE_WEATHER(); + }); + + if (ImGui::ListBox("", &g->session.local_weather, session::weathers, 15)) + { + g_fiber_pool->queue_job([] + { + session::local_weather(); + }); + + ImGui::ListBoxFooter(); + } + + ImGui::TreePop(); + } + + components::button("Force Thunder", [] + { + session::force_thunder(); + }); + } +}