added: Casino Rig Slot Machines Manipulation, RP Multiplier and MaxAmmo Feature (#299)

* added nightclub

* Add arcade

* added rp multiplier

* add arcade safe payout

* added rp multiplier

* added nightclub safe payout

* add casino win

* removed unnecessary code an debug logs

* Removed debug code

* Fixed casino rig slot machines

* changed cmake autoRecon bool

* removed unnecessary line

* fix https://github.com/YimMenu/YimMenuV2/pull/299#discussion_r2094336529

* fix https://github.com/YimMenu/YimMenuV2/pull/299#discussion_r2094338633 and https://github.com/YimMenu/YimMenuV2/pull/299#discussion_r2094338444

* fixed https://github.com/YimMenu/YimMenuV2/pull/299#discussion_r2094339450, https://github.com/YimMenu/YimMenuV2/pull/299#discussion_r2094337391 and https://github.com/YimMenu/YimMenuV2/pull/299#discussion_r2094336813. Added Give Max Ammo-Feature.

* changed format

* fix format

* fixed wrong path

* removed Nightclub and arcade safe payout because of https://github.com/YimMenu/YimMenuV2/pull/299#discussion_r2094595284. Moved RPMultiplier to Recovery general.

* fixed misspelling

* cleanup for merge

* removed unnecessary include

* removed unnecessary import

* added givemaxammo item to group

---------

Co-authored-by: Felix Wehrfeld <felix@wehrfeld.de>
This commit is contained in:
Felix Wehrfeld
2025-05-27 16:54:50 +02:00
committed by GitHub
parent 2cb6b652dd
commit 15a74630f9
7 changed files with 152 additions and 4 deletions
+83
View File
@@ -0,0 +1,83 @@
#include "core/commands/LoopedCommand.hpp"
#include "game/backend/Self.hpp"
#include "game/gta/Natives.hpp"
#include "game/gta/ScriptLocal.hpp"
#include <set>
namespace YimMenu::Features
{
class CasinoManipulateRigSlotMachines : public LoopedCommand
{
using LoopedCommand::LoopedCommand;
int slots_random_results_table = 1348;
std::set<int> slots_blacklist = {9, 21, 22, 87, 152};
virtual void OnTick() override
{
if (Scripts::SafeToModifyFreemodeBroadcastGlobals() && SCRIPT::GET_NUMBER_OF_THREADS_RUNNING_THE_SCRIPT_WITH_THIS_HASH("casino_slots"_J))
{
Player casinoSlotsScriptHostPlayer = NETWORK::NETWORK_GET_HOST_OF_SCRIPT("casino_slots", -1, 0);
auto casinoSlotsScriptHostPlayerId = casinoSlotsScriptHostPlayer.GetId();
auto selfPlayerId = Self::GetPlayer().GetId();
if (casinoSlotsScriptHostPlayerId != selfPlayerId)
{
Scripts::ForceScriptHost(Scripts::FindScriptThread("casino_slots"_J));
}
bool needs_run = false;
for (int slots_iter = 3; slots_iter <= 196; ++slots_iter)
{
if (!slots_blacklist.contains(slots_iter))
{
if (*ScriptLocal("casino_slots"_J, slots_random_results_table + slots_iter).As<int*>() != 6)
{
needs_run = true;
}
}
}
if (needs_run)
{
for (int slots_iter = 3; slots_iter <= 196; ++slots_iter)
{
if (!slots_blacklist.contains(slots_iter))
{
int slot_result = 6;
*ScriptLocal("casino_slots"_J, slots_random_results_table + slots_iter).As<int*>() = slot_result;
}
}
}
}
}
virtual void OnDisable() override
{
if (Scripts::SafeToModifyFreemodeBroadcastGlobals() && SCRIPT::GET_NUMBER_OF_THREADS_RUNNING_THE_SCRIPT_WITH_THIS_HASH("casino_slots"_J))
{
Player casinoSlotsScriptHostPlayer = NETWORK::NETWORK_GET_HOST_OF_SCRIPT("casino_slots", -1, 0);
auto casinoSlotsScriptHostPlayerId = casinoSlotsScriptHostPlayer.GetId();
auto selfPlayerId = Self::GetPlayer().GetId();
if (casinoSlotsScriptHostPlayerId != selfPlayerId)
{
Scripts::ForceScriptHost(Scripts::FindScriptThread("casino_slots"_J));
}
for (int slots_iter = 3; slots_iter <= 196; ++slots_iter)
{
if (!slots_blacklist.contains(slots_iter))
{
int slot_result = 6;
std::srand(static_cast<unsigned int>(std::time(0)) + slots_iter);
slot_result = std::rand() % 7; // Generates a pseudo random number between 0 and 7
*ScriptLocal("casino_slots"_J, slots_random_results_table + slots_iter).As<int*>() = slot_result;
}
}
}
}
};
static CasinoManipulateRigSlotMachines _CasinoManipulateRigSlotMachines{"casinomanipulaterigslotmachines", "Manipulate Rig Slot Machines", "Lets you win the Rig Slot Machines every time"};
}
@@ -0,0 +1,25 @@
#include "core/commands/Command.hpp"
#include "core/commands/IntCommand.hpp"
#include "game/backend/Tunables.hpp"
namespace YimMenu::Features
{
static IntCommand _RpMultiplierInput{"rpmultiplierinput", "RP Multiplier Input", "RP Mulitplier (< 0 = 0 -> No RP)", std::nullopt, std::nullopt, 1};
class RPMultiplier : public Command
{
using Command::Command;
virtual void OnCall() override
{
int state = _RpMultiplierInput.GetState();
if (state < 0)
{
state = 0;
}
*Tunables::GetTunable("XP_MULTIPLIER"_J).As<float*>() = state;
}
};
static RPMultiplier _RPMultiplier{"rpmultiplier", "Set RP Multiplier", "Multiplies RP by the given value"};
}
+21
View File
@@ -0,0 +1,21 @@
#include "core/commands/Command.hpp"
#include "game/backend/Self.hpp"
#include "game/gta/data/Weapons.hpp"
namespace YimMenu::Features
{
class GiveMaxAmmo : public Command
{
using Command::Command;
virtual void OnCall() override
{
for (auto weapon : Data::Weapons)
{
Self::GetPed().SetMaxAmmoForWeapon(weapon);
}
}
};
static GiveMaxAmmo _GiveMaxAmmo{"givemaxammo", "Give Max Ammo", "Refills your ammo to max."};
}
+13 -3
View File
@@ -1,8 +1,8 @@
#include "Recovery.hpp"
#include "game/frontend/items/Items.hpp"
#include "Recovery/HeistModifier.hpp"
#include "Recovery/StatEditor.hpp"
#include "Recovery/Transactions.hpp"
#include "Recovery/HeistModifier.hpp"
#include "game/frontend/items/Items.hpp"
namespace YimMenu::Submenus
{
@@ -10,14 +10,24 @@ namespace YimMenu::Submenus
Submenu::Submenu("Recovery")
{
auto missions = std::make_shared<Category>("Missions");
auto vehiclesGroup = std::make_shared<Group>("Vehicles");
auto casino = std::make_shared<Category>("Casino");
auto generalGroup = std::make_shared<Group>("General");
auto casinoGroup = std::make_shared<Group>("CasinoRigSlotMachines");
generalGroup->AddItem(std::make_shared<BoolCommandItem>("playallmissionssolo"_J));
generalGroup->AddItem(std::make_shared<CommandItem>("forcelaunchheist"_J));
generalGroup->AddItem(std::make_shared<IntCommandItem>("rpmultiplierinput"_J));
generalGroup->AddItem(std::make_shared<CommandItem>("rpmultiplier"_J));
casinoGroup->AddItem(std::make_shared<BoolCommandItem>("casinomanipulaterigslotmachines"_J));
missions->AddItem(generalGroup);
casino->AddItem(casinoGroup);
AddCategory(std::move(missions));
AddCategory(std::move(casino));
AddCategory(BuildStatEditorMenu());
AddCategory(BuildTransactionsMenu());
AddCategory(BuildHeistModifierMenu());
+2 -1
View File
@@ -71,6 +71,7 @@ namespace YimMenu::Submenus
weaponsGlobalsGroup->AddItem(std::make_shared<BoolCommandItem>("infiniteparachutes"_J));
weaponsGlobalsGroup->AddItem(std::make_shared<BoolCommandItem>("ExplosiveAmmo"_J));
weaponsGlobalsGroup->AddItem(std::make_shared<CommandItem>("giveallweapons"_J));
weaponsGlobalsGroup->AddItem(std::make_shared<CommandItem>("givemaxammo"_J));
weaponsAimbotGroup->AddItem(std::make_shared<BoolCommandItem>("aimbot"_J));
weaponsAimbotGroup->AddItem(std::make_shared<ConditionalItem>("aimbot"_J, std::make_shared<BoolCommandItem>("aimbotaimforhead"_J)));
@@ -83,4 +84,4 @@ namespace YimMenu::Submenus
auto outfitEditorCategory = YimMenu::CreateOutfitsMenu();
AddCategory(std::move(outfitEditorCategory));
}
}
}
+7
View File
@@ -236,4 +236,11 @@ namespace YimMenu
ENTITY_ASSERT_VALID();
PED::SET_PED_MAX_TIME_UNDERWATER(GetHandle(), time);
}
void Ped::SetMaxAmmoForWeapon(std::uint32_t hash)
{
int maxAmmo;
WEAPON::GET_MAX_AMMO(GetHandle(), hash, &maxAmmo);
WEAPON::SET_PED_AMMO(GetHandle(), hash, maxAmmo, 0);
}
}
+1
View File
@@ -48,6 +48,7 @@ namespace YimMenu
bool HasWeapon(std::uint32_t hash);
void SetInfiniteAmmo(bool infinite);
void SetInfiniteClip(bool infinite);
void SetMaxAmmoForWeapon(std::uint32_t hash);
// teleport
void TeleportTo(const rage::fvector3& pos); // similar to SetPosition, but handles vehicles correctly