Added "Enable MK1 and MK2 Weapons" feature. (#3000)
This commit is contained in:
parent
f0cd838bb1
commit
ccb3591364
6
src/backend/commands/self/enable_mk1_variants.cpp
Normal file
6
src/backend/commands/self/enable_mk1_variants.cpp
Normal file
@ -0,0 +1,6 @@
|
||||
#include "backend/bool_command.hpp"
|
||||
|
||||
namespace big
|
||||
{
|
||||
bool_command g_enable_mk1_variants("enablemk1variants", "ENABLE_BOTH_MK1_AND_MK2_VARIANTS", "ENABLE_BOTH_MK1_AND_MK2_VARIANTS_DESC", g.weapons.enable_mk1_variants);
|
||||
}
|
@ -884,9 +884,10 @@ namespace big
|
||||
bool triggerbot = false;
|
||||
bool infinite_range = false;
|
||||
bool enable_weapon_hotkeys = false;
|
||||
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)
|
||||
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)
|
||||
} weapons{};
|
||||
|
||||
struct window
|
||||
|
@ -92,5 +92,27 @@ namespace big
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void REMOVE_WEAPON_FROM_PED(rage::scrNativeCallContext* src)
|
||||
{
|
||||
auto ped = src->get_arg<Ped>(0);
|
||||
auto weapon_hash = src->get_arg<Hash>(1);
|
||||
if (g.weapons.enable_mk1_variants)
|
||||
{
|
||||
static const std::unordered_set<Hash> weapon_variants = {
|
||||
"WEAPON_PISTOL"_J, "WEAPON_SMG"_J, "WEAPON_ASSAULTRIFLE"_J, "WEAPON_CARBINERIFLE"_J,
|
||||
"WEAPON_COMBATMG"_J, "WEAPON_HEAVYSNIPER"_J, "WEAPON_BULLPUPRIFLE"_J, "WEAPON_MARKSMANRIFLE"_J,
|
||||
"WEAPON_PUMPSHOTGUN"_J, "WEAPON_REVOLVER"_J, "WEAPON_SNSPISTOL"_J, "WEAPON_SPECIALCARBINE"_J,
|
||||
//MK2 variants
|
||||
"WEAPON_PISTOL_MK2"_J, "WEAPON_SMG_MK2"_J, "WEAPON_ASSAULTRIFLE_MK2"_J, "WEAPON_CARBINERIFLE_MK2"_J,
|
||||
"WEAPON_COMBATMG_MK2"_J, "WEAPON_HEAVYSNIPER_MK2"_J, "WEAPON_BULLPUPRIFLE_MK2"_J, "WEAPON_MARKSMANRIFLE_MK2"_J,
|
||||
"WEAPON_PUMPSHOTGUN_MK2"_J, "WEAPON_REVOLVER_MK2"_J, "WEAPON_SNSPISTOL_MK2"_J, "WEAPON_SPECIALCARBINE_MK2"_J };
|
||||
if (ped == self::ped && weapon_variants.contains(weapon_hash))
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
WEAPON::REMOVE_WEAPON_FROM_PED(ped, weapon_hash);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -119,6 +119,7 @@ namespace big
|
||||
add_native_detour("freemode"_J, NativeIndex::SET_BIGMAP_ACTIVE, freemode::SET_BIGMAP_ACTIVE);
|
||||
add_native_detour("freemode"_J, NativeIndex::SET_BLIP_DISPLAY, freemode::SET_BLIP_DISPLAY);
|
||||
add_native_detour("freemode"_J, NativeIndex::NETWORK_HAS_RECEIVED_HOST_BROADCAST_DATA, freemode::NETWORK_HAS_RECEIVED_HOST_BROADCAST_DATA);
|
||||
add_native_detour("freemode"_J, NativeIndex::REMOVE_WEAPON_FROM_PED, freemode::REMOVE_WEAPON_FROM_PED);
|
||||
|
||||
add_native_detour("fmmc_launcher"_J, NativeIndex::NETWORK_HAS_RECEIVED_HOST_BROADCAST_DATA, freemode::NETWORK_HAS_RECEIVED_HOST_BROADCAST_DATA);
|
||||
add_native_detour("maintransition"_J, NativeIndex::NETWORK_SESSION_HOST, network::NETWORK_SESSION_HOST);
|
||||
|
@ -91,6 +91,8 @@ namespace big
|
||||
}
|
||||
});
|
||||
|
||||
components::command_checkbox<"enablemk1variants">();
|
||||
|
||||
ImGui::EndGroup();
|
||||
|
||||
ImGui::SeparatorText("DEBUG_TAB_MISC"_T.data());
|
||||
|
Reference in New Issue
Block a user