Skip to content

Conversation

@tommy141x
Copy link

@tommy141x tommy141x commented Oct 19, 2025

Add Client Exports

I've been using my own build of vMenu with exports for years to let external Lua resources modify the menu. This makes it easy to create addon systems that can be maintained, updated, or removed separately without touching vMenu's core code.

This PR adds a single Exports.cs file that exposes client exports so you can create your own menus with MenuAPI and modify existing vMenu menus. External resources can plug into vMenu and add their own features.

Example plugin with full export documentation: https://github.com/tommy141x/vmenu-cinematic-cam
This documents all available exports and their usage/parameters.

Video demo: https://www.youtube.com/watch?v=WmI7_X3snmc
The demo showcases my custom framework plugin, ERS integration plugin, EUP plugin, and the cinematic camera plugin (linked above) all running together.

You can also test it live on my server at 178.156.146.100 (or fivem://connect/kqj4l6)

I think it could let vMenu have its own plugin ecosystem where people create and share addons. Whether you want to implement it this way or not, I figured I'd share what I've been using since it's worked well for me.

@cm8263 cm8263 added enhancement New feature or request big change labels Oct 19, 2025
@SkylarPlayz348
Copy link
Contributor

This is an interesting PR but how would you deal with permissions is that handled on the plugin or by vMenu. I know some people would want the plugin while others would want vMenu. I have briefly skimmed over the code so I may have missed this

@tommy141x
Copy link
Author

tommy141x commented Oct 19, 2025

Permission handling for anything added through the exports would be up to the resource using them. If an addon wanted to align with vMenu's ace permissions it could (by checking the same ace perms), or it could handle it entirely itself.

So maybe for my cinematic camera addon example, in the addon you could check for aces like "vMenu.CinematicCamera.All", and document that for people to add to their permissions file.

But for the framework addon in my server, it has it's own exports that let you get character info such as the job, and other addons use that information to decide weather to show certain menus or not.

Edit: Currently, if an addon tries to modify or add to a built-in menu you don’t have vMenu permissions for, Exports.cs won’t return the menu to the addon. Though I don’t really see a reason to keep that logic - I may make a commit to remove the permission logic from Exports.cs

@tommy141x
Copy link
Author

I did some cleanup & removed the permissions related logic since resources can simply use IsPlayerAceAllowed. To re-iterate, this wouldn't be an actual/official plugin system, it doesn't mess with any of vMenu's existing logic. It allows "plugins" to be created by exposing the exports to allow extending, modifying, or creating new menus with vMenu's system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

big change enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants