Plugins
Third-party plugins
Third-party plugins
A third-party plugin is a normal FiveM resource that declares bridge metadata in fxmanifest.lua.
Resource based
Ship plugins as FiveM resources
Bridge context
Plugin code receives
mp and pluginDisable support
Matched by
bridge_plugin_namefxmanifest metadata
fx_version 'cerulean'
game 'gta5'
bridge_plugin 'yes'
bridge_plugin_name 'my-plugin'
bridge_server_script 'dist/server.js'
bridge_client_script 'dist/client.js'Both sides are optional by design
Provide the server script, client script, or both depending on what your plugin does. The bridge reads the correct metadata key for the current side.
Write plugin code
mp.events.add('playerJoin', (player) => {
plugin.log('joined:', player.name);
});mp.events.add('render', () => {
// draw helpers, telemetry, compatibility hooks, etc.
});const eventName = plugin.namespace('ready');
mp.events.add(eventName, (player) => {
plugin.log('ready from', player.name);
});Plugin helper
| Helper | Description |
|---|---|
plugin.name | The resolved plugin name. |
plugin.resource | The FiveM resource that provided the plugin. |
plugin.builtin | true for built-ins, false for external plugins. |
plugin.namespace(event) | Returns a namespaced event like my-plugin:ready. |
plugin.log(...args) | Logs with a [plugin:name] prefix. |
Load flow
The bridge scans started resources.
Resources with bridge_plugin 'yes' are considered plugins.
The bridge reads bridge_server_script or bridge_client_script for the current side.
The plugin script runs with mp and plugin available in scope.
Disable your plugin
disable_plugin 'my-plugin'