This commit is contained in:
Luke committed 2023-06-04 15:15:21 +02:00
1 parent 3cebaf7fa5
commit b5eba8423f
229 files changed
+6238 -10690

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
## setMoneyCheck
Override the built-in money check.
```lua
exports.ox_fuel:setMoneyCheck(method)
```
### Parameters
- method: `function(): number`
### Example
```lua
exports.ox_fuel:setMoneyCheck(function()
local accounts = ESX.GetPlayerData().accounts
for i = 1, #accounts do
if accounts[i].name == 'bank' then
return accounts[i].money
end
end
return 0
end)
```
+30
View File
@@ -0,0 +1,30 @@
## setPaymentMethod
Override the built-in payment method.
```lua
exports.ox_fuel:setPaymentMethod(method)
```
### Parameters
- method: `function(): boolean?`
### Example
```lua
exports.ox_fuel:setPaymentMethod(function(playerId, amount)
local xPlayer = ESX.GetPlayerFromId(playerId)
local bankAmount = xPlayer.getAccount('bank').money
if bankAmount >= amount then
xPlayer.removeAccountMoney('bank', amount)
return true
end
TriggerClientEvent('ox_lib:notify', source, {
type = 'error',
description = locale('not_enough_money', amount - bankAmount)
})
end)
```