Move local time and weather to world submenu, add force thunder (#522)

This commit is contained in:
Quentin E. / iDeath 2022-10-26 20:27:15 +02:00 committed by GitHub
parent 839854a16b
commit 0188477573
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 80 additions and 33 deletions

View File

@ -25,6 +25,7 @@ namespace big
WORLD, WORLD,
SPAWN_PED, SPAWN_PED,
TIME_AND_WEATHER,
NETWORK, NETWORK,
SESSION, SESSION,
@ -74,6 +75,7 @@ namespace big
}}}, }}},
{ tabs::WORLD, { "World", nullptr, { { tabs::WORLD, { "World", nullptr, {
{ tabs::SPAWN_PED, { "Spawn Ped", view::spawn_ped }}, { tabs::SPAWN_PED, { "Spawn Ped", view::spawn_ped }},
{ tabs::TIME_AND_WEATHER, { "Time And Weather", view::time_and_weather }},
}}}, }}},
{tabs::NETWORK, { "Network", nullptr, { {tabs::NETWORK, { "Network", nullptr, {
{ tabs::SPOOFING, { "Spoofing", view::spoofing }}, { tabs::SPOOFING, { "Spoofing", view::spoofing }},

View File

@ -4,6 +4,16 @@
namespace big::globals 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) inline void clear_wanted_player(Player target)
{ {
constexpr size_t arg_count = 3; constexpr size_t arg_count = 3;

View File

@ -3,6 +3,8 @@
#include "script_global.hpp" #include "script_global.hpp"
#include "script.hpp" #include "script.hpp"
#include "natives.hpp" #include "natives.hpp"
#include "util/misc.hpp"
#include "util/globals.hpp"
#include "gta/joaat.hpp" #include "gta/joaat.hpp"
#include "rage/rlSessionByGamerTaskResult.hpp" #include "rage/rlSessionByGamerTaskResult.hpp"
#include "pointers.hpp" #include "pointers.hpp"
@ -37,6 +39,22 @@ namespace big::session
*script_global(262145).at(4723).as<bool*>() = g->session.local_weather == 13; *script_global(262145).at(4723).as<bool*>() = 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<int*>(), bit);
misc::set_bit(globals::gsbd_fm_events.at(11).at(348).at(idx, 1).as<int*>(), bit);
misc::set_bit(globals::gpbd_fm_3.at(self::id, globals::size::gpbd_fm_3).at(10).at(205).at(idx, 1).as<int*>(), 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) 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 || if (SCRIPT::GET_NUMBER_OF_THREADS_RUNNING_THE_SCRIPT_WITH_THIS_HASH(RAGE_JOAAT("maintransition")) != 0 ||

View File

@ -25,37 +25,5 @@ namespace big
} }
ImGui::EndListBox(); 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();
}
} }
} }

View File

@ -38,6 +38,7 @@ namespace big
static void persist_car(); static void persist_car();
static void fun_vehicle(); static void fun_vehicle();
static void spawn_ped(); static void spawn_ped();
static void time_and_weather();
static void spoofing(); static void spoofing();
static void teleport(); static void teleport();
static void view_player(); static void view_player();

View File

@ -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();
});
}
}