The plain JavaScript version of the example plugin, no build step. Resource name vMenu.ExamplePlugin.JavaScript.
| File | Contains |
|---|---|
client.js |
The menu, translations and gates |
server.js |
Permissions and settings |
vmenu.js |
The plugin API |
fxmanifest.lua |
The manifest |
API docs: JavaScript setup. Want a bundler and types? See the TypeScript example.
Nothing to build. Copy this folder into your server's resources folder, rename it to vMenu.ExamplePlugin.JavaScript and ensure it.
- Take
vmenu.jsfrom theplugin-apifolder of the vMenu Enhanced zip your server runs, and put it in your resource. - Load it before your own scripts in
fxmanifest.lua:shared_script 'vmenu.js' client_script 'client.js' server_script 'server.js'
- Use the global
vMenuobject in your scripts, for exampleconst { VMenuPlugin } = vMenu;, thenensurethe resource.
When you update vMenu, replace vmenu.js with the one from the new zip.