We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace this function in server.lua to Support ESX 1.2 ; ESX v1-final and ESX Legacy :) Add Config.ForceMoney = true to your config.lua
server.lua
Config.ForceMoney = true
config.lua
function addMoney(identifier,money,business) if not identifier then return end local xPlayer = ESX.GetPlayerFromIdentifier(identifier) local money = math.floor(tonumber(money)) if xPlayer then print("[^1"..GetCurrentResourceName().."^7] Adding money to "..GetPlayerName(xPlayer.source).." - "..identifier.." ("..tostring(money).."$)") TriggerClientEvent('esx:showNotification', xPlayer.source, _L("received_money"):format(tostring(money),business)) xPlayer.addAccountMoney("bank", math.floor(money)) else --print("[^1"..GetCurrentResourceName().."^7] An error occured while adding money to "..identifier.." ("..tostring(money).."$). The player is offline.") if Config.ForceMoney then print("[^1"..GetCurrentResourceName().."^7] Forcing adding money to " .. identifier .. " (" ..tostring(money).. "$). The player is offline.") --MySQL.Sync.execute('UPDATE `users` SET `bank` = `bank` + @bank WHERE `identifier` = @identifier',{['@bank'] = money, ['@identifier'] = identifier}) MySQL.Async.fetchAll('SELECT accounts FROM users WHERE identifier = @identifier', { ["@identifier"] = identifier }, function(result) if result[1] then local accs = json.decode(result[1].accounts) accs.bank = accs.bank + money MySQL.Async.execute("UPDATE users SET accounts = @bank WHERE identifier = @identifier", { ["@identifier"] = identifier, ["@bank"] = json.encode(accs) }) end end) end end end
Please do not close this, so that everybody can see this :)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Replace this function in
server.lua
to Support ESX 1.2 ; ESX v1-final and ESX Legacy :)Add
Config.ForceMoney = true
to yourconfig.lua
Please do not close this, so that everybody can see this :)
The text was updated successfully, but these errors were encountered: