From bb45b9c765f52769963947654004763c5d8c06a2 Mon Sep 17 00:00:00 2001 From: Yimura Date: Wed, 19 May 2021 14:35:47 +0200 Subject: [PATCH] feat(MainWindow): Added tab spawn --- BigBaseV2/src/gui/window/main/tab_spawn.cpp | 37 +++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 BigBaseV2/src/gui/window/main/tab_spawn.cpp diff --git a/BigBaseV2/src/gui/window/main/tab_spawn.cpp b/BigBaseV2/src/gui/window/main/tab_spawn.cpp new file mode 100644 index 00000000..2f05bf49 --- /dev/null +++ b/BigBaseV2/src/gui/window/main/tab_spawn.cpp @@ -0,0 +1,37 @@ +#include "tabs.hpp" +#include "fiber_pool.hpp" +#include "natives.hpp" +#include "script.hpp" +#include "util/vehicle.hpp" + +namespace big +{ + static char model[12]; + + void tab_main::tab_spawn() + { + if (ImGui::BeginTabItem("Spawn")) + { + QUEUE_JOB_BEGIN_CLAUSE() + { + PAD::DISABLE_ALL_CONTROL_ACTIONS(0); + }QUEUE_JOB_END_CLAUSE + + if ( + ImGui::InputText("Model Name", model, sizeof(model), ImGuiInputTextFlags_EnterReturnsTrue) || + ImGui::Button("Spawn") + ) + { + QUEUE_JOB_BEGIN_CLAUSE(= ) + { + Ped player = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(PLAYER::GET_PLAYER_INDEX()); + Vector3 location = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(player, .0, 8.0, .5); + + vehicle::spawn((const char*)model, location, ENTITY::GET_ENTITY_HEADING(player) + 90.f); + }QUEUE_JOB_END_CLAUSE + } + + ImGui::EndTabItem(); + } + } +} \ No newline at end of file