From cc626fd950dd0355a54845c518c7e05eb41ed4c5 Mon Sep 17 00:00:00 2001 From: Yimura Date: Sun, 7 Feb 2021 17:07:47 +0100 Subject: [PATCH] wip(Misc): Added change player model --- BigBaseV2/src/gui/tab_bar/main/misc.cpp | 46 +++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/BigBaseV2/src/gui/tab_bar/main/misc.cpp b/BigBaseV2/src/gui/tab_bar/main/misc.cpp index 18fcde36..43cb763d 100644 --- a/BigBaseV2/src/gui/tab_bar/main/misc.cpp +++ b/BigBaseV2/src/gui/tab_bar/main/misc.cpp @@ -1,6 +1,9 @@ #include "gui/tab_bar.hpp" #include "features/functions.hpp" +#include "features/notify.hpp" #include "features/stats.hpp" +#include "gta/joaat.hpp" +#include "pointers.hpp" #include "natives.hpp" namespace big @@ -9,6 +12,49 @@ namespace big { if (ImGui::BeginTabItem("Misc")) { + static char player_model[20]; + if ( + ImGui::InputText("Player Model", player_model, sizeof(player_model), ImGuiInputTextFlags_EnterReturnsTrue) || + ImGui::Button("Set") + ) { + QUEUE_JOB_BEGIN_CLAUSE(=) + { + Ped ped = PLAYER::PLAYER_PED_ID(); + + Vector3 coords = ENTITY::GET_ENTITY_COORDS(ped, true); + + Hash model = rage::joaat("a_f_y_topless_01"); + + for (uint8_t i = 0; !STREAMING::HAS_MODEL_LOADED(model) && i < 100; i++) + { + STREAMING::REQUEST_MODEL(model); + + script::get_current()->yield(); + } + if (!STREAMING::HAS_MODEL_LOADED(model)) + { + notify::above_map("~r~Failed to load player model, did you give an incorrect model?"); + + return; + } + + *(unsigned short*)g_pointers->m_model_spawn_bypass = 0x9090; + ped = PED::CREATE_PED(PED_TYPE_NETWORK_PLAYER, model, coords.x + 1.f, coords.y + 1.f, coords.z, 0.f, true, false); + *(unsigned short*)g_pointers->m_model_spawn_bypass = 0x0574; + + script::get_current()->yield(); + + STREAMING::SET_MODEL_AS_NO_LONGER_NEEDED(model); + + if (*g_pointers->m_is_session_started) + { + ENTITY::_SET_ENTITY_SOMETHING(ped, true); + } + + PLAYER::CHANGE_PLAYER_PED(g_player.id, ped, true, true); + }QUEUE_JOB_END_CLAUSE + } + ImGui::Text("Set Current Character Level:"); ImGui::SliderInt("##input_levels_self", &g_temp.set_level, 0, 8000); if (ImGui::Button("Set Level"))