Jo Libraries
A standalone libraries for providing reusable code to increase the compatibility between scrips.
<div class="flex-buttons"> <a class="box-button" href="https://github.com/Jump-On-Studios/RedM-jo_libs" target="_blank"><i class="pi pi-github" />Github</a> <a class="box-button" href="https://github.com/Jump-On-Studios/RedM-jo_libs/releases/latest/download/jo_libs.zip" target="_blank"><i class="pi pi-download" />Download</a> </div>
Installation
- Download the last release of the library
- Add the resource
jo_libsin your resources folder - Add
ensure jo_libsin your server.cfg
Usage
- To use libraries, just add the initiator as a shared script inside of your
fxmanifest.luafile.
shared_scripts {
'@jo_libs/init.lua'
}
- List modules you want use inside the
fxmanifest.lua(in lowercase)
jo_libs {
'print',
'table',
}
You can now use the libraries inside of your resource with the jo global variable.
Update
Since jo_libs is file-based, keeping old or deprecated files in your folder can cause issues. To update it correctly, follow these steps:
- Download the latest release of the library.
- Delete your existing
jo_libsfolder from yourresourcesdirectory. - Extract the contents of
jo_libs.zip. - Place the new
jo_libsfolder into yourresourcesdirectory. - Clear your server cache.
- Restart your server.
:::danger
Don't drag and drop the update over the old jo_libs folder!
:::