2022-02-28 23:04:56 +01:00
|
|
|
#include "gta_util.hpp"
|
2022-07-03 00:03:07 +02:00
|
|
|
#include "services/pickups/pickup_service.hpp"
|
2022-06-30 00:11:54 +02:00
|
|
|
#include "services/players/player_service.hpp"
|
2022-05-24 15:59:54 -04:00
|
|
|
#include "util/globals.hpp"
|
2022-06-30 00:11:54 +02:00
|
|
|
#include "util/misc.hpp"
|
2022-03-08 12:52:00 -05:00
|
|
|
#include "util/ped.hpp"
|
2022-02-28 23:04:56 +01:00
|
|
|
#include "util/teleport.hpp"
|
2022-06-30 00:11:54 +02:00
|
|
|
#include "views/view.hpp"
|
2022-02-28 23:04:56 +01:00
|
|
|
|
|
|
|
namespace big
|
|
|
|
{
|
|
|
|
void view::view_player() {
|
|
|
|
|
|
|
|
std::string title = fmt::format("Player Options: {}", g_player_service->get_selected()->get_name());
|
|
|
|
|
|
|
|
ImGui::Text(title.c_str());
|
|
|
|
ImGui::Checkbox("Spectate", &g->player.spectating);
|
|
|
|
|
|
|
|
if (g_player_service->get_selected()->is_valid())
|
|
|
|
{
|
2022-03-08 12:52:00 -05:00
|
|
|
if (ImGui::TreeNode("Misc")) {
|
|
|
|
components::button("Steal Outfit", [] {
|
|
|
|
ped::steal_outfit(
|
|
|
|
PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_player_service->get_selected()->id())
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
ImGui::SameLine();
|
|
|
|
|
|
|
|
components::button("Steal Identity", [] {
|
|
|
|
ped::steal_identity(
|
|
|
|
PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_player_service->get_selected()->id())
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
2022-03-08 20:06:37 +01:00
|
|
|
components::button("Clear Wanted Level", [] {
|
2022-05-24 15:59:54 -04:00
|
|
|
globals::clear_wanted_player(g_player_service->get_selected()->id());
|
2022-03-08 20:06:37 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
ImGui::SameLine();
|
|
|
|
|
2022-07-05 22:35:32 +02:00
|
|
|
ImGui::Checkbox("Never Wanted", &g_player_service->get_selected()->never_wanted);
|
2022-03-08 20:06:37 +01:00
|
|
|
|
2022-07-03 00:03:07 +02:00
|
|
|
components::button("Give Health", [] {
|
|
|
|
g_pickup_service->give_player_health(g_player_service->get_selected()->id());
|
|
|
|
});
|
|
|
|
|
|
|
|
ImGui::SameLine();
|
|
|
|
|
|
|
|
components::button("Give Armour", [] {
|
|
|
|
g_pickup_service->give_player_armour(g_player_service->get_selected()->id());
|
|
|
|
});
|
|
|
|
|
|
|
|
components::button("Give Ammo", [] {
|
|
|
|
g_pickup_service->give_player_ammo(g_player_service->get_selected()->id());
|
|
|
|
});
|
|
|
|
|
|
|
|
ImGui::SameLine();
|
|
|
|
|
|
|
|
components::button("Give Weapons", [] {
|
|
|
|
g_pickup_service->give_player_weapons(g_player_service->get_selected()->id());
|
|
|
|
});
|
|
|
|
|
2022-03-08 12:52:00 -05:00
|
|
|
ImGui::TreePop();
|
|
|
|
}
|
|
|
|
|
2022-02-28 23:04:56 +01:00
|
|
|
if (ImGui::TreeNode("Info")) {
|
|
|
|
|
|
|
|
ImGui::Text("Player ID: %d", g_player_service->get_selected()->id());
|
|
|
|
|
|
|
|
ImGui::Text("Session Host: %s", g_player_service->get_selected()->is_host() ? "Yes" : "No");
|
|
|
|
|
|
|
|
ImGui::Separator();
|
|
|
|
|
|
|
|
if (CPlayerInfo* player_info = g_player_service->get_selected()->get_player_info(); player_info != nullptr)
|
|
|
|
{
|
|
|
|
ImGui::Text("Wanted Level: %d", player_info->m_wanted_level);
|
|
|
|
}
|
|
|
|
|
2022-07-17 04:37:06 +08:00
|
|
|
uint32_t ped_damage_bits = 0;
|
|
|
|
uint32_t ped_task_flag = 0;
|
|
|
|
uint32_t veh_damage_bits = 0;
|
|
|
|
std::string mode_str = "";
|
|
|
|
|
2022-02-28 23:04:56 +01:00
|
|
|
if (CPed* ped = g_player_service->get_selected()->get_ped(); ped != nullptr)
|
|
|
|
{
|
2022-07-17 04:37:06 +08:00
|
|
|
ped_damage_bits = ped->m_damage_bits;
|
|
|
|
ped_task_flag = ped->m_ped_task_flag;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ped_damage_bits & (uint32_t)eEntityProofs::GOD)
|
|
|
|
{
|
|
|
|
mode_str = "God";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (ped_damage_bits & (uint32_t)eEntityProofs::BULLET)
|
|
|
|
{
|
|
|
|
mode_str += "Bullet, ";
|
|
|
|
}
|
|
|
|
if (ped_damage_bits & (uint32_t)eEntityProofs::EXPLOSION)
|
|
|
|
{
|
|
|
|
mode_str += "Explosion, ";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (mode_str.empty())
|
|
|
|
{
|
|
|
|
mode_str = "No";
|
|
|
|
}
|
|
|
|
|
|
|
|
ImGui::Text("Player God Mode: %s", mode_str.c_str());
|
|
|
|
|
|
|
|
mode_str = "";
|
|
|
|
|
|
|
|
if (CAutomobile* vehicle = g_player_service->get_selected()->get_current_vehicle(); vehicle != nullptr)
|
|
|
|
{
|
|
|
|
veh_damage_bits = vehicle->m_damage_bits;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ped_task_flag & (uint8_t)ePedTask::TASK_DRIVING)
|
|
|
|
{
|
|
|
|
if (veh_damage_bits & (uint32_t)eEntityProofs::GOD)
|
|
|
|
{
|
|
|
|
mode_str = "God";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (veh_damage_bits & (uint32_t)eEntityProofs::COLLISION)
|
|
|
|
{
|
|
|
|
mode_str += "Collision, ";
|
|
|
|
}
|
|
|
|
if (veh_damage_bits & (uint32_t)eEntityProofs::EXPLOSION)
|
|
|
|
{
|
|
|
|
mode_str += "Explosion, ";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (mode_str.empty())
|
|
|
|
{
|
|
|
|
mode_str = "No";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
mode_str = "No vehicle detected";
|
2022-02-28 23:04:56 +01:00
|
|
|
}
|
|
|
|
|
2022-07-17 04:37:06 +08:00
|
|
|
ImGui::Text("Vehicle God Mode: %s", mode_str.c_str());
|
2022-02-28 23:04:56 +01:00
|
|
|
|
|
|
|
ImGui::Separator();
|
|
|
|
|
|
|
|
if (rage::netPlayerData* net_player_data = g_player_service->get_selected()->get_net_data(); net_player_data != nullptr)
|
|
|
|
{
|
|
|
|
ImGui::Text("Rockstar ID: %d", net_player_data->m_rockstar_id);
|
|
|
|
ImGui::Text(
|
|
|
|
"IP Address: %d.%d.%d.%d:%d",
|
|
|
|
net_player_data->m_external_ip.m_field1,
|
|
|
|
net_player_data->m_external_ip.m_field2,
|
|
|
|
net_player_data->m_external_ip.m_field3,
|
|
|
|
net_player_data->m_external_ip.m_field4,
|
|
|
|
net_player_data->m_external_port
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
ImGui::TreePop();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ImGui::TreeNode("Teleport")) {
|
|
|
|
|
|
|
|
components::button("Teleport", [] {
|
|
|
|
teleport::to_player(g_player_service->get_selected()->id());
|
2022-05-10 16:54:38 +02:00
|
|
|
});
|
2022-02-28 23:04:56 +01:00
|
|
|
|
|
|
|
ImGui::SameLine();
|
|
|
|
|
|
|
|
components::button("Bring", [] {
|
|
|
|
teleport::bring_player(g_player_service->get_selected()->id());
|
2022-05-10 16:54:38 +02:00
|
|
|
});
|
2022-02-28 23:04:56 +01:00
|
|
|
|
|
|
|
components::button("Teleport into Vehicle", [] {
|
|
|
|
Vehicle veh = PED::GET_VEHICLE_PED_IS_IN(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_player_service->get_selected()->id()), false);
|
|
|
|
|
|
|
|
teleport::into_vehicle(veh);
|
2022-05-10 16:54:38 +02:00
|
|
|
});
|
2022-02-28 23:04:56 +01:00
|
|
|
|
|
|
|
ImGui::TreePop();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-05-05 23:51:18 +03:00
|
|
|
}
|