Events

You have some events to customize the script as you want and make it fully compatible with how your server works.

1) Replace loops / open tuning shop from external scripts.

-- By default is uses Loops with 3D text
-- but if you want to replace it with Polyzones you can use the event:
'av_tuning:enter'
-- It can be triggered client/server side and needs to receive an argument with the name
-- of the tuning shop:
TriggerEvent('av_tuning:enter','Bennys')
-- If you don't send the tuner shop as argument or it doesn't exist in Config
-- the script will print the next error:
"zone is not defined!".

2) Hide/Show Hud

-- The next event is triggered when you enter/exit from tuner menu
-- and it will send a boolean as argument.
RegisterNetEvent('av_tuning:hud', function(status)
if status then
-- Hide your HUD where inside tuner menu
else
-- Show your HUD, tuner menu is already closed.
end
end)

3) Society

-- Society isn't preconfigured in the script because there's a lot of different
-- society scripts out there and is complicated to make a config for each one...
-- Go to server/framework/money.lua > function TicketPayment(worker,total)
-- This function receives 2 parameters, the worker source and
-- the ticket total.
-- There's also a local variable called comission which is the comission
-- the worker will receive for installing the mods
-- To send all this to your society script we need to get the worker job
-- After we get the job we are gonna trigger your society event and send job and total
-- as arguments, from there it depends how your society works and how much money you
-- wanna add to society, feel free to make all the modifications you need to achieve this.
function TicketPayment(worker, total)
local src = worker
local comission = tonumber(total) * Config.MechanicComission / 100
if Config.Framework == "QBCore" then
local Player = QBCore.Functions.GetPlayer(src)
if Player then
Player.Functions.AddMoney("bank", comission)
local job = Player.PlayerData.job.name
TriggerEvent("your_society_event",job,total)
end
elseif Config.Framework == "ESX" then
local xPlayer = ESX.GetPlayerFromId(src)
if xPlayer then
xPlayer.addAccountMoney("bank",comission)
local job = xPlayer.job.name
TriggerEvent("your_society_event",job,total)
end
end
TriggerClientEvent('av_tuning:notification',src,Lang['you_received']..comission,'success')
end