diff --git a/src/backend/looped/player/spectate.cpp b/src/backend/looped/player/spectate.cpp index 02902219..b8f75bd2 100644 --- a/src/backend/looped/player/spectate.cpp +++ b/src/backend/looped/player/spectate.cpp @@ -1,3 +1,5 @@ +#include "backend/bool_command.hpp" +#include "backend/int_command.hpp" #include "backend/looped/looped.hpp" #include "natives.hpp" #include "services/players/player_service.hpp" @@ -41,6 +43,12 @@ namespace big STREAMING::SET_FOCUS_ENTITY(target); + if (g.player.override_cam_distance) + CAM::SET_THIRD_PERSON_CAM_ORBIT_DISTANCE_LIMITS_THIS_UPDATE(1.f, (float)g.player.cam_distance); + bReset = false; } + + bool_command g_override_cam_distance("overridecamdistance", "BACKEND_LOOPED_PLAYER_OVERRIDE_CAM_DISTANCE", "BACKEND_LOOPED_PLAYER_OVERRIDE_CAM_DISTANCE_DESC", g.player.override_cam_distance); + int_command g_override_cam_distance_int("overridecamdistanceint", "BACKEND_LOOPED_PLAYER_OVERRIDE_CAM_DISTANCE_INT", "BACKEND_LOOPED_PLAYER_OVERRIDE_CAM_DISTANCE_INT_DESC", g.player.cam_distance, 1, 200); } diff --git a/src/core/settings.hpp b/src/core/settings.hpp index a6b1fb6d..a9522062 100644 --- a/src/core/settings.hpp +++ b/src/core/settings.hpp @@ -227,9 +227,11 @@ namespace big struct player { - bool spectating = false; + bool spectating = false; + bool override_cam_distance = false; + int cam_distance = 10; - NLOHMANN_DEFINE_TYPE_INTRUSIVE(player, spectating) + NLOHMANN_DEFINE_TYPE_INTRUSIVE(player, spectating, override_cam_distance, cam_distance) } player{}; struct player_db diff --git a/src/function_types.hpp b/src/function_types.hpp index 40c6c3d3..7338d12c 100644 --- a/src/function_types.hpp +++ b/src/function_types.hpp @@ -120,6 +120,8 @@ namespace big::functions using join_session_by_info = bool (*)(Network* network, rage::rlSessionInfo* info, int unk, int flags, rage::rlGamerHandle* handles, int handlecount); using invite_player_by_gamer_handle = bool(*)(uint64_t config, rage::rlGamerHandle* handle, int unk1, int unk2, int unk3, int unk4); + using add_friend_by_gamer_handle = void(*)(rage::rlGamerHandle* handle, const char* unk); + using show_profile_by_gamer_handle = void(*)(rage::rlGamerHandle* handle); using generate_uuid = bool (*)(uint64_t* uuid); diff --git a/src/gta_pointers.hpp b/src/gta_pointers.hpp index 6dc635df..9b83e868 100644 --- a/src/gta_pointers.hpp +++ b/src/gta_pointers.hpp @@ -163,6 +163,8 @@ namespace big functions::join_session_by_info m_join_session_by_info; functions::invite_player_by_gamer_handle m_invite_player_by_gamer_handle; + functions::add_friend_by_gamer_handle m_add_friend_by_gamer_handle; + functions::show_profile_by_gamer_handle m_show_profile_by_gamer_handle; uint64_t m_network_config; functions::reset_network_complaints m_reset_network_complaints; diff --git a/src/pointers.cpp b/src/pointers.cpp index 3df1e8a6..119edbac 100644 --- a/src/pointers.cpp +++ b/src/pointers.cpp @@ -646,6 +646,24 @@ namespace big g_pointers->m_gta.m_invite_player_by_gamer_handle = ptr.add(1).rip().as(); } }, + // Add Friend By Gamer Handle + { + "AFBGH", + "48 89 5C 24 ? 57 48 83 EC ? 48 8B F9 B1 ? 48 8B DA E8 ? ? ? ? 84 C0 74 ? 8B 15", + [](memory::handle ptr) + { + g_pointers->m_gta.m_add_friend_by_gamer_handle = ptr.as(); + } + }, + // Show Profile By Gamer Handle + { + "SPBGH", + "E8 ? ? ? ? E9 ? ? ? ? 3D ? ? ? ? 75 ? E8", + [](memory::handle ptr) + { + g_pointers->m_gta.m_show_profile_by_gamer_handle = ptr.add(1).rip().as(); + } + }, // Network Config { "NC", diff --git a/src/util/session.hpp b/src/util/session.hpp index 1794b544..4249b144 100644 --- a/src/util/session.hpp +++ b/src/util/session.hpp @@ -170,6 +170,20 @@ namespace big::session g_notification_service->push_success("Network", "Target player has been invited to your session!"); } + inline void show_profile_by_rockstar_id(uint64_t rid) + { + rage::rlGamerHandle player_handle(rid); + + g_pointers->m_gta.m_show_profile_by_gamer_handle(&player_handle); + } + + inline void add_friend_by_rockstar_id(uint64_t rid) + { + rage::rlGamerHandle player_handle(rid); + + g_pointers->m_gta.m_add_friend_by_gamer_handle(&player_handle, 0); + } + inline void add_infraction(player_ptr player, Infraction infraction, const std::string& custom_reason = "") { if (g.debug.fuzzer.enabled) diff --git a/src/views/network/view_player_database.cpp b/src/views/network/view_player_database.cpp index 692b96ca..7193d815 100644 --- a/src/views/network/view_player_database.cpp +++ b/src/views/network/view_player_database.cpp @@ -208,10 +208,22 @@ namespace big session::join_by_rockstar_id(current_player->rockstar_id); }); + ImGui::SameLine(); + components::button("INVITE_PLAYER"_T, [] { session::invite_by_rockstar_id(current_player->rockstar_id); }); + components::button("VIEW_PLAYER_INFO_SC_PROFILE"_T, [] { + session::show_profile_by_rockstar_id(current_player->rockstar_id); + }); + + ImGui::SameLine(); + + components::button("SEND_FRIEND_REQUEST"_T, [] { + session::add_friend_by_rockstar_id(current_player->rockstar_id); + }); + static char message[256]; components::input_text("INPUT_MSG"_T, message, sizeof(message)); if (components::button("SEND_MSG"_T)) diff --git a/src/views/players/player/player_info.cpp b/src/views/players/player/player_info.cpp index 65ef3a31..e413db2a 100644 --- a/src/views/players/player/player_info.cpp +++ b/src/views/players/player/player_info.cpp @@ -5,6 +5,7 @@ #include "services/player_database/player_database_service.hpp" #include "views/view.hpp" #include "services/gta_data/gta_data_service.hpp" +#include "util/session.hpp" #include #include