I welcome you CFX community!
Today I present you the Battle Pass system! Battle Pass is a game event during which, by completing tasks, you receive rewards (You can configure up to what date the pass will work). Iโm sure you and your players will love it!
The pass is divided into two types: Free and Premium. There are 100 levels in total (You can do more), each paid and free level is configurable. Up to 4 rewards can be set in a level cell.
To pump the level, you can buy it for currency, you can also perform tasks that are very easy to configure, and you can also use exports that will help you implement adding / taking away the level and experience from players. Every 1000 experience will give you 1 level.
Demonstration of the system:
Example of a configuration file:
Configuration files
-- /*
-- โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
-- โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
-- โโโโโโโฆโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
-- โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
-- โโโโโโโฆโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
-- โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ*/
Config = {}
-- Are you using ESX?
Config.UseESX = true
-- Enable this if ESX throws an error: Used the getSharedObject Event, this event no longer exists!
Config.UseESX_lib = false
-- Are you using QBCore?
Config.UseQBCore = false
-- Are you using QBCore?
Config.UseStandalone = false
Config.PassPrice1 = 1000
Config.PassPrice2 = 5000
Config.PassPrice3 = 20000
Config.GiftPassPrice = 1000
Config.LvlPrice = {900,1500,2700}
Config.EndPassDate = "2030-12-30" -- If the date < the current date, then battlepacks will not open!
Config.useCommandNameOpenMenu = true
Config.commandNameOpenMenu = 'battlepass'
Config.keyMappingOpenMenuText = 'Open battlepass'
Config.keyMappingOpenMenu = 'f10'
Config.getExpEveryNTime = false
Config.expEveryNTime = 10
Config.expTime = 60000 -- 1 min in msc
---------------------------------Translation
Config.Translation1 = "Days until the end of the pass: "
Config.Translation2 = "Battle pass"
Config.Translation3 = "Quests"
Config.Translation4 = "Buy as a gift"
Config.Translation5 = "Your ID: "
Config.Translation6 = "Send"
Config.Translation7 = "Gift Price: $"
Config.Translation8 = "Standard pass"
Config.Translation9 = "Nothing superfluous, it will just open up premium pass options"
Config.Translation10 = "Buy for $"
Config.Translation11 = "Extended Pass"
Config.Translation12 = "Includes a Standard pass and 20 levels to it"
Config.Translation13 = "Royal Pass"
Config.Translation14 = "Includes a Standard Pass and 100 levels to it"
Config.Translation15 = "Buy pass levels!"
Config.Translation16 = "More levels - more chances to find rare rewards"
Config.Translation17 = "Set"
Config.Translation18 = "Price"
Config.Translation19 = "Quantity"
Config.Translation20 = "Total levels"
Config.Translation21 = "Total price"
Config.Translation22 = "5 levels"
Config.Translation23 = "10 levels"
Config.Translation24 = "20 levels"
Config.Translation25 = "Buy"
Config.Translation26 = "Buy a pass"
Config.Translation27 = "Buy as a gift"
Config.Translation28 = "Buy levels"
Config.Translation29 = "Premium"
Config.Translation30 = "Free"
Config.Translation31 = "Meet the Battle Pass with exciting tasks and limited rewards that are already waiting for you and your friends!"
Config.Translation32 = "$"
---------------------------------CONFIG
Config.freelvls = { --Rewards that a player can get without a purchased battle pass
[1] = { --Cell
items = {
{
Name = "$500", --Cell name in UI
Taken = false, --The parameter of whether the reward is taken (It is better not to change if you are not sure)
Picture = "10.png", --The image of the item that is located on the path Burevestnik_battlepass\ui\img\items
Type = "money", --Type of reward ("money"/"item")
Reward = "500", --Reward
Category = "freelvls", --Subject category ("freelvls"/"premiumlvl")
},
},
},
[3] = { --Cell
items = {
{
Name = "Orange", --Cell name in UI
Taken = false, --The parameter of whether the reward is taken (It is better not to change if you are not sure)
Picture = "2.png", --The image of the item that is located on the path Burevestnik_battlepass\ui\img\items
Type = "item", --Type of reward ("money"/"item")
Reward = "orange", --Reward
Category = "freelvls", --Subject category ("freelvls"/"premiumlvl")
},
},
},
[5] = { --Cell
items = {
{
Name = "Rose", --Cell name in UI
Taken = false, --The parameter of whether the reward is taken (It is better not to change if you are not sure)
Picture = "6.png", --The image of the item that is located on the path Burevestnik_battlepass\ui\img\items
Type = "item", --Type of reward ("money"/"item")
Reward = "rose", --Reward
Category = "freelvls", --Subject category ("freelvls"/"premiumlvl")
},
{
Name = "$1000", --Cell name in UI
Taken = false, --The parameter of whether the reward is taken (It is better not to change if you are not sure)
Picture = "11.png", --The image of the item that is located on the path Burevestnik_battlepass\ui\img\items
Type = "money", --Type of reward ("money"/"item")
Reward = "1000", --Reward
Category = "freelvls", --Subject category ("freelvls"/"premiumlvl")
},
{
Name = "Letter", --Cell name in UI
Taken = false, --The parameter of whether the reward is taken (It is better not to change if you are not sure)
Picture = "8.png", --The image of the item that is located on the path Burevestnik_battlepass\ui\img\items
Type = "item", --Type of reward ("money"/"item")
Reward = "letter", --Reward
Category = "freelvls", --Subject category ("freelvls"/"premiumlvl")
},
},
},
}
Config.premiumlvl = { --Rewards that a player can only get from a purchased battle pass
[1] = { --Cell
items = {
{
Name = "First aid kit", --Cell name in UI
Taken = false, --The parameter of whether the reward is taken (It is better not to change if you are not sure)
Picture = "14.png", --The image of the item that is located on the path Burevestnik_battlepass\ui\img\items
Type = "item", --Type of reward ("money"/"item")
Reward = "aidkit", --Reward
Category = "premiumlvl" --Subject category ("freelvls"/"premiumlvl")
}
}
},
[2] = { --Cell
items = {
{
Name = "$1500", --Cell name in UI
Taken = false, --The parameter of whether the reward is taken (It is better not to change if you are not sure)
Picture = "12.png", --The image of the item that is located on the path Burevestnik_battlepass\ui\img\items
Type = "money", --Type of reward ("money"/"item")
Reward = "1500", --Reward
Category = "premiumlvl", --Subject category ("freelvls"/"premiumlvl")
},
{
Name = "Bong", --Cell name in UI
Taken = false, --The parameter of whether the reward is taken (It is better not to change if you are not sure)
Picture = "7.png", --The image of the item that is located on the path Burevestnik_battlepass\ui\img\items
Type = "item", --Type of reward ("money"/"item")
Reward = "bong", --Reward
Category = "premiumlvl", --Subject category ("freelvls"/"premiumlvl")
},
{
Name = "Orange", --Cell name in UI
Taken = false, --The parameter of whether the reward is taken (It is better not to change if you are not sure)
Picture = "2.png",--The image of the item that is located on the path Burevestnik_battlepass\ui\img\items
Type = "item", --Type of reward ("money"/"item")
Reward = "orange", --Reward
Category = "premiumlvl", --Subject category ("freelvls"/"premiumlvl")
},
{
Name = "$1500", --Cell name in UI
Taken = false, --The parameter of whether the reward is taken (It is better not to change if you are not sure)
Picture = "12.png", --The image of the item that is located on the path Burevestnik_battlepass\ui\img\items
Type = "money", --Type of reward ("money"/"item")
Reward = "1500", --Reward
Category = "premiumlvl", --Subject category ("freelvls"/"premiumlvl")
},
}
},
[4] = { --Cell
items = {
{
Name = "Bag", --Cell name in UI
Taken = false, --The parameter of whether the reward is taken (It is better not to change if you are not sure)
Picture = "1.png", --The image of the item that is located on the path Burevestnik_battlepass\ui\img\items
Type = "item", --Type of reward ("money"/"item")
Reward = "bag", --Reward
Category = "premiumlvl", --Subject category ("freelvls"/"premiumlvl")
}
}
},
[6] = { --Cell
items = {
{
Name = "$1000", --Cell name in UI
Taken = false, --The parameter of whether the reward is taken (It is better not to change if you are not sure)
Picture = "11.png", --The image of the item that is located on the path Burevestnik_battlepass\ui\img\items
Type = "money", --Type of reward ("money"/"item")
Reward = "1000", --Reward
Category = "premiumlvl", --Subject category ("freelvls"/"premiumlvl")
},
{
Name = "Donut", --Cell name in UI
Taken = false, --The parameter of whether the reward is taken (It is better not to change if you are not sure)
Picture = "3.png", --The image of the item that is located on the path Burevestnik_battlepass\ui\img\items
Type = "item", --Type of reward ("money"/"item")
Reward = "donut", --Reward
Category = "premiumlvl", --Subject category ("freelvls"/"premiumlvl")
},
}
}
}
Config.quests = { --Quests available in the battle pass
{
ID = 1, --The ID of the quest to which must be unique and which must be accessed during the use of the export
Name = "Quick lunch", --Name of the quest
Description = "Eat a burger", --Description of the quest
Progress = 0, --The current progress of the quest by the player. Starting position 0
Max = 4, --Maximum number of stages for a quest
Rewards = 300, --Reward
Complete = false --The parameter of whether the quest is completed (It is better not to change if you are not sure)
},
{
ID = 2, --The ID of the quest to which must be unique and which must be accessed during the use of the export
Name = "Connection", --Name of the quest
Description = "Buy a phone", --Description of the quest
Progress = 0, --The current progress of the quest by the player. Starting position 0
Max = 1, --Maximum number of stages for a quest
Rewards = 500, --Reward
Complete = false --The parameter of whether the quest is completed (It is better not to change if you are not sure)
},
{
ID = 3, --The ID of the quest to which must be unique and which must be accessed during the use of the export
Name = "First job", --Name of the quest
Description = "Find a job at an employment center", --Description of the quest
Progress = 0, --The current progress of the quest by the player. Starting position 0
Max = 1, --Maximum number of stages for a quest
Rewards = 1000, --Reward
Complete = false --The parameter of whether the quest is completed (It is better not to change if you are not sure)
},
}
---You need to change this if you want to use a Standalone version or your own framework distinguishable from ESX or QBCore
---Insert your Standalone variables into this function
function buy(battlepassType)
local yourFunction = yourFunction.GetPlayerId(source)
if battlepassType == 0 then
if yourFunction.getMoney() >= Config.PassPrice1 then
yourFunction.removeMoney(Config.PassPrice1)
MySQL.Async.execute("UPDATE `burevestnik_battlepass` SET `status` = '1' WHERE owner ='"..identifier.."'")
end
elseif battlepassType == 1 then
if yourFunction.getMoney() >= Config.PassPrice2 then
yourFunction.removeMoney(Config.PassPrice2)
MySQL.Async.execute("UPDATE `burevestnik_battlepass` SET `status` = '1',`level` = `level`+ 20 + `level` WHERE owner ='"..identifier.."'")
end
elseif battlepassType == 2 then
if yourFunction.getMoney() >= Config.PassPrice3 then
yourFunction.removeMoney(Config.PassPrice3)
MySQL.Async.execute("UPDATE `burevestnik_battlepass` SET `status` = '1',`level` = `level`+ 100 + `level` WHERE owner ='"..identifier.."'")
end
end
end
---You need to change this if you want to use a Standalone version or your own framework distinguishable from ESX or QBCore
---Insert your Standalone variables into this function
function buyLvl(lvlAmount, amount)
local yourFunction = yourFunction.GetPlayerId(source)
if yourFunction.getMoney() >= amount then
yourFunction.removeMoney(amount)
MySQL.Async.execute("UPDATE `burevestnik_battlepass` SET `level` = `level`+'"..lvlAmount.."' WHERE owner ='"..identifier.."'")
end
end
---You need to change this if you want to use a Standalone version or your own framework distinguishable from ESX or QBCore
---Insert your Standalone variables into this function
function reward(battlepassRewardtype, battlepassReward)
local yourFunction = yourFunction.GetPlayerId(source)
if battlepassRewardtype == "money" then
yourFunction.addMoney(tonumber(battlepassReward))
elseif battlepassRewardtype == "item" then
yourFunction.addInventoryItem(battlepassReward, 1)
end
end
---You need to change this if you want to use a Standalone version or your own framework distinguishable from ESX or QBCore
---Insert your Standalone variables into this function
function gift(giftID)
local yourFunction = yourFunction.GetPlayerId(source)
if yourFunction.getMoney() >= Config.GiftPassPrice then
yourFunction.removeMoney(Config.GiftPassPrice)
MySQL.Async.execute("UPDATE `burevestnik_battlepass` SET `status` = '1' WHERE id ='"..giftID.."'")
end
end
--Event to open the menu
--TriggerEvent('bur_nui_battlepass:open')
---------------------------------exports
-- exports.Burevestnik_battlepass:Burevestnik_battlepass_plusLevel(amount)
-- exports.Burevestnik_battlepass:Burevestnik_battlepass_plusExp(amount)
-- exports.Burevestnik_battlepass:Burevestnik_battlepass_minusLevel(amount)
-- exports.Burevestnik_battlepass:Burevestnik_battlepass_minusExp(amount)
-- exports.Burevestnik_battlepass:Burevestnik_battlepass_progQuest(id,amount)
Optimization (The script consumes):
0.00 ms in a quiet state.
0.01 ms in an active state.
What does this Battle pass system include:
-
This system works on all versions of ESX, QBCore, as well as STANDALONE!
-
Beautiful user interface!
-
The ability to buy a friend a battle pass!
-
Convenient exports!
-
Psd file for the logo included!
-
The ability to customize rewards!
-
The end of the pass by a certain date !
-
The ability to customize quests to complete!
-
Support for Burevestnik Quest system V3!
-
Incredibly customizable configuration file!
-
You can completely change the user interface at will!
-
Of course support, Iโm ready to help you!
TOP SALES
You may also be interested in my other resources:
Code is accessible | Open source: Yes \ Escrow: No - Available only: config, ui |
Subscription-based | No |
Lines (approximately) | ~2000 |
Requirements | Standalone/ESX/QBCore |
Support | Yes |