vMenu Docs

Example Plugin, JavaScript

The JavaScript version of the vMenu Enhanced example plugin.

What is it

The plain JavaScript version of the example plugin, no build step. Resource name vMenu.ExamplePlugin.JavaScript.

Where do I look

FileContains
client.jsThe menu, translations and gates
server.jsPermissions and settings
vmenu.jsThe plugin API
fxmanifest.luaThe manifest

API docs: JavaScript setup. Want a bundler and types? See the TypeScript example.

Building this example

Nothing to build. Copy this folder into your server's resources folder, rename it to vMenu.ExamplePlugin.JavaScript and ensure it.

Making your own plugin

  1. Take vmenu.js from the plugin-api folder of the vMenu Enhanced zip your server runs, and put it in your resource.
  2. Load it before your own scripts in fxmanifest.lua:
    shared_script 'vmenu.js'
    client_script 'client.js'
    server_script 'server.js'
  3. Use the global vMenu object in your scripts, for example const { VMenuPlugin } = vMenu;, then ensure the resource.

When you update vMenu, replace vmenu.js with the one from the new zip.

On this page