Added Infinite ammo & clip.

This commit is contained in:
Maddy 2022-02-08 23:06:33 -05:00
parent f711af3803
commit 5ea6135856
6 changed files with 59 additions and 1 deletions

View File

@ -61,6 +61,8 @@ namespace big
looped::weapons_steal_vehicle_gun();
looped::weapons_repair_gun();
looped::weapons_vehicle_gun();
looped::weapons_infinite_ammo();
looped::weapons_infinite_mag();
}QUEUE_JOB_END_CLAUSE
QUEUE_JOB_BEGIN_CLAUSE()

View File

@ -39,5 +39,7 @@ namespace big
static void weapons_repair_gun();
static void weapons_steal_vehicle_gun();
static void weapons_vehicle_gun();
static void weapons_infinite_ammo();
static void weapons_infinite_mag();
};
}

View File

@ -0,0 +1,21 @@
#include "backend/looped/looped.hpp"
#include "core/enums.hpp"
#include "util/entity.hpp"
#include "util/math.hpp"
#include "util/notify.hpp"
namespace big
{
void looped::weapons_infinite_ammo()
{
if (g.weapons.infinite_ammo) {
Hash weaponHash;
auto const ped = PLAYER::PLAYER_PED_ID();
WEAPON::GET_CURRENT_PED_WEAPON(ped, &weaponHash, 1);
if (weaponHash != RAGE_JOAAT("WEAPON_UNARMED")) {
WEAPON::GIVE_WEAPON_TO_PED(ped, weaponHash, 9999, false, false);
}
}
}
}

View File

@ -0,0 +1,16 @@
#include "backend/looped/looped.hpp"
#include "core/enums.hpp"
#include "util/entity.hpp"
#include "util/math.hpp"
#include "util/notify.hpp"
namespace big
{
void looped::weapons_infinite_mag()
{
if (g.weapons.infinite_mag) {
auto const ped = PLAYER::PLAYER_PED_ID();
WEAPON::SET_PED_INFINITE_AMMO_CLIP(ped, g.weapons.infinite_mag);
}
}
}

View File

@ -116,6 +116,8 @@ struct globals {
struct weapons {
CustomWeapon custom_weapon = CustomWeapon::NONE;
char vehicle_gun_model[12] = "bus";
bool infinite_ammo {};
bool infinite_mag {};
};
struct window {
@ -203,6 +205,8 @@ struct globals {
this->vehicle.speedo_meter.y = j["vehicle"]["speedo_meter"]["position_y"];
this->weapons.custom_weapon = (CustomWeapon)j["weapons"]["custom_weapon"];
this->weapons.custom_weapon = j["weapons"]["infinite_ammo"];
this->weapons.custom_weapon = j["weapons"]["infinite_mag"];
this->window.debug = j["window"]["debug"];
this->window.handling = j["window"]["handling"];
@ -312,7 +316,9 @@ struct globals {
},
{
"weapons", {
{ "custom_weapon", (int)this->weapons.custom_weapon }
{ "custom_weapon", (int)this->weapons.custom_weapon },
{ "infinite_ammo", (int)this->weapons.infinite_ammo },
{ "infinite_mag", (int)this->weapons.infinite_mag }
}
},
{

View File

@ -7,6 +7,17 @@ namespace big
{
if (ImGui::BeginTabItem("Weapons"))
{
if (ImGui::TreeNode("Ammo Options"))
{
ImGui::Checkbox("Infinite Ammo", &g.weapons.infinite_ammo);
ImGui::SameLine();
ImGui::Checkbox("Infinite Clip", &g.weapons.infinite_mag);
ImGui::TreePop();
}
if (ImGui::TreeNode("Custom Weapons"))
{
CustomWeapon selected = g.weapons.custom_weapon;