Installation
Install the login reward resource, build its Lua and NUI files, and configure identifiers and rewards.
Required dependencies
Required for dependency installation and the Vue/Vite build.
Required for Lua 5.4 and escrow support.
Installation steps
- 01
Extract the resource
Copy the extracted folder into your server resources directory.
- 02
Install dependencies
Open a terminal in the resource folder and install its npm packages.
npm install - 03
Build the resource
Build the Lua bundle and Vue/Vite NUI.
npm run build - 04
Import the database
Import the included SQL file into your server database.
- 05
Configure locales
Edit the translations inside the locale directory.
locales/ - 06
Start the resource
Add the resource to your server configuration.
ensure avp_login_rewards
Multicharacter support
Identifier configuration
If you use a multicharacter resource, modify the GetIdentifier function in config.lua. Otherwise, the identifier will be the same for each character.
Lua bundling
Recompile source files
Changes to .lua files inside the source folder do not apply immediately. Run npm run build in the terminal to recompile them.
Runtime files
The config and locale files are applied at runtime, so changes to them do not require recompilation.
Creating a new reward
source/cef/src/assets/imgAdd the image used by the new reward here.
Register a reward
Register rewards in a shared file, such as 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
})