vMenu icon indicating copy to clipboard operation
vMenu copied to clipboard

Addon Loadouts

Open blackfirefly000 opened this issue 7 months ago • 5 comments

Add the ability to save and spawn addon weapons with load outs. Fix for https://github.com/TomGrobbe/vMenu/issues/449

This also fixed the issue where saving a loadout while Unlimited Ammo was turned on caused it to spawn with no ammo. There was an issue with Unlimited Ammo that meant it didn't work if a loadout spawned with 0 ammo. Saving a loadout with Unlimited Ammo turned on will now cause it to save with max ammo

This code has not been reviewed or optimized. I recommend that both occur to ensure that the most efficient solution occurs. I am bad at both of these.

blackfirefly000 avatar Jun 24 '25 04:06 blackfirefly000

I found some issues upon logging into the server or changing peds. Working on a fix. Issue is almost certainly with SpawnWeaponLoadoutAsync or SaveWeaponLoadout in CommonFunctions.cs

blackfirefly000 avatar Jun 24 '25 08:06 blackfirefly000

Given how many issues I'm running into, marking as a draft until I get them all fixed.

P.S. Codefactor is really mad about stuff I didn't edit and don't know how to fix.

blackfirefly000 avatar Jun 25 '25 09:06 blackfirefly000

All features are working as intended!! For some reason, it is absolutely necessary that all instances of "...weapons_loadout..." are changed to "...weapon_loadout...". I have no idea why. I tried it both ways and it only worked without the S.

All existing loadouts must be saved over (spawning it then replacing works just fine) to fix permissions and ammo.

blackfirefly000 avatar Jun 27 '25 06:06 blackfirefly000

Had an issue with the menu not showing.

the WP placeholder is present in the final ace permission, removed it and got the menu to show

changed add_ace builtin.everyone "vMenu.WeaponOptions.WPAddonWeapons" allow # addon weapons dlc

to

  • add_ace builtin.everyone "vMenu.WeaponOptions.AddonWeapons" allow # addon weapons dlc

can confirm that the addon weapon menu shows after editing the permission name

rco-titus avatar Aug 18 '25 09:08 rco-titus

Had an issue with the menu not showing.

the WP placeholder is present in the final ace permission, removed it and got the menu to show

changed add_ace builtin.everyone "vMenu.WeaponOptions.WPAddonWeapons" allow # addon weapons dlc

to

  • add_ace builtin.everyone "vMenu.WeaponOptions.AddonWeapons" allow # addon weapons dlc

can confirm that the addon weapon menu shows after editing the permission name

Thanks for finding this. I've made a commit to fix it

blackfirefly000 avatar Aug 25 '25 05:08 blackfirefly000