Server/Framework support
This is an in depth explanation on how to setup our open functions to make this script compatible with any other script that you might be using!
SERVER SIDE:
-- The reason of these functions is to elliminate Framework dependency
-- and allow for adaptability on any kind of accounts/society/inventory scripts
-- for the script to work , you would have to fill the functions here !
ESX = nil
QBCore = nil
QBX = nil
function AddLaunderedMoney(playerId,whiteEconomy,amount)
exports.ox_inventory:AddItem(playerId,whiteEconomy,amount)
end
function AddJobMoney(job,amount)
-- You can add your own logic on how the job will recive the money ,
-- the amount on top has alredy beed divided by the rate you set in the config
-- an example with our unreleased society script
-- !!! THIS EXAMPLE WILL NOT WORK ON YOUR SERVER !!!
-- local _, func = exports.ip_society:GetSocietyAccount(job)
-- func.add(amount)
end
function LogLaunder(data)
-- You can add your logs here, this is called whenever somebody starts laundering
--DATA:
--source
--name
--message
--amount
--location (jobName)
--amount_to_job
end
function LogFinishLaunder(data)
-- You can add your logs here, this is called whenever somebody recives money from laundering
-- DATA:
-- source
-- message
-- amount
end
function SearchPlayerMoney(playerId)
--this must return an amount i.e 50000
-- an example using ox_inventory
return exports.ox_inventory:Search(playerId, 'count', Config.blackEconomy)
end
function RemovePlayerMoney(playerId, amount)
--example using ox_inventory
exports.ox_inventory:RemoveItem(playerId, Config.blackEconomy, amount)
end
function RemovePlayerItem(playerId, item, amount)
--example using ox_inventory
exports.ox_inventory:RemoveItem(playerId, item, amount)
end
CLIENT SIDE:
function HasItem(item)
return exports.ox_inventory:Search("count", item)
end
Last updated