Files
JagandLuke 1d2c490b26 refactor: Add h1 headers to all pages missing it (#137)
* refactor: Add h1 headers to all pages missing it

* refactor: missed example h3

* change hooks example heading to bold text

---------

Co-authored-by: Luke <[email protected]>
2023-07-08 11:08:43 +02:00

33 lines
636 B
Plaintext

# Functions
## 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)
```