Open shared.lua and find the CustomFunctions.AddMoneyToPlayer function. Here’s where you work your magic:
Note : This will be execute if choose standalone in config.lua
-- Specify the framework to use: 'qb-core', 'esx', or 'standalone'
Config.Framework = 'standalone'
function CustomFunctions.AddMoneyToPlayer(playerId, amount, reason)
-- Your custom money-adding logic goes here!
-- Example:
-- TriggerEvent('your-economy-resource:addMoney', playerId, 'bank', amount, reason)
end
-- Custom function to remove money from player
function CustomFunctions.RemoveMoneyFromPlayer(playerId, amount, reason)
-- Example implementation (needs to be replaced with actual logic):
print("Removing $" .. amount .. " from player " .. playerId .. " for reason: " .. reason)
-- Add your custom money-removing logic here
-- For example:
-- local playerMoney = GetPlayerMoney(playerId) -- You need to implement this
-- if playerMoney >= amount then
-- TriggerEvent('Framework:removeMoney', playerId, 'bank', amount, reason)
-- return true
-- end
-- return false
-- Temporary return for example
return true
end