mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2025-06-18 07:07:32 +08:00
(feat) option Fix to context menu (#1962)
This commit is contained in:
parent
afa79d8600
commit
5c4f16a474
@ -62,7 +62,8 @@ namespace big
|
|||||||
s_context_menu vehicle_menu{ContextEntityType::VEHICLE,
|
s_context_menu vehicle_menu{ContextEntityType::VEHICLE,
|
||||||
0,
|
0,
|
||||||
{},
|
{},
|
||||||
{{"KILL ENGINE",
|
{
|
||||||
|
{"KILL ENGINE",
|
||||||
[this] {
|
[this] {
|
||||||
if (entity::take_control_of(m_handle))
|
if (entity::take_control_of(m_handle))
|
||||||
{
|
{
|
||||||
@ -71,7 +72,19 @@ namespace big
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
g_notification_service->push_warning("Toxic", "Failed to take control of vehicle.");
|
g_notification_service->push_warning("Toxic", "Failed to take control of vehicle.");
|
||||||
}},
|
}},
|
||||||
|
{"FIX VEHICLE",
|
||||||
|
[this] {
|
||||||
|
if (entity::take_control_of(m_handle))
|
||||||
|
{
|
||||||
|
VEHICLE::SET_VEHICLE_ENGINE_HEALTH(m_handle, 1000.f);
|
||||||
|
VEHICLE::SET_VEHICLE_FIXED(m_handle);
|
||||||
|
VEHICLE::SET_VEHICLE_DEFORMATION_FIXED(m_handle);
|
||||||
|
VEHICLE::SET_VEHICLE_DIRT_LEVEL(m_handle, 0.f);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
g_notification_service->push_warning("Warning", "Failed to take control of vehicle.");
|
||||||
|
}},
|
||||||
{"BURST TIRES",
|
{"BURST TIRES",
|
||||||
[this] {
|
[this] {
|
||||||
if (entity::take_control_of(m_handle))
|
if (entity::take_control_of(m_handle))
|
||||||
@ -85,7 +98,7 @@ namespace big
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
g_notification_service->push_warning("Toxic", "Failed to take control of vehicle.");
|
g_notification_service->push_warning("Toxic", "Failed to take control of vehicle.");
|
||||||
}},
|
}},
|
||||||
{"HALT",
|
{"HALT",
|
||||||
[this] {
|
[this] {
|
||||||
if (entity::take_control_of(m_handle))
|
if (entity::take_control_of(m_handle))
|
||||||
@ -94,27 +107,27 @@ namespace big
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
g_notification_service->push_warning("Toxic", "Failed to take control of vehicle.");
|
g_notification_service->push_warning("Toxic", "Failed to take control of vehicle.");
|
||||||
}},
|
}},
|
||||||
{"COPY VEHICLE",
|
{"COPY VEHICLE",
|
||||||
[this] {
|
[this] {
|
||||||
Vehicle v = persist_car_service::clone_ped_car(PLAYER::PLAYER_PED_ID(), m_handle);
|
Vehicle v = persist_car_service::clone_ped_car(PLAYER::PLAYER_PED_ID(), m_handle);
|
||||||
script::get_current()->yield();
|
script::get_current()->yield();
|
||||||
PED::SET_PED_INTO_VEHICLE(PLAYER::PLAYER_PED_ID(), v, -1);
|
PED::SET_PED_INTO_VEHICLE(PLAYER::PLAYER_PED_ID(), v, -1);
|
||||||
}},
|
}},
|
||||||
{"BOOST",
|
{"BOOST",
|
||||||
[this] {
|
[this] {
|
||||||
if (entity::take_control_of(m_handle))
|
if (entity::take_control_of(m_handle))
|
||||||
VEHICLE::SET_VEHICLE_FORWARD_SPEED(m_handle, 79);
|
VEHICLE::SET_VEHICLE_FORWARD_SPEED(m_handle, 79);
|
||||||
else
|
else
|
||||||
g_notification_service->push_warning("Toxic", "Failed to take control of vehicle.");
|
g_notification_service->push_warning("Toxic", "Failed to take control of vehicle.");
|
||||||
}},
|
}},
|
||||||
{"LAUNCH",
|
{"LAUNCH",
|
||||||
[this] {
|
[this] {
|
||||||
if (entity::take_control_of(m_handle))
|
if (entity::take_control_of(m_handle))
|
||||||
ENTITY::APPLY_FORCE_TO_ENTITY(m_handle, 1, 0.f, 0.f, 50000.f, 0.f, 0.f, 0.f, 0, 0, 1, 1, 0, 1);
|
ENTITY::APPLY_FORCE_TO_ENTITY(m_handle, 1, 0.f, 0.f, 50000.f, 0.f, 0.f, 0.f, 0, 0, 1, 1, 0, 1);
|
||||||
else
|
else
|
||||||
g_notification_service->push_warning("Toxic", "Failed to take control of vehicle.");
|
g_notification_service->push_warning("Toxic", "Failed to take control of vehicle.");
|
||||||
}},
|
}},
|
||||||
{"EJECT",
|
{"EJECT",
|
||||||
[this] {
|
[this] {
|
||||||
if (ped::get_player_from_ped(VEHICLE::GET_PED_IN_VEHICLE_SEAT(m_handle, -1, 0)) != NULL)
|
if (ped::get_player_from_ped(VEHICLE::GET_PED_IN_VEHICLE_SEAT(m_handle, -1, 0)) != NULL)
|
||||||
@ -125,34 +138,36 @@ namespace big
|
|||||||
|
|
||||||
TASK::CLEAR_PED_TASKS_IMMEDIATELY(VEHICLE::GET_PED_IN_VEHICLE_SEAT(m_handle, -1, 0));
|
TASK::CLEAR_PED_TASKS_IMMEDIATELY(VEHICLE::GET_PED_IN_VEHICLE_SEAT(m_handle, -1, 0));
|
||||||
TASK::CLEAR_PED_TASKS_IMMEDIATELY(m_handle);
|
TASK::CLEAR_PED_TASKS_IMMEDIATELY(m_handle);
|
||||||
}},
|
}},
|
||||||
{"TP INTO", [this] {
|
{"TP INTO", [this] {
|
||||||
teleport::into_vehicle(m_handle);
|
teleport::into_vehicle(m_handle);
|
||||||
}}}};
|
}}
|
||||||
|
}};
|
||||||
|
|
||||||
s_context_menu ped_menu{ContextEntityType::PED,
|
s_context_menu ped_menu{ContextEntityType::PED,
|
||||||
0,
|
0,
|
||||||
{},
|
{},
|
||||||
{{"DISARM",
|
{
|
||||||
|
{"DISARM",
|
||||||
[this] {
|
[this] {
|
||||||
for (auto& [_, weapon] : g_gta_data_service->weapons())
|
for (auto& [_, weapon] : g_gta_data_service->weapons())
|
||||||
WEAPON::REMOVE_WEAPON_FROM_PED(m_handle, weapon.m_hash);
|
WEAPON::REMOVE_WEAPON_FROM_PED(m_handle, weapon.m_hash);
|
||||||
}},
|
}},
|
||||||
{"KILL",
|
{"KILL",
|
||||||
[this] {
|
[this] {
|
||||||
ped::kill_ped(m_handle);
|
ped::kill_ped(m_handle);
|
||||||
}},
|
}},
|
||||||
{"RAGDOLL",
|
{"RAGDOLL",
|
||||||
[this] {
|
[this] {
|
||||||
PED::SET_PED_TO_RAGDOLL(m_handle, 2000, 2000, 0, 0, 0, 0);
|
PED::SET_PED_TO_RAGDOLL(m_handle, 2000, 2000, 0, 0, 0, 0);
|
||||||
}},
|
}},
|
||||||
{"ANIMATION",
|
{"ANIMATION",
|
||||||
[this] {
|
[this] {
|
||||||
if(STREAMING::DOES_ANIM_DICT_EXIST(g_ped_animation_service.current_animation.dict.data()))
|
if(STREAMING::DOES_ANIM_DICT_EXIST(g_ped_animation_service.current_animation.dict.data()))
|
||||||
g_ped_animation_service.play_saved_ped_animation(g_ped_animation_service.current_animation, m_handle);
|
g_ped_animation_service.play_saved_ped_animation(g_ped_animation_service.current_animation, m_handle);
|
||||||
else
|
else
|
||||||
ped::ped_play_animation(m_handle, "mini@strip_club@private_dance@part1", "priv_dance_p1", 3.5f, -4.0f, -1, 1);
|
ped::ped_play_animation(m_handle, "mini@strip_club@private_dance@part1", "priv_dance_p1", 3.5f, -4.0f, -1, 1);
|
||||||
}},
|
}},
|
||||||
{"RECRUIT", [this] {
|
{"RECRUIT", [this] {
|
||||||
TASK::CLEAR_PED_TASKS(m_handle);
|
TASK::CLEAR_PED_TASKS(m_handle);
|
||||||
PED::SET_PED_AS_GROUP_MEMBER(m_handle, PED::GET_PED_GROUP_INDEX(self::ped));
|
PED::SET_PED_AS_GROUP_MEMBER(m_handle, PED::GET_PED_GROUP_INDEX(self::ped));
|
||||||
@ -170,54 +185,63 @@ namespace big
|
|||||||
WEAPON::GIVE_WEAPON_TO_PED(m_handle, RAGE_JOAAT("weapon_microsmg"), 9999, false, false);
|
WEAPON::GIVE_WEAPON_TO_PED(m_handle, RAGE_JOAAT("weapon_microsmg"), 9999, false, false);
|
||||||
WEAPON::GIVE_WEAPON_TO_PED(m_handle, RAGE_JOAAT("weapon_carbinerifle"), 9999, false, true);
|
WEAPON::GIVE_WEAPON_TO_PED(m_handle, RAGE_JOAAT("weapon_carbinerifle"), 9999, false, true);
|
||||||
TASK::TASK_COMBAT_HATED_TARGETS_AROUND_PED(self::ped, 100, 67108864);
|
TASK::TASK_COMBAT_HATED_TARGETS_AROUND_PED(self::ped, 100, 67108864);
|
||||||
}}}};
|
}}
|
||||||
|
}};
|
||||||
|
|
||||||
s_context_menu object_menu{ContextEntityType::OBJECT, 0, {}, {}};
|
s_context_menu object_menu{ContextEntityType::OBJECT, 0, {}, {}};
|
||||||
|
|
||||||
s_context_menu player_menu{ContextEntityType::PLAYER,
|
s_context_menu player_menu{ContextEntityType::PLAYER,
|
||||||
0,
|
0,
|
||||||
{},
|
{},
|
||||||
{{"SET SELECTED",
|
{
|
||||||
|
{"SET SELECTED",
|
||||||
[this] {
|
[this] {
|
||||||
g_player_service->set_selected(ped::get_player_from_ped(m_handle));
|
g_player_service->set_selected(ped::get_player_from_ped(m_handle));
|
||||||
}},
|
}},
|
||||||
{"STEAL IDENTITY",
|
{"STEAL OUTFIT",
|
||||||
[this] {
|
[this] {
|
||||||
ped::steal_identity(m_handle);
|
ped::steal_outfit(m_handle);
|
||||||
}},
|
}},
|
||||||
{"KICK",
|
{"KICK",
|
||||||
[this] {
|
[this] {
|
||||||
static player_command* command = dynamic_cast<player_command*>(command::get(rage::consteval_joaat("multikick")));
|
static player_command* command = dynamic_cast<player_command*>(command::get(rage::consteval_joaat("multikick")));
|
||||||
command->call(ped::get_player_from_ped(m_handle), {});
|
command->call(ped::get_player_from_ped(m_handle), {});
|
||||||
script::get_current()->yield(500ms);
|
script::get_current()->yield(500ms);
|
||||||
}},
|
}},
|
||||||
{"DISARM",
|
{"DISARM",
|
||||||
[this] {
|
[this] {
|
||||||
static player_command* command = dynamic_cast<player_command*>(command::get(rage::consteval_joaat("remweaps")));
|
static player_command* command = dynamic_cast<player_command*>(command::get(rage::consteval_joaat("remweaps")));
|
||||||
command->call(ped::get_player_from_ped(m_handle), {});
|
command->call(ped::get_player_from_ped(m_handle), {});
|
||||||
}},
|
}},
|
||||||
{"RAGDOLL", [this] {
|
{"RAGDOLL", [this] {
|
||||||
static player_command* command = dynamic_cast<player_command*>(command::get(rage::consteval_joaat("ragdoll")));
|
static player_command* command = dynamic_cast<player_command*>(command::get(rage::consteval_joaat("ragdoll")));
|
||||||
command->call(ped::get_player_from_ped(m_handle), {});
|
command->call(ped::get_player_from_ped(m_handle), {});
|
||||||
}}}};
|
}}
|
||||||
|
}};
|
||||||
|
|
||||||
s_context_menu shared_menu{ContextEntityType::SHARED,
|
s_context_menu shared_menu{ContextEntityType::SHARED,
|
||||||
0,
|
0,
|
||||||
{},
|
{},
|
||||||
{{"EXPLODE",
|
{
|
||||||
|
{"COPY HASH", [this] {
|
||||||
|
ImGui::SetClipboardText(std::format("0x{:08X}", (rage::joaat_t)m_pointer->m_model_info->m_hash).c_str());
|
||||||
|
g_notification_service->push("Context Menu",
|
||||||
|
std::format("Copy hash 0x{:08X}", (rage::joaat_t)m_pointer->m_model_info->m_hash).c_str());
|
||||||
|
}},
|
||||||
|
{"EXPLODE",
|
||||||
[this] {
|
[this] {
|
||||||
rage::fvector3 pos = *m_pointer->m_navigation->get_position();
|
rage::fvector3 pos = *m_pointer->m_navigation->get_position();
|
||||||
FIRE::ADD_EXPLOSION(pos.x, pos.y, pos.z, 1, 1000, 1, 0, 1, 0);
|
FIRE::ADD_EXPLOSION(pos.x, pos.y, pos.z, 1, 1000, 1, 0, 1, 0);
|
||||||
}},
|
}},
|
||||||
{"TP TO",
|
{"TP TO",
|
||||||
[this] {
|
[this] {
|
||||||
rage::fvector3 pos = *m_pointer->m_navigation->get_position();
|
rage::fvector3 pos = *m_pointer->m_navigation->get_position();
|
||||||
teleport::to_coords({pos.x, pos.y, pos.z});
|
teleport::to_coords({pos.x, pos.y, pos.z});
|
||||||
}},
|
}},
|
||||||
{"TP ON TOP",
|
{"TP ON TOP",
|
||||||
[this] {
|
[this] {
|
||||||
teleport::tp_on_top(m_handle, true);
|
teleport::tp_on_top(m_handle, true);
|
||||||
}},
|
}},
|
||||||
{"BRING",
|
{"BRING",
|
||||||
[this] {
|
[this] {
|
||||||
rage::fvector3 pos = *g_local_player->m_navigation->get_position();
|
rage::fvector3 pos = *g_local_player->m_navigation->get_position();
|
||||||
@ -236,26 +260,22 @@ namespace big
|
|||||||
ENTITY::SET_ENTITY_COORDS(m_handle, pos.x, pos.y, pos.z, false, false, false, false);
|
ENTITY::SET_ENTITY_COORDS(m_handle, pos.x, pos.y, pos.z, false, false, false, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
{"ENFLAME",
|
{"ENFLAME",
|
||||||
[this] {
|
[this] {
|
||||||
Vector3 pos = ENTITY::GET_ENTITY_COORDS(m_handle, TRUE);
|
Vector3 pos = ENTITY::GET_ENTITY_COORDS(m_handle, TRUE);
|
||||||
FIRE::START_ENTITY_FIRE(m_handle);
|
FIRE::START_ENTITY_FIRE(m_handle);
|
||||||
FIRE::START_SCRIPT_FIRE(pos.x, pos.y, pos.z, 25, TRUE);
|
FIRE::START_SCRIPT_FIRE(pos.x, pos.y, pos.z, 25, TRUE);
|
||||||
FIRE::ADD_EXPLOSION(pos.x, pos.y, pos.z, eExplosionTag::MOLOTOV, 1, false, false, 0, false);
|
FIRE::ADD_EXPLOSION(pos.x, pos.y, pos.z, eExplosionTag::MOLOTOV, 1, false, false, 0, false);
|
||||||
}},
|
}},
|
||||||
{"DELETE",
|
{"DELETE",
|
||||||
[this] {
|
[this] {
|
||||||
if (entity::take_control_of(m_handle))
|
if (entity::take_control_of(m_handle))
|
||||||
{
|
{
|
||||||
entity::delete_entity(m_handle);
|
entity::delete_entity(m_handle);
|
||||||
}
|
}
|
||||||
}},
|
}}
|
||||||
{"COPY HASH", [this] {
|
}};
|
||||||
ImGui::SetClipboardText(std::format("0x{:08X}", (rage::joaat_t)m_pointer->m_model_info->m_hash).c_str());
|
|
||||||
g_notification_service->push("Context Menu",
|
|
||||||
std::format("Copy hash 0x{:08X}", (rage::joaat_t)m_pointer->m_model_info->m_hash).c_str());
|
|
||||||
}}}};
|
|
||||||
|
|
||||||
std::unordered_map<ContextEntityType, s_context_menu> options = {{ContextEntityType::VEHICLE, vehicle_menu}, {ContextEntityType::PLAYER, player_menu}, {ContextEntityType::PED, ped_menu}, {ContextEntityType::SHARED, shared_menu}, {ContextEntityType::OBJECT, object_menu}};
|
std::unordered_map<ContextEntityType, s_context_menu> options = {{ContextEntityType::VEHICLE, vehicle_menu}, {ContextEntityType::PLAYER, player_menu}, {ContextEntityType::PED, ped_menu}, {ContextEntityType::SHARED, shared_menu}, {ContextEntityType::OBJECT, object_menu}};
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user