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 = true
NOTE: 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.zip
file from the Releases page. -
Copy the
modules
folder into your alt:V client directory (the folder wherealtv.exe
is 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.zip
orjs-module-v2-linux.zip
file from the Releases page. -
Copy the
modules/js-module-v2.*
files (for Windows) orlibjs-module-v2.so
file (for Linux) into your server'smodules
folder. -
Copy the
libnodev2.dll
file (for Windows) orlibnodev2.so
file (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.toml
file. -
Create a resource with
type = "jsv2"
andclient-type = "jsv2"
inresource.toml
file.
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