Configuration
Don't touch this line
Config, Lang, Noti = {}, {}, {}
Framework Setup
Configure your framework and database settings:
--Use "esx" or "qb"
Config.Framework = "qb"
--If you are using one of the most recent versions of ESX, set the script name. Default = "es_extended"
Config.ESXExport = ""
--Default ESX: "esx:getSharedObject" | Default QB: "qb-core"
Config.Core = "qb-core"
--oxmysql, mysql-async or ghmattisql
Config.Mysql = "oxmysql"
General Settings
--Font to use in alert "Press E to access the business"
Config.alertTextFont = 4
--Color for the 3D text
Config.text3Dcolor = "~q~"
--Change to your currency
Config.currency = "$"
--Time it takes from the time the user accesses the server until the payment is received
Config.PaycheckTimer = 60
--Account to be used for most payments
Config.useAccount = "bank"
--Command to open te admin menu
Config.adminCommand = "adminbus"
--Configure your Discord Webhook to get logs
Config.Discord = ""
--Percentage earned by workers. 0.2 = 20%
Config.workersPercentage = 0.2
Notifications
Configure your notification system:
function notifications(notitype, message, time)
--Change this trigger for your notification system keeping the variables
TriggerEvent('codem-notification', message, time, notitype)
end
--Notifications types:
Noti.info = 'info'
Noti.check = 'check'
Noti.error = 'error'
--Notification time:
Noti.time = 5000
Marker Configuration
Customize the business access marker:
Marker = {
mtype = 23,
--RGB COLOR:
r = 245,
g = 14,
b = 70
}
Blip Configuration
Configure the blips that appear on the map:
Blips = {}
Blips.blip = 369
Blips.blipColor = 2
Blips.blipScale = 0.9
Blips.blipText = "Business"
Language Strings
Customize all in-game text messages:
Lang.createdbusiness = "The business has been created correctly"
Lang.errorcreatebusiness = "Business could not be created"
Lang.errorcreatebname = "There is already a business with the same name"
Lang.ownerChanged = "The owner of the business has been changed correctly"
Lang.noOwnerChanged = "It has not been possible to change the owner of the business. Maybe it is offline?"
Lang.deletedStock = "The entire stock of the business has been deleted"
Lang.noDeletedStock = "Failure to remove stock from the business"
Lang.deletedBusiness = "The business has been successfully deleted"
Lang.noDeletedBusiness = "Business has not been eliminated"
Lang.wipedBusiness = "All businesses have been wiped"
Lang.noWipedBusiness = "Unable to perform a wipe of the businesses"
Lang.pressE = "Press ~q~E~s~ to access the business"
Lang.price = "~w~Price: ~g~"
Lang.stockupdated = "The stock has been updated correctly"
Lang.stocknotupdated = "Stock could not be updated"
Lang.nomoney = "You don't have enough money"
Lang.targetError = "It has not been possible to recover the data of the player with id:"
Lang.addedWorker = "The worker has been successfully added to the business"
Lang.notAddedWorker = "The worker could not be added to the business"
Lang.soldBusiness = "The business has been successfully sold"
Lang.notSoldBusiness = "The business could not be sold"
Lang.businessAcquired = "The business has been acquired correctly"
Lang.businessNotAcquired = "The business could not be acquired"
Lang.paycheckReceived = "You have received a payment for your business"
Custom Functions
Get User Money
Function to retrieve player's money balance:
function getUserMoney(xPlayer)
if Config.Framework == "esx" then
local money = xPlayer.getAccount(Config.useAccount).money
return money
elseif Config.Framework == "qb" then
local money = xPlayer.PlayerData.money[Config.useAccount]
return money
end
end
Add User Money
Function to add money to player's account:
function addUserMoney(xPlayer, amount)
if Config.Framework == "esx" then
xPlayer.addMoney(amount)
elseif Config.Framework == "qb" then
xPlayer.Functions.AddMoney(Config.useAccount, amount, "Business")
end
end
Remove User Money
Function to remove money from player's account:
function removeUserMoney(xPlayer, amount)
if Config.Framework == "esx" then
xPlayer.removeAccountMoney(Config.useAccount, amount)
elseif Config.Framework == "qb" then
xPlayer.Functions.RemoveMoney(Config.useAccount, amount, "Business")
end
end