mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2025-07-01 12:02:55 +08:00
Mission fixes and modder detection improvements (#1598)
* feat(protections): improve protections * fix: fix mission start
This commit is contained in:
@ -265,6 +265,14 @@ namespace big
|
||||
script->m_net_component->block_host_migration(true);
|
||||
});
|
||||
}
|
||||
if (ImGui::IsItemHovered())
|
||||
ImGui::SetTooltip("This might break freemode missions and interiors. Use with caution");
|
||||
|
||||
ImGui::SameLine();
|
||||
|
||||
ImGui::Checkbox("Fast Join", &g.session.fast_join);
|
||||
if (ImGui::IsItemHovered())
|
||||
ImGui::SetTooltip("This WILL break jobs");
|
||||
|
||||
ImGui::Spacing();
|
||||
|
||||
|
@ -115,19 +115,22 @@ namespace big
|
||||
false,
|
||||
"Interior");
|
||||
|
||||
static float new_location[3];
|
||||
auto& current_location = *reinterpret_cast<float(*)[3]>(g_player_service->get_selected()->get_ped()->m_navigation->get_position());
|
||||
|
||||
components::small_text("Custom TP");
|
||||
ImGui::SetNextItemWidth(400);
|
||||
ImGui::InputFloat3("##customlocation", new_location);
|
||||
components::button("TP", [] {
|
||||
teleport::teleport_player_to_coords(g_player_service->get_selected(), *reinterpret_cast<rage::fvector3*>(&new_location));
|
||||
});
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("Get current"))
|
||||
if (g_player_service->get_selected()->get_ped())
|
||||
{
|
||||
std::copy(std::begin(current_location), std::end(current_location), std::begin(new_location));
|
||||
static float new_location[3];
|
||||
auto& current_location = *reinterpret_cast<float(*)[3]>(g_player_service->get_selected()->get_ped()->get_position());
|
||||
|
||||
components::small_text("Custom TP");
|
||||
ImGui::SetNextItemWidth(400);
|
||||
ImGui::InputFloat3("##customlocation", new_location);
|
||||
components::button("TP", [] {
|
||||
teleport::teleport_player_to_coords(g_player_service->get_selected(), *reinterpret_cast<rage::fvector3*>(&new_location));
|
||||
});
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("Get current"))
|
||||
{
|
||||
std::copy(std::begin(current_location), std::end(current_location), std::begin(new_location));
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::EndListBox();
|
||||
|
@ -23,7 +23,7 @@ namespace big
|
||||
player_icons += FONT_ICON_HOST;
|
||||
if (plyr->is_friend())
|
||||
player_icons += FONT_ICON_FRIEND;
|
||||
if (const auto ped = plyr->get_ped(); ped != nullptr && ped->m_ped_task_flag & (uint8_t)ePedTask::TASK_DRIVING)
|
||||
if (const auto ped = plyr->get_ped(); (ped != nullptr && ped->m_ped_task_flag & (uint8_t)ePedTask::TASK_DRIVING))
|
||||
player_icons += FONT_ICON_VEHICLE;
|
||||
|
||||
const auto player_iconsc = player_icons.c_str();
|
||||
@ -53,9 +53,11 @@ namespace big
|
||||
g_gui_service->set_selected(tabs::PLAYER);
|
||||
g.window.switched_view = true;
|
||||
}
|
||||
if (ImGui::IsItemHovered() && g_player_database_service->get_player_by_rockstar_id(plyr->get_net_data()->m_gamer_handle.m_rockstar_id) != nullptr)
|
||||
if (ImGui::IsItemHovered()
|
||||
&& g_player_database_service->get_player_by_rockstar_id(plyr->get_net_data()->m_gamer_handle.m_rockstar_id) != nullptr)
|
||||
{
|
||||
auto sorted_player = g_player_database_service->get_player_by_rockstar_id(plyr->get_net_data()->m_gamer_handle.m_rockstar_id);
|
||||
auto sorted_player =
|
||||
g_player_database_service->get_player_by_rockstar_id(plyr->get_net_data()->m_gamer_handle.m_rockstar_id);
|
||||
|
||||
if (!sorted_player->infractions.empty())
|
||||
{
|
||||
|
@ -14,7 +14,6 @@ namespace big
|
||||
}
|
||||
|
||||
ImGui::SeparatorText("Peds");
|
||||
// Nearby Ped Actions
|
||||
|
||||
components::button<ImVec2(110, 0), ImVec4(0.70196f, 0.3333f, 0.00392f, 1.f)>("Kill", [] {
|
||||
for (auto peds : entity::get_entities(false, true))
|
||||
@ -26,10 +25,14 @@ namespace big
|
||||
ImGui::SameLine();
|
||||
|
||||
components::button<ImVec2(110, 0), ImVec4(0.76078f, 0.f, 0.03529f, 1.f)>("Kill Enemies", [] {
|
||||
for (auto peds : entity::get_entities(false, true))
|
||||
for (auto ped : entity::get_entities(false, true))
|
||||
{
|
||||
if (!PED::IS_PED_A_PLAYER(peds))
|
||||
ped::kill_ped_by_relation(peds, 4 || 5);
|
||||
if (!PED::IS_PED_A_PLAYER(ped))
|
||||
{
|
||||
auto relation = PED::GET_RELATIONSHIP_BETWEEN_PEDS(ped, self::ped);
|
||||
if (relation == 4 || relation == 5)
|
||||
ped::kill_ped(ped);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@ -104,12 +107,13 @@ namespace big
|
||||
|
||||
quantity = list.size();
|
||||
remaining = quantity;
|
||||
g_notification_service->push("Entity deletion", std::format("Deleting {} entities", quantity));
|
||||
g_notification_service->push("Entity Deletion", std::format("Deleting {} entities", quantity));
|
||||
deleting = true;
|
||||
int failed = 0;
|
||||
|
||||
for (auto ent : list)
|
||||
{
|
||||
if (ent == self::ped)
|
||||
if (PED::IS_PED_A_PLAYER(ent))
|
||||
continue;
|
||||
|
||||
if (ENTITY::DOES_ENTITY_EXIST(ent))
|
||||
@ -122,8 +126,6 @@ namespace big
|
||||
entity::delete_entity(ent);
|
||||
}
|
||||
|
||||
script::get_current()->yield(5ms);
|
||||
|
||||
if (ENTITY::DOES_ENTITY_EXIST(ent))
|
||||
failed++;
|
||||
else
|
||||
@ -131,7 +133,7 @@ namespace big
|
||||
}
|
||||
|
||||
if (failed > 0)
|
||||
g_notification_service->push_warning("Entity deletion", std::format("Failed deleting {} entities", failed));
|
||||
g_notification_service->push_warning("Entity Deletion", std::format("Failed deleting {} entities", failed));
|
||||
|
||||
deleting = false;
|
||||
});
|
||||
|
Reference in New Issue
Block a user