mirror of
https://github.com/YimMenu/YimMenuV2.git
synced 2026-10-11 01:38:13 +08:00
fix(CI): upgrade download artifact action
This commit is contained in:
1 parent
ebb0a26f7e
commit
9f253cb98a
12 files changed
+131
-36
No files matched your search
@@ -119,7 +119,7 @@ jobs:
|
||||
}
|
||||
|
||||
- name: Download Artifact
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: binary
|
||||
|
||||
|
||||
@@ -10,25 +10,15 @@ namespace YimMenu::Features
|
||||
|
||||
virtual void OnTick() override
|
||||
{
|
||||
if (auto player = Self::GetPlayer())
|
||||
{
|
||||
PLAYER::SET_PLAYER_HAS_RESERVE_PARACHUTE(player.GetId());
|
||||
}
|
||||
PLAYER::SET_PLAYER_HAS_RESERVE_PARACHUTE(Self::GetPlayer().GetId());
|
||||
|
||||
if (auto ped = Self::GetPed())
|
||||
{
|
||||
if (!WEAPON::HAS_PED_GOT_WEAPON(ped.GetHandle(), "GADGET_PARACHUTE"_J, false))
|
||||
{
|
||||
WEAPON::GIVE_DELAYED_WEAPON_TO_PED(ped.GetHandle(), "GADGET_PARACHUTE"_J, 1, false);
|
||||
}
|
||||
if (!ped.HasWeapon("GADGET_PARACHUTE"_J))
|
||||
ped.GiveWeapon("GADGET_PARACHUTE"_J);
|
||||
}
|
||||
}
|
||||
|
||||
virtual void OnDisable() override
|
||||
{
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
static InfiniteParachutes _InfiniteParachutes{"infiniteparachutes", "Infinite Parachutes", "Always have a parachute."};
|
||||
static InfiniteParachutes _InfiniteParachutes{"infiniteparachutes", "Infinite Parachutes", "Always have a parachute"};
|
||||
};
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
namespace YimMenu::Features
|
||||
{
|
||||
static BoolCommand _LocallyVisible{"localvis", "Locally Visible", "Be locally visible while remaining invisible to other players"};
|
||||
|
||||
class Invis : public LoopedCommand
|
||||
{
|
||||
using LoopedCommand::LoopedCommand;
|
||||
@@ -12,7 +14,10 @@ namespace YimMenu::Features
|
||||
if (Self::GetPed())
|
||||
{
|
||||
Self::GetPed().SetVisible(false);
|
||||
Self::GetPlayer().SetVisibleLocally(true);
|
||||
if (_LocallyVisible.GetState())
|
||||
Self::GetPlayer().SetVisibleLocally(true);
|
||||
else
|
||||
Self::GetPlayer().SetVisibleLocally(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
#include "core/commands/Command.hpp"
|
||||
#include "game/gta/Vehicle.hpp"
|
||||
#include "game/backend/Self.hpp"
|
||||
#include "game/gta/Natives.hpp"
|
||||
#include "game/gta/data/VehicleValues.hpp"
|
||||
|
||||
namespace YimMenu::Features
|
||||
{
|
||||
@@ -12,21 +9,10 @@ namespace YimMenu::Features
|
||||
|
||||
virtual void OnCall() override
|
||||
{
|
||||
auto vehicleHandle = PLAYER::GET_PLAYERS_LAST_VEHICLE();
|
||||
|
||||
if (vehicleHandle != 0 && vehicleHandle != Self::GetVehicle().GetHandle()) {
|
||||
// TODO This logic should probably be moved into the Vehicle class
|
||||
for (int seat = (int)SeatPositions::SEAT_DRIVER; seat < (int)SeatPositions::SEAT_BACKPASSENGER; seat++)
|
||||
{
|
||||
if (VEHICLE::IS_VEHICLE_SEAT_FREE(vehicleHandle, seat, true))
|
||||
{
|
||||
PED::SET_PED_INTO_VEHICLE(Self::GetPed().GetHandle(), vehicleHandle, seat);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (auto last_veh = Self::GetPed().GetLastVehicle())
|
||||
Self::GetPed().SetInVehicle(last_veh);
|
||||
}
|
||||
};
|
||||
|
||||
static EnterLastVehicle _EnterLastVehicle{"enterlastvehicle", "Enter last vehicle", "Enters the last vehicle you were in."};
|
||||
static EnterLastVehicle _EnterLastVehicle{"enterlastvehicle", "Enter last vehicle", "Enters the last vehicle you were in"};
|
||||
};
|
||||
@@ -21,6 +21,7 @@ namespace YimMenu::Submenus
|
||||
|
||||
globalsGroup->AddItem(std::make_shared<BoolCommandItem>("godmode"_J));
|
||||
globalsGroup->AddItem(std::make_shared<BoolCommandItem>("invis"_J));
|
||||
movementGroup->AddItem(std::make_shared<ConditionalItem>("invis"_J, std::make_shared<BoolCommandItem>("localvis"_J)));
|
||||
globalsGroup->AddItem(std::make_shared<BoolCommandItem>("otr"_J));
|
||||
globalsGroup->AddItem(std::make_shared<BoolCommandItem>("noragdoll"_J));
|
||||
|
||||
|
||||
@@ -58,6 +58,14 @@ namespace YimMenu
|
||||
return Vehicle(PED::GET_VEHICLE_PED_IS_USING(GetHandle()));
|
||||
}
|
||||
|
||||
Vehicle Ped::GetLastVehicle()
|
||||
{
|
||||
ENTITY_ASSERT_VALID();
|
||||
if (PED::IS_PED_IN_ANY_VEHICLE(GetHandle(), false))
|
||||
return nullptr;
|
||||
return Vehicle(PED::GET_VEHICLE_PED_IS_IN(GetHandle(), true));
|
||||
}
|
||||
|
||||
std::uint16_t Ped::GetVehicleObjectId()
|
||||
{
|
||||
ENTITY_ASSERT_VALID();
|
||||
@@ -67,6 +75,14 @@ namespace YimMenu
|
||||
return *reinterpret_cast<std::uint16_t*>(reinterpret_cast<__int64>(GetNetworkObject()) + 0x3D8);
|
||||
}
|
||||
|
||||
void Ped::SetInVehicle(Vehicle veh, int seat)
|
||||
{
|
||||
ENTITY_ASSERT_VALID();
|
||||
ENTITY_ASSERT_CONTROL();
|
||||
|
||||
PED::SET_PED_INTO_VEHICLE(GetHandle(), veh.GetHandle(), seat);
|
||||
}
|
||||
|
||||
bool Ped::GetRagdoll()
|
||||
{
|
||||
ENTITY_ASSERT_VALID();
|
||||
@@ -185,4 +201,11 @@ namespace YimMenu
|
||||
WEAPON::GET_CURRENT_PED_WEAPON(GetHandle(), &weapon, 0);
|
||||
return weapon;
|
||||
}
|
||||
|
||||
bool Ped::HasWeapon(std::uint32_t hash)
|
||||
{
|
||||
ENTITY_ASSERT_VALID();
|
||||
|
||||
return WEAPON::HAS_PED_GOT_WEAPON(GetHandle(), hash, false);
|
||||
}
|
||||
}
|
||||
@@ -13,9 +13,11 @@ namespace YimMenu
|
||||
|
||||
static Ped Create(uint32_t model, rage::fvector3 coords, float heading = 0.0f);
|
||||
|
||||
// info
|
||||
// vehicles
|
||||
Vehicle GetVehicle();
|
||||
Vehicle GetLastVehicle(); // only returns a valid handle if the ped isn't already in a vehicle
|
||||
std::uint16_t GetVehicleObjectId(); // works even if the vehicle isn't cloned
|
||||
void SetInVehicle(Vehicle veh, int seat = -1);
|
||||
|
||||
// ragdoll
|
||||
bool GetRagdoll();
|
||||
@@ -50,5 +52,6 @@ namespace YimMenu
|
||||
void GiveWeapon(std::uint32_t hash, bool equip = false);
|
||||
void RemoveWeapon(std::uint32_t hash);
|
||||
std::uint32_t GetCurrentWeapon();
|
||||
bool HasWeapon(std::uint32_t hash);
|
||||
};
|
||||
}
|
||||
@@ -115,4 +115,11 @@ namespace YimMenu
|
||||
|
||||
VEHICLE::SET_VEHICLE_NUMBER_PLATE_TEXT(GetHandle(), text.data());
|
||||
}
|
||||
|
||||
bool Vehicle::IsSeatFree(int seat)
|
||||
{
|
||||
ENTITY_ASSERT_VALID();
|
||||
|
||||
return VEHICLE::IS_VEHICLE_SEAT_FREE(GetHandle(), seat, true);
|
||||
}
|
||||
}
|
||||
@@ -14,13 +14,16 @@ namespace YimMenu
|
||||
|
||||
// gears
|
||||
int GetGear();
|
||||
float GetRevRatio(); // doesn't work
|
||||
float GetRevRatio();
|
||||
|
||||
// speed
|
||||
float GetMaxSpeed();
|
||||
|
||||
// mods
|
||||
void Upgrade();
|
||||
|
||||
void SetPlateText(std::string_view text);
|
||||
|
||||
// seats
|
||||
bool IsSeatFree(int seat);
|
||||
};
|
||||
}
|
||||
@@ -21,6 +21,7 @@ class CNetGamePlayer;
|
||||
class CEntity;
|
||||
class CNetworkObjectMgr;
|
||||
class CNetworkPlayerMgr;
|
||||
class PoolEncryption;
|
||||
|
||||
namespace YimMenu
|
||||
{
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
// of all the things they backported from RDR this is probably the dumbest
|
||||
class PoolEncryption
|
||||
{
|
||||
public:
|
||||
bool m_IsSet; //0x0000
|
||||
uint64_t m_First; //0x0008
|
||||
uint64_t m_Second; //0x0010
|
||||
}; //Size: 0x0018
|
||||
static_assert(sizeof(PoolEncryption) == 0x18);
|
||||
@@ -0,0 +1,65 @@
|
||||
#pragma once
|
||||
#include <cstdint>
|
||||
|
||||
namespace rage
|
||||
{
|
||||
class fwBasePool
|
||||
{
|
||||
public:
|
||||
virtual ~fwBasePool() = 0; // 0x0000
|
||||
uintptr_t m_Entries; // 0x0008
|
||||
uint8_t* m_Flags; // 0x0010
|
||||
uint32_t m_Size; // 0x0018
|
||||
uint32_t m_ItemSize; // 0x001C
|
||||
uint32_t m_NextSlotIndex; // 0x0020
|
||||
uint32_t m_0024; // 0x0024
|
||||
uint32_t m_FreeSlotIndex; // 0x0028
|
||||
|
||||
bool Full() const
|
||||
{
|
||||
return m_Size - (m_FreeSlotIndex & 0x3FFFFFFF) <= 256;
|
||||
}
|
||||
|
||||
int64_t GetNumFreeSlots() const
|
||||
{
|
||||
return static_cast<int64_t>(m_Size) - static_cast<int>((m_FreeSlotIndex * 4) >> 2);
|
||||
}
|
||||
|
||||
int32_t GetScriptGuid(int32_t Index) const
|
||||
{
|
||||
return (Index << 8) + m_Flags[Index];
|
||||
}
|
||||
|
||||
int32_t GetIndex(int32_t ScriptGuid) const
|
||||
{
|
||||
return ScriptGuid >> 8;
|
||||
}
|
||||
|
||||
bool IsValid(int32_t Index) const
|
||||
{
|
||||
return !(m_Flags[Index] & 0x80);
|
||||
}
|
||||
|
||||
void* GetAt(size_t Index) const
|
||||
{
|
||||
if (m_Flags[Index])
|
||||
{
|
||||
if (_fwObj* obj = reinterpret_cast<_fwObj*>(m_Entries + Index * m_ItemSize); obj->m_0010)
|
||||
return obj;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Helper class to check object validity (m_0010)
|
||||
class _fwObj
|
||||
{
|
||||
public:
|
||||
virtual ~_fwObj() = 0;
|
||||
uint64_t m_0008;
|
||||
void* m_0010;
|
||||
};
|
||||
|
||||
}; //Size: 0x0030
|
||||
static_assert(sizeof(fwBasePool) == 0x30);
|
||||
}
|
||||
Reference in new issue
Block a user