Installation
Installing & dependencies.
Dependencies
- NodeJS (for installing with npm.)
- Server version atleast 4752. (to support lua54 & escrow)
Install
- Extract the .zip and copy the folder in your resources folder.
- Install the npm dependencies, open a terminal in the folder
avp_login_reward
and typenpm install
. - Do not close the terminal, type
npm run build
, this will build the lua files and the NUI also. (Vue-Vite) - Import the .sql file into your database.
- Modify the locales, they are located in the
locales
folder. - start avp_login_rewards
Multicharacter
If you have a multicharacter resource, then you will have to modify the GetIdentifier function in the config.lua
file. Otherwise they will be the same on each character.
Lua bundling
warning
Modifying a .lua
file which is located in the source
folder will not apply instantly, you have to recompile the lua files with the npm run build
command. (terminal)
info
config and the locales are applied 'runtime', you do not have to recompile the things again.
Creating new reward
- Do not forget to add the image file in the path:
source/cef/src/assets/img
You should register the rewards in a shared file. (like config.lua)
addReward(1, {
name = "Moneybag",
description = "Contains $500",
img = "money.png",
cb = function(source)
local xPlayer = ESX.GetPlayerFromId(source)
if not xPlayer then return end
xPlayer.addAccountMoney("bank", 500)
end
})