Example Plugin, TypeScript
The TypeScript version of the vMenu Enhanced example plugin.
هذه الصفحة غير مترجمة بعد. تُعرض النسخة الإنجليزية.
What is it
The TypeScript version of the example plugin. Resource name vMenu.ExamplePlugin.TypeScript.
Where do I look
| File | Contains |
|---|---|
src/client.ts | The menu, translations and gates |
src/server.ts | Permissions and settings |
build.mjs | Bundles each half into one script FiveM can load |
fxmanifest.lua | The manifest |
API docs: TypeScript setup.
Building this example
- Install Node.js 22 or newer.
- Run
npm ciand thennpm run buildin this folder. - Copy
build/vMenu.ExamplePlugin.TypeScript/into your server'sresourcesfolder andensureit.
Making your own plugin
- In your own resource folder, install the plugin API at the vMenu Enhanced version your server runs, plus esbuild:
npm init -y npm install @vespura/vmenu-plugin@<your vMenu version> --save-exact npm install esbuild --save-dev - Write
src/client.ts(import from@vespura/vmenu-plugin/client) andsrc/server.ts(import from@vespura/vmenu-plugin/server). - Bundle each into one plain script,
dist/client.jsanddist/server.js, with esbuild'sformat: 'iife'.build.mjsshows how. - Add an
fxmanifest.luawithclient_script 'dist/client.js'andserver_script 'dist/server.js', thenensurethe resource.