2020-12-26 20:15:32 +01:00
|
|
|
#include "gui.hpp"
|
|
|
|
#include "imgui.h"
|
|
|
|
#include "features.hpp"
|
2020-12-29 00:21:54 +01:00
|
|
|
#include "pointers.hpp"
|
2020-12-26 20:15:32 +01:00
|
|
|
|
|
|
|
namespace big
|
|
|
|
{
|
|
|
|
void gui::render_player_window()
|
|
|
|
{
|
2020-12-31 20:53:04 +01:00
|
|
|
if (g_selectedPlayer.id != g_selectedPlayerId || !g_selectedPlayer.is_online) return;
|
2020-12-26 20:15:32 +01:00
|
|
|
|
|
|
|
if (ImGui::Begin("Player Options"))
|
|
|
|
{
|
|
|
|
ImGui::Text("Selected player:");
|
2020-12-31 20:53:04 +01:00
|
|
|
ImGui::SameLine(); ImGui::TextColored({ 25,180,38,255 }, g_selectedPlayer.name);
|
2020-12-26 20:15:32 +01:00
|
|
|
|
|
|
|
if (ImGui::Button("Close"))
|
|
|
|
{
|
2020-12-31 20:53:04 +01:00
|
|
|
g_selectedPlayerId = -2;
|
2020-12-26 20:15:32 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
ImGui::Separator();
|
|
|
|
|
2020-12-31 23:23:57 +01:00
|
|
|
ImGui::Checkbox("Spectate Player", &g_temp.spectate_player);
|
2020-12-31 02:10:15 +01:00
|
|
|
|
|
|
|
ImGui::Separator();
|
|
|
|
|
2020-12-26 20:15:32 +01:00
|
|
|
if (ImGui::Button("Teleport to Player"))
|
|
|
|
{
|
|
|
|
QUEUE_JOB_BEGIN_CLAUSE()
|
|
|
|
{
|
2020-12-31 20:53:04 +01:00
|
|
|
features::teleport::teleport_to_player(g_selectedPlayer.id);
|
2020-12-26 20:15:32 +01:00
|
|
|
}QUEUE_JOB_END_CLAUSE
|
|
|
|
}
|
|
|
|
|
2020-12-31 01:46:39 +01:00
|
|
|
if (ImGui::Button("Teleport into Vehicle"))
|
|
|
|
{
|
|
|
|
QUEUE_JOB_BEGIN_CLAUSE()
|
|
|
|
{
|
2020-12-31 20:53:04 +01:00
|
|
|
features::teleport::teleport_into_player_vehicle(g_selectedPlayer.id);
|
2020-12-31 01:46:39 +01:00
|
|
|
}QUEUE_JOB_END_CLAUSE
|
|
|
|
}
|
2020-12-26 20:15:32 +01:00
|
|
|
|
|
|
|
ImGui::Separator();
|
|
|
|
|
|
|
|
if (ImGui::Button("Kick (Host) - Permanently Blacklisted"))
|
|
|
|
{
|
|
|
|
QUEUE_JOB_BEGIN_CLAUSE()
|
|
|
|
{
|
|
|
|
if (NETWORK::NETWORK_IS_HOST())
|
|
|
|
{
|
2020-12-31 20:53:04 +01:00
|
|
|
NETWORK::NETWORK_SESSION_KICK_PLAYER(g_selectedPlayer.id);
|
2020-12-26 20:15:32 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
features::notify::above_map("You aren't the host");
|
|
|
|
}
|
|
|
|
}QUEUE_JOB_END_CLAUSE
|
|
|
|
}
|
|
|
|
|
2020-12-29 00:21:54 +01:00
|
|
|
if (ImGui::Button("Kick (Non-Host)"))
|
2020-12-26 20:15:32 +01:00
|
|
|
{
|
2021-01-01 01:11:55 +01:00
|
|
|
QUEUE_JOB_BEGIN_CLAUSE()
|
|
|
|
{
|
|
|
|
uint64_t args[4] = { 0, (uint64_t)PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_selectedPlayer.id), 0, 0 };
|
|
|
|
|
|
|
|
for (int64_t kick_hash : kick_hashes)
|
|
|
|
{
|
|
|
|
args[0] = kick_hash;
|
2020-12-29 00:21:54 +01:00
|
|
|
|
2021-01-01 01:11:55 +01:00
|
|
|
g_pointers->m_trigger_script_event(1, args, 4, 1 << g_selectedPlayer.id);
|
|
|
|
}
|
|
|
|
}QUEUE_JOB_END_CLAUSE
|
2020-12-29 00:21:54 +01:00
|
|
|
}
|
2020-12-26 20:15:32 +01:00
|
|
|
|
2020-12-29 00:21:54 +01:00
|
|
|
if (ImGui::Button("Kick from Vehicle"))
|
|
|
|
{
|
|
|
|
QUEUE_JOB_BEGIN_CLAUSE()
|
|
|
|
{
|
2020-12-31 23:23:57 +01:00
|
|
|
uint64_t args[2] = { (uint64_t)RemoteEvents::VehicleKick, (uint64_t)g_selectedPlayer.id };
|
2020-12-26 20:15:32 +01:00
|
|
|
|
2020-12-31 20:53:04 +01:00
|
|
|
g_pointers->m_trigger_script_event(1, args, 2, 1 << g_selectedPlayer.id);
|
2020-12-29 00:21:54 +01:00
|
|
|
}QUEUE_JOB_END_CLAUSE
|
2020-12-26 20:15:32 +01:00
|
|
|
}
|
|
|
|
|
2020-12-29 00:21:54 +01:00
|
|
|
if (ImGui::Button("CEO Kick"))
|
2020-12-26 20:15:32 +01:00
|
|
|
{
|
|
|
|
QUEUE_JOB_BEGIN_CLAUSE()
|
|
|
|
{
|
2020-12-31 23:23:57 +01:00
|
|
|
uint64_t ceokick[4] = { (uint64_t)RemoteEvents::CeoKick, (uint64_t)PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_selectedPlayer.id), 0, 0 };
|
2020-12-26 20:15:32 +01:00
|
|
|
|
2020-12-31 20:53:04 +01:00
|
|
|
g_pointers->m_trigger_script_event(1, ceokick, 4, 1 << g_selectedPlayer.id);
|
2020-12-29 00:21:54 +01:00
|
|
|
}QUEUE_JOB_END_CLAUSE
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ImGui::Button("CEO Ban"))
|
|
|
|
{
|
|
|
|
QUEUE_JOB_BEGIN_CLAUSE()
|
|
|
|
{
|
2020-12-31 23:23:57 +01:00
|
|
|
uint64_t ceoban[4] = { (uint64_t)RemoteEvents::CeoBan, (uint64_t)PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_selectedPlayer.id), 1, 5 };
|
2020-12-29 00:21:54 +01:00
|
|
|
|
2020-12-31 20:53:04 +01:00
|
|
|
g_pointers->m_trigger_script_event(1, ceoban, 4, 1 << g_selectedPlayer.id);
|
2020-12-26 20:15:32 +01:00
|
|
|
}QUEUE_JOB_END_CLAUSE
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ImGui::Button("Send to Job"))
|
|
|
|
{
|
|
|
|
QUEUE_JOB_BEGIN_CLAUSE()
|
|
|
|
{
|
2020-12-31 23:23:57 +01:00
|
|
|
uint64_t args[2] = { (uint64_t)RemoteEvents::ForceMission, (uint64_t)PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_selectedPlayer.id) };
|
2020-12-29 00:21:54 +01:00
|
|
|
|
2020-12-31 20:53:04 +01:00
|
|
|
g_pointers->m_trigger_script_event(true, args, 2, 1 << g_selectedPlayer.id);
|
2020-12-29 00:21:54 +01:00
|
|
|
}QUEUE_JOB_END_CLAUSE
|
|
|
|
}
|
2020-12-26 20:15:32 +01:00
|
|
|
|
2020-12-31 01:46:39 +01:00
|
|
|
ImGui::Text("Force TP Location:");
|
|
|
|
if (ImGui::BeginCombo("##teleport_location", location_names[g_temp.teleport_location]))
|
2020-12-29 00:21:54 +01:00
|
|
|
{
|
|
|
|
for (uint8_t i = 0; i < IM_ARRAYSIZE(location_names); i++)
|
|
|
|
{
|
|
|
|
bool is_selected = (g_temp.teleport_location == i);
|
|
|
|
if (ImGui::Selectable(location_names[i], is_selected))
|
|
|
|
g_temp.teleport_location = i;
|
|
|
|
if (is_selected)
|
|
|
|
ImGui::SetItemDefaultFocus();
|
|
|
|
}
|
|
|
|
|
|
|
|
ImGui::EndCombo();
|
|
|
|
}
|
2020-12-31 01:46:39 +01:00
|
|
|
if (ImGui::Button("Teleport to selected location."))
|
2020-12-29 00:21:54 +01:00
|
|
|
{
|
|
|
|
QUEUE_JOB_BEGIN_CLAUSE()
|
|
|
|
{
|
2020-12-31 23:23:57 +01:00
|
|
|
uint64_t args[9] = { (uint64_t)-171207973, (uint64_t)g_selectedPlayer.id, 1, (uint64_t)-1, 1, (uint64_t)location_ids[g_temp.teleport_location], 0,0,0 }; // 1097312011
|
2020-12-31 20:53:04 +01:00
|
|
|
g_pointers->m_trigger_script_event(1, args, 9, 1 << g_selectedPlayer.id);
|
2020-12-26 20:15:32 +01:00
|
|
|
}QUEUE_JOB_END_CLAUSE
|
2020-12-29 00:21:54 +01:00
|
|
|
}
|
2020-12-26 20:15:32 +01:00
|
|
|
|
|
|
|
ImGui::Separator();
|
|
|
|
|
|
|
|
if (ImGui::Button("Drop Money (!)"))
|
|
|
|
{
|
|
|
|
QUEUE_JOB_BEGIN_CLAUSE()
|
|
|
|
{
|
2020-12-31 20:53:04 +01:00
|
|
|
Vector3 coords = ENTITY::GET_ENTITY_COORDS(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_selectedPlayer.id), true);
|
2020-12-26 20:15:32 +01:00
|
|
|
|
|
|
|
OBJECT::CREATE_AMBIENT_PICKUP(0x1E9A99F8, coords.x, coords.y, coords.z + 0.5f, 0, rand() % 500 + 2000, (Hash)-1666779307, false, true);
|
|
|
|
STREAMING::SET_MODEL_AS_NO_LONGER_NEEDED((Hash)-1666779307);
|
|
|
|
}QUEUE_JOB_END_CLAUSE
|
|
|
|
}
|
|
|
|
|
|
|
|
ImGui::End();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|