diff --git a/BigBaseV2/src/features.hpp b/BigBaseV2/src/features.hpp index 3b7feebb..c258c172 100644 --- a/BigBaseV2/src/features.hpp +++ b/BigBaseV2/src/features.hpp @@ -35,6 +35,7 @@ namespace big void off_radar(); void population_modifiers(); void reveal_players(); + void spectate_player(); void speedo_meter(); void spoof_rank(); void sticky_tyres(); diff --git a/BigBaseV2/src/features/looped/spectate_player.cpp b/BigBaseV2/src/features/looped/spectate_player.cpp new file mode 100644 index 00000000..7760ce20 --- /dev/null +++ b/BigBaseV2/src/features/looped/spectate_player.cpp @@ -0,0 +1,19 @@ +#include "features.hpp" +#include "pointers.hpp" + +namespace big +{ + void features::spectate_player() + { + if (g_selectedPlayer == -1 || !g_players[g_selectedPlayer].is_online || !g_temp.spectate_player) + { + if (g_temp.spectate_player) g_temp.spectate_player = false; + + g_pointers->m_spectate_player(false, -1); + + return; + } + + g_pointers->m_spectate_player(true, PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_selectedPlayer)); + } +} \ No newline at end of file diff --git a/BigBaseV2/src/function_types.hpp b/BigBaseV2/src/function_types.hpp index f19f698a..c577ca92 100644 --- a/BigBaseV2/src/function_types.hpp +++ b/BigBaseV2/src/function_types.hpp @@ -14,6 +14,7 @@ namespace big::functions using get_player_name = char*(Player player); using script_event_handler = bool(void* events, CNetGamePlayer* sourcePlayer, CNetGamePlayer* targetPlayer); using set_session_weather = void(char a1, int a2, int a3, int64_t a4); + using spectate_player = bool(bool toggle, Ped player); using sync_local_time = void(int h, int m); using trigger_script_event = int(bool unk0, uint64_t* args, int argCount, int bitFlags); } diff --git a/BigBaseV2/src/gui/player_window.cpp b/BigBaseV2/src/gui/player_window.cpp index 5b01d78a..3c571e8f 100644 --- a/BigBaseV2/src/gui/player_window.cpp +++ b/BigBaseV2/src/gui/player_window.cpp @@ -29,6 +29,11 @@ namespace big ImGui::Separator(); + if (ImGui::Checkbox("Spectate Player", &g_temp.spectate_player)) + ; + + ImGui::Separator(); + if (ImGui::Button("Teleport to Player")) { QUEUE_JOB_BEGIN_CLAUSE() diff --git a/BigBaseV2/src/pointers.cpp b/BigBaseV2/src/pointers.cpp index 19e65d7c..a2c8835c 100644 --- a/BigBaseV2/src/pointers.cpp +++ b/BigBaseV2/src/pointers.cpp @@ -107,6 +107,11 @@ namespace big { m_trigger_script_event = ptr.as(); }); + + main_batch.add("Spectate Player", "48 89 5C 24 ? 57 48 83 EC 20 41 8A F8 84 C9", [this](memory::handle ptr) + { + m_spectate_player = ptr.as(); + }); main_batch.run(memory::module(nullptr)); diff --git a/BigBaseV2/src/pointers.hpp b/BigBaseV2/src/pointers.hpp index 680b6fd0..0db67812 100644 --- a/BigBaseV2/src/pointers.hpp +++ b/BigBaseV2/src/pointers.hpp @@ -40,6 +40,7 @@ namespace big functions::increment_stat_event* m_increment_stat_event{}; functions::script_event_handler* m_script_event_handler{}; functions::set_session_weather* m_set_session_weather{}; + functions::spectate_player* m_spectate_player{}; functions::sync_local_time* m_sync_local_time{}; functions::trigger_script_event* m_trigger_script_event{}; }; diff --git a/BigBaseV2/src/structs/temp.hpp b/BigBaseV2/src/structs/temp.hpp index 0f52a08f..04d4201d 100644 --- a/BigBaseV2/src/structs/temp.hpp +++ b/BigBaseV2/src/structs/temp.hpp @@ -14,8 +14,9 @@ namespace big int set_level = 0; int spoofed_rank = 0; game_time time = game_time{}; - int wanted_level = 0; + bool spectate_player = false; int teleport_location = 0; + int wanted_level = 0; int weather_type = 0; }; } \ No newline at end of file