feat(PlayerWindow): Added teleport options

This commit is contained in:
Yimura 2021-07-25 21:02:57 +02:00
parent 1b0fd4960d
commit b769503115
4 changed files with 43 additions and 0 deletions

View File

@ -8,5 +8,6 @@ namespace big
{ {
public: public:
static void tab_info(); static void tab_info();
static void tab_teleport();
}; };
} }

View File

@ -0,0 +1,41 @@
#include "player_tabs.hpp"
#include "fiber_pool.hpp"
#include "util/teleport.hpp"
namespace big
{
void tab_player::tab_teleport()
{
if (ImGui::BeginTabItem("Teleport"))
{
if (ImGui::Button("Teleport"))
{
QUEUE_JOB_BEGIN_CLAUSE()
{
teleport::to_player(g.selected_player.id);
}QUEUE_JOB_END_CLAUSE
}
ImGui::SameLine();
if (ImGui::Button("Bring"))
{
QUEUE_JOB_BEGIN_CLAUSE()
{
teleport::bring_player(g.selected_player.id);
}QUEUE_JOB_END_CLAUSE
}
if (ImGui::Button("Teleport into Vehicle"))
{
QUEUE_JOB_BEGIN_CLAUSE()
{
Vehicle veh = PED::GET_VEHICLE_PED_IS_IN(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g.selected_player.id), false);
teleport::into_vehicle(veh);
}QUEUE_JOB_END_CLAUSE
}
ImGui::EndTabItem();
}
}
}

View File

@ -18,6 +18,7 @@ namespace big
{ {
ImGui::BeginTabBar("tabbar_player"); ImGui::BeginTabBar("tabbar_player");
tab_player::tab_info(); tab_player::tab_info();
tab_player::tab_teleport();
ImGui::EndTabBar(); ImGui::EndTabBar();
ImGui::End(); ImGui::End();