Repository containing the new JS module v2 module for alt:V multiplayer.
| Directory | Description |
|---|---|
| /client | Clientside JS module powered by V8 |
| /server | Serverside JS module powered by Node.js |
| /shared | Shared code for the clientside & serverside module |
| /docs | Documentation for the internal workings of the module |
| /deps | Global dependencies |
| /tools | Scripts for any tooling related to the module |
| /types | Typings for the API |
All contributions are greatly appreciated. If there are any questions or you would like to discuss a feature, contact the module maintainer.
Create .altvpkgrc.json in your server directory (directory where you have altv-server binary):
{
"loadJSV2Module": true
}Use altv-pkg to install all needed binaries:
npx altv-pkg release
Create resource with resource.toml containing the following:
type = 'jsv2'
main = 'server.js'
client-type = 'jsv2'
client-main = 'server.js'
# Uncomment if you want to use v1 API (alt-server, alt-client modules)
# [js-module-v2]
# compatibilityEnabled = trueNOTE: It's only needed if you are contributing or debugging the module, normally it's shipped with alt:V client on release and rc branches
NOTE: Client modules are only loaded when you are on the dev branch and have debug mode enabled.
-
Download the latest
js-module-v2-windows-client.zipfile from the Releases page. -
Copy the
modulesfolder into your alt:V client directory (the folder wherealtv.exeis located). -
Once you start alt:V, a popup will appear, asking whether you want to run unofficial modules. Click "Yes"
NOTE: Your server must be on the latest dev branch for the module to load correctly.
-
Download the latest
js-module-v2-windows-server.ziporjs-module-v2-linux.zipfile from the Releases page. -
Copy the
modules/js-module-v2.*files (for Windows) orlibjs-module-v2.sofile (for Linux) into your server'smodulesfolder. -
Copy the
libnodev2.dllfile (for Windows) orlibnodev2.sofile (for Linux) into the root folder of your server, where youraltv-server.exe(for Windows) oraltv-server(for Linux) executable is located. -
Load the module by adding
'js-module-v2'to the array of modules in yourserver.tomlfile. -
Create a resource with
type = "jsv2"andclient-type = "jsv2"inresource.tomlfile.
Alternatively, you can also download the server module from the official alt:V CDN server:
-
Windows: https://cdn.alt-mp.com/js-module-v2/dev/x64_win32/update.json
-
Linux: https://cdn.alt-mp.com/js-module-v2/dev/x64_linux/update.json
Add this to resource.toml to use v1 API (alt-client, alt-server, etc.)
[js-module-v2]
compatibilityEnabled = true