Improved aimbot enemy detection and change DragInt to SliderInt (#3378)
* Added aimbot check for peds we are in combat with via scripts. * Changed DragInt into SliderInt. * Fixed no_sway not being saved to config. * Fixed aimbot snapping to an invalid angle when the target was first grabbed.
This commit is contained in:
parent
5b82fc06fa
commit
c1f68cb632
@ -144,16 +144,19 @@ namespace big
|
||||
|
||||
const auto ped_handle = g_pointers->m_gta.m_ptr_to_handle(ped);
|
||||
|
||||
bool is_enemy = false;
|
||||
bool is_hated_relationship = false;
|
||||
bool is_in_combat = PED::IS_PED_IN_COMBAT(ped_handle, self::ped);
|
||||
switch (PED::GET_RELATIONSHIP_BETWEEN_PEDS(ped_handle, self::ped))
|
||||
{
|
||||
case Dislike:
|
||||
case Wanted:
|
||||
case Hate: is_enemy = true;
|
||||
case Hate: is_hated_relationship = true;
|
||||
}
|
||||
|
||||
if ((g_aimbot_only_on_enemy.is_enabled() && !is_enemy) || is_a_ped_type_we_dont_care_about(ped_handle))
|
||||
if ((g_aimbot_only_on_enemy.is_enabled() && (!is_hated_relationship && !is_in_combat)) || is_a_ped_type_we_dont_care_about(ped_handle))
|
||||
{
|
||||
/*if (PED::GET_PED_TYPE(ped_handle) != PED_TYPE_ANIMAL)
|
||||
LOG(INFO) << " is_hated_relationship " << is_hated_relationship << " GET_PED_TYPE " << PED::GET_PED_TYPE(ped_handle) << " is_in_combat " << is_in_combat;*/
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -273,6 +276,9 @@ namespace big
|
||||
const auto target_velocity = get_velocity(m_target);
|
||||
const auto my_velocity = get_velocity(g_local_player);
|
||||
|
||||
if (target_velocity == rage::fvector3{})
|
||||
return;
|
||||
|
||||
target_position += (target_velocity - my_velocity);
|
||||
}
|
||||
|
||||
|
@ -937,7 +937,7 @@ namespace big
|
||||
bool enable_mk1_variants = false;
|
||||
std::map<int, std::vector<uint32_t>> weapon_hotkeys{};
|
||||
|
||||
NLOHMANN_DEFINE_TYPE_INTRUSIVE(weapons, ammo_special, custom_weapon, aimbot, infinite_ammo, always_full_ammo, infinite_mag, increased_damage, increase_damage, set_explosion_radius, modify_explosion_radius, no_recoil, no_spread, vehicle_gun_model, increased_c4_limit, increased_flare_limit, rapid_fire, gravity_gun, paintgun, interior_weapon, triggerbot, infinite_range, enable_weapon_hotkeys, weapon_hotkeys, enable_mk1_variants)
|
||||
NLOHMANN_DEFINE_TYPE_INTRUSIVE(weapons, ammo_special, custom_weapon, aimbot, infinite_ammo, always_full_ammo, infinite_mag, increased_damage, increase_damage, set_explosion_radius, modify_explosion_radius, no_recoil, no_spread, vehicle_gun_model, increased_c4_limit, increased_flare_limit, rapid_fire, gravity_gun, paintgun, interior_weapon, triggerbot, infinite_range, enable_weapon_hotkeys, weapon_hotkeys, enable_mk1_variants, no_sway)
|
||||
} weapons{};
|
||||
|
||||
struct window
|
||||
|
@ -8,7 +8,7 @@ namespace big
|
||||
{
|
||||
ImGui::Text("HANDLING_INITIAL_DRIVE_GEARS"_T.data());
|
||||
int initial_drive_gears = g_local_player->m_vehicle->m_handling_data->m_initial_drive_gears;
|
||||
if (ImGui::DragInt("###handling_drive_gears", &initial_drive_gears, .1f, 1, 16))
|
||||
if (ImGui::SliderInt("###handling_drive_gears", &initial_drive_gears, 1, 16))
|
||||
g_local_player->m_vehicle->m_handling_data->m_initial_drive_gears = initial_drive_gears;
|
||||
|
||||
ImGui::Text("HANDLING_UPSHIFT_MULTIPLIER"_T.data());
|
||||
|
@ -107,7 +107,7 @@ namespace big
|
||||
ImGui::SetNextItemWidth(120);
|
||||
if (item.drawable_id_max <= 0)
|
||||
ImGui::BeginDisabled();
|
||||
if (ImGui::DragInt(std::format("{} [0,{}]##1", item.label, item.drawable_id_max).c_str(), &item.drawable_id, 0.25f, 0, item.drawable_id_max))
|
||||
if (ImGui::SliderInt(std::format("{} [0,{}]##1", item.label, item.drawable_id_max).c_str(), &item.drawable_id, 0, item.drawable_id_max))
|
||||
{
|
||||
//outfit::check_bounds_drawable(&item); // The game does this on its own, but seems to crash if we call OOB values to fast. (-1 is not a valid scenario)
|
||||
g_fiber_pool->queue_job([item] {
|
||||
@ -127,7 +127,7 @@ namespace big
|
||||
ImGui::SetNextItemWidth(120);
|
||||
if (item.texture_id_max <= 0)
|
||||
ImGui::BeginDisabled();
|
||||
if (ImGui::DragInt(std::format("{} {} [0,{}]##2", item.label, "OUTFIT_TEX"_T, item.texture_id_max).c_str(), &item.texture_id, 0.1f, 0, item.texture_id_max))
|
||||
if (ImGui::SliderInt(std::format("{} {} [0,{}]##2", item.label, "OUTFIT_TEX"_T, item.texture_id_max).c_str(), &item.texture_id, 0, item.texture_id_max))
|
||||
{
|
||||
//outfit::check_bounds_drawable(&item); // The game does this on its own, but seems to crash if we call OOB values to fast. (-1 is not a valid scenario)
|
||||
g_fiber_pool->queue_job([item] {
|
||||
@ -147,7 +147,7 @@ namespace big
|
||||
ImGui::SetNextItemWidth(120);
|
||||
if (item.drawable_id_max <= 0)
|
||||
ImGui::BeginDisabled();
|
||||
if (ImGui::DragInt(std::format("{} [0,{}]##3", item.label, item.drawable_id_max).c_str(), &item.drawable_id, 0.25f, -1, item.drawable_id_max))
|
||||
if (ImGui::SliderInt(std::format("{} [0,{}]##3", item.label, item.drawable_id_max).c_str(), &item.drawable_id, -1, item.drawable_id_max))
|
||||
{
|
||||
//outfit::check_bounds_drawable(&item); // The game does this on its own, but seems to crash if we call OOB values to fast. (-1 is only used here as a magic number to signal the removal of the prop.)
|
||||
g_fiber_pool->queue_job([item] {
|
||||
@ -170,7 +170,7 @@ namespace big
|
||||
ImGui::SetNextItemWidth(120);
|
||||
if (item.texture_id_max <= 0)
|
||||
ImGui::BeginDisabled();
|
||||
if (ImGui::DragInt(std::format("{} {} [0,{}]##4", item.label, "OUTFIT_TEX"_T, item.texture_id_max).c_str(), &item.texture_id, 0.1f, 0, item.texture_id_max))
|
||||
if (ImGui::SliderInt(std::format("{} {} [0,{}]##4", item.label, "OUTFIT_TEX"_T, item.texture_id_max).c_str(), &item.texture_id, 0, item.texture_id_max))
|
||||
{
|
||||
//outfit::check_bounds_drawable(&item); // The game does this on its own, but seems to crash if we call OOB values to fast. (-1 is not a valid scenario)
|
||||
g_fiber_pool->queue_job([item] {
|
||||
|
@ -88,7 +88,7 @@ namespace big
|
||||
for (auto& item : components.items)
|
||||
{
|
||||
ImGui::SetNextItemWidth(120);
|
||||
ImGui::DragInt(std::format("{} [0,{}]##1", item.label, item.drawable_id_max).c_str(), outfit::get_component_drawable_id_address(slot, item.id), 0.1f, 0, item.drawable_id_max);
|
||||
ImGui::SliderInt(std::format("{} [0,{}]##1", item.label, item.drawable_id_max).c_str(), outfit::get_component_drawable_id_address(slot, item.id), 0, item.drawable_id_max);
|
||||
}
|
||||
ImGui::EndGroup();
|
||||
|
||||
@ -98,7 +98,7 @@ namespace big
|
||||
for (auto& item : components.items)
|
||||
{
|
||||
ImGui::SetNextItemWidth(120);
|
||||
ImGui::DragInt(std::format("{} {} [0,{}]##2", item.label, "OUTFIT_TEX"_T, item.texture_id_max).c_str(), outfit::get_component_texture_id_address(slot, item.id), 0.1f, 0, item.texture_id_max);
|
||||
ImGui::SliderInt(std::format("{} {} [0,{}]##2", item.label, "OUTFIT_TEX"_T, item.texture_id_max).c_str(), outfit::get_component_texture_id_address(slot, item.id), 0, item.texture_id_max);
|
||||
}
|
||||
ImGui::EndGroup();
|
||||
|
||||
@ -108,7 +108,7 @@ namespace big
|
||||
for (auto& item : props.items)
|
||||
{
|
||||
ImGui::SetNextItemWidth(120);
|
||||
ImGui::DragInt(std::format("{} [0,{}]##3", item.label, item.drawable_id_max).c_str(), outfit::get_prop_drawable_id_address(slot, item.id), 0.1f, 0, item.drawable_id_max);
|
||||
ImGui::SliderInt(std::format("{} [0,{}]##3", item.label, item.drawable_id_max).c_str(), outfit::get_prop_drawable_id_address(slot, item.id), 0, item.drawable_id_max);
|
||||
}
|
||||
ImGui::EndGroup();
|
||||
|
||||
@ -118,7 +118,7 @@ namespace big
|
||||
for (auto& item : props.items)
|
||||
{
|
||||
ImGui::SetNextItemWidth(120);
|
||||
ImGui::DragInt(std::format("{} {} [0,{}]##4", item.label, "OUTFIT_TEX"_T, item.texture_id_max).c_str(), outfit::get_prop_texture_id_address(slot, item.id), 0.1f, 0, item.texture_id_max);
|
||||
ImGui::SliderInt(std::format("{} {} [0,{}]##4", item.label, "OUTFIT_TEX"_T, item.texture_id_max).c_str(), outfit::get_prop_texture_id_address(slot, item.id), 0, item.texture_id_max);
|
||||
}
|
||||
ImGui::EndGroup();
|
||||
}
|
||||
|
Reference in New Issue
Block a user