mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-02 06:28:54 +00:00
1 parent
5850640094
commit
8ca3c1bdfc
21 files changed
+190
-7
No files matched your search
@@ -0,0 +1,20 @@
|
||||
### setPaymentMethod
|
||||
|
||||
Replaces the standard payment method using "money" as an item.
|
||||
|
||||
```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)
|
||||
```
|
||||
Reference in new issue
Block a user