Added an option to the aimbot to make it retrieve the max distance for the current weapon. (#3430)

Fixed an exception coming from spoof_host_token if a pointer was invalid.
Fixed the aimbot targeting "friendly NPCs" who were for some reason marked as hated NPC relationships.
This commit is contained in:
gir489 2024-07-26 05:07:28 -04:00 committed by GitHub
parent eb68394382
commit 6e8c2106d4
5 changed files with 27 additions and 6 deletions

View File

@ -19,7 +19,8 @@ namespace big
g_pointers->m_gta.m_profile_gamer_info->m_peer_id = *g_pointers->m_gta.m_peer_id;
g_pointers->m_gta.m_player_info_gamer_info->m_peer_id = *g_pointers->m_gta.m_peer_id;
(*g_pointers->m_gta.m_communications)->m_voice.m_connections[0]->m_gamer_info.m_peer_id = *g_pointers->m_gta.m_peer_id;
if (g_pointers->m_gta.m_communications != nullptr)
(*g_pointers->m_gta.m_communications)->m_voice.m_connections[0]->m_gamer_info.m_peer_id = *g_pointers->m_gta.m_peer_id;
if (g_local_player && g_local_player->m_player_info)
g_local_player->m_player_info->m_net_player_data.m_peer_id = *g_pointers->m_gta.m_peer_id;
@ -36,7 +37,8 @@ namespace big
g_pointers->m_gta.m_profile_gamer_info->m_host_token = token;
g_pointers->m_gta.m_player_info_gamer_info->m_host_token = token;
(*g_pointers->m_gta.m_communications)->m_voice.m_connections[0]->m_gamer_info.m_host_token = token;
if (g_pointers->m_gta.m_communications != nullptr)
(*g_pointers->m_gta.m_communications)->m_voice.m_connections[0]->m_gamer_info.m_host_token = token;
if (g_local_player && g_local_player->m_player_info)
g_local_player->m_player_info->m_net_player_data.m_host_token = token;

View File

@ -119,6 +119,17 @@ namespace big
float best_fov = math::deg_to_rad(g.weapons.aimbot.fov);
float best_distance = g.weapons.aimbot.distance;
if (g.weapons.aimbot.use_weapon_range)
{
if (auto weapon_manager = g_local_player->m_weapon_manager)
{
if (auto weapon_info = weapon_manager->m_weapon_info)
{
best_distance = weapon_info->m_weapon_range;
}
}
}
for (rage::CEntity* ped_ : pools::get_all_peds())
{
CPed* ped = (CPed*)ped_;
@ -163,15 +174,16 @@ namespace big
{
case Dislike:
case Wanted:
case Hate: is_hated_relationship = true;
case Hate: is_hated_relationship = blip_color != HUD_COLOUR_BLUE;
}
if (!is_hated_relationship && !is_in_combat && !is_enemy)
{
/*if (PED::GET_PED_TYPE(ped_handle) != PED_TYPE_ANIMAL)
LOG(INFO) << " PED_TYPE " << PED::GET_PED_TYPE(ped_handle) << " hated " << is_hated_relationship << " combat " << is_in_combat << " enemy " << is_enemy << " blip_color " << blip_color;*/
continue;
}
/*if (PED::GET_PED_TYPE(ped_handle) != PED_TYPE_ANIMAL)
LOG(INFO) << " PED_TYPE " << PED::GET_PED_TYPE(ped_handle) << " hated " << is_hated_relationship << " combat " << is_in_combat << " enemy " << is_enemy << " blip_color " << blip_color;*/
}
if (is_a_ped_type_we_dont_care_about(ped_handle))

View File

@ -55,7 +55,7 @@ namespace big
{
case Dislike:
case Wanted:
case Hate: is_hated_relationship = true;
case Hate: is_hated_relationship = blip_color != HUD_COLOUR_BLUE;
}
if (!is_hated_relationship && !is_in_combat && !is_enemy)

View File

@ -904,6 +904,7 @@ namespace big
bool exclude_friends = false;
bool only_on_enemy = false;
bool has_target = false;
bool use_weapon_range = false;
float fov = 60.f;
float distance = 200.f;
int32_t selected_bone = (int32_t)ePedBoneType::HEAD;

View File

@ -225,7 +225,13 @@ namespace big
ImGui::PushItemWidth(350);
ImGui::SliderFloat("VIEW_WEAPON_AIM_FOV"_T.data(), &g.weapons.aimbot.fov, 1.f, 360.f, "%.0f");
if (g.weapons.aimbot.use_weapon_range)
ImGui::BeginDisabled();
ImGui::SliderFloat("VIEW_SELF_CUSTOM_TELEPORT_DISTANCE"_T.data(), &g.weapons.aimbot.distance, 1.f, 1000.f, "%.0f");
ImGui::SameLine();
if (g.weapons.aimbot.use_weapon_range)
ImGui::EndDisabled();
ImGui::Checkbox("BACKEND_LOOPED_WEAPONS_USE_MAX_RANGE"_T.data(), &g.weapons.aimbot.use_weapon_range);
ImGui::PopItemWidth();
}