Configuration â
All configuration for EEnE Rewards is handled inside the config.lua
file. This file allows you to:
- Define achievements
- Specify progressive or non-progressive behavior
- Assign rewards to steps or full completions
- Attach optional callbacks on completion
Achievement Types â
There are two types of achievements:
đ§ Note:
- Use
TriggerServerEvent('eee-rewards:addAchievementPoint', ...)
on the client-side.- Use
exports['eee-rewards']:addAchievementPoint(source, ...)
on the server-side.
Progressive Achievements â
Players progress through steps one-by-one in sequence. The system automatically tracks progress and unlocks the next step when the previous one is completed.
Trigger example:
lua
TriggerServerEvent('eee-rewards:addAchievementPoint', 'zombie_hunter', nil, 1)
Non-Progressive Achievements â
Each step can be completed independently, and requires specifying a stepName
.
Trigger example:
lua
TriggerServerEvent('eee-rewards:addAchievementPoint', 'boss_slayer', 'kill_clause', 1)
Rewards â
Each step and/or full achievement can have its own rewards. Rewards are defined as a list of tables:
lua
rewards = {
{ name = 'cash', count = 500 },
{ name = 'item_bandage', count = 2 }
}
Custom Callbacks â
Each step (or the entire achievement) can trigger client and/or server callbacks when completed:
lua
onComplete = {
Client = function()
-- optional client-side logic
return true
end,
Server = function(identifier, source)
-- optional server-side logic
return true
end
}
âšī¸ The server callback receives both the player's
identifier
andsource
.
Full Example â Progressive Achievement â
lua
['zombie_hunter'] = {
name = 'zombie_hunter',
label = 'Zombie Hunter',
isProgressive = true,
steps = {
[1] = {
label = 'Kill %d zombies',
countRequired = 10,
rewards = {
{ name = 'cash', count = 500 },
},
onComplete = {
Client = function()
return true
end,
Server = function(identifier, source)
-- You can define your logic here
return true
end,
}
},
[2] = {
label = 'Kill %d zombies',
countRequired = 50,
rewards = {
{ name = 'cash', count = 500 },
},
onComplete = {
Client = function()
return true
end,
Server = function(identifier, source)
-- You can define your logic here
return true
end,
}
},
[3] = {
label = 'Kill %d zombies',
countRequired = 100,
rewards = {
{ name = 'cash', count = 500 },
},
onComplete = {
Client = function()
return true
end,
Server = function(identifier, source)
-- You can define your logic here
return true
end,
}
},
},
rewards = {
{ name = 'cash', count = 2000 },
},
onComplete = {
Client = function()
end,
Server = function(identifier, source)
-- You can define your logic here
end,
}
}
Full Example â Non-Progressive Achievement â
lua
['boss_slayer'] = {
name = 'boss_slayer',
label = 'Boss Slayer',
isProgressive = false,
steps = {
[1] = {
name = 'kill_smertohvat',
label = 'Kill Maracumba Boss',
countRequired = 1,
rewards = {
{ name = 'cash', count = 500 },
},
onComplete = {
Client = function()
return true
end,
Server = function(identifier, source)
-- You can define your logic here
return true
end,
}
},
[2] = {
name = 'kill_clause',
label = 'Kill Claus Boss',
countRequired = 1,
rewards = {
{ name = 'cash', count = 500 },
},
onComplete = {
Client = function()
return true
end,
Server = function(identifier, source)
-- You can define your logic here
return true
end,
}
}
},
rewards = {
{ name = 'cash', count = 2000 },
},
onComplete = {
Client = function()
end,
Server = function(identifier, source)
-- You can define your logic here
end,
}
}