Skip to content
New issue

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

refactor: no argument is already nil #21

Merged
merged 1 commit into from
Jun 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions server/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ ESX.RegisterServerCallback('esx_billing:payBill', function(source, cb, billId)
xTarget.showNotification(TranslateCap('received_payment', ESX.Math.GroupDigits(amount)))
cb(true)
else
cb(nil)
cb()
end
end)
elseif xPlayer.getAccount('bank').money >= amount then
Expand All @@ -126,17 +126,17 @@ ESX.RegisterServerCallback('esx_billing:payBill', function(source, cb, billId)
xTarget.showNotification(TranslateCap('received_payment', ESX.Math.GroupDigits(amount)))
cb(true)
else
cb(nil)
cb()
end
end)
else
xTarget.showNotification(TranslateCap('target_no_money'))
xPlayer.showNotification(TranslateCap('no_money'))
cb(nil)
cb()
end
else
xPlayer.showNotification(TranslateCap('player_not_online'))
cb(nil)
cb()
end
else
TriggerEvent('esx_addonaccount:getSharedAccount', result.target, function(account)
Expand All @@ -153,7 +153,7 @@ ESX.RegisterServerCallback('esx_billing:payBill', function(source, cb, billId)
end
cb(true)
else
cb(nil)
cb()
end
end)
elseif xPlayer.getAccount('bank').money >= amount then
Expand All @@ -169,7 +169,7 @@ ESX.RegisterServerCallback('esx_billing:payBill', function(source, cb, billId)
end
cb(true)
else
cb(nil)
cb()
end
end)
else
Expand All @@ -178,7 +178,7 @@ ESX.RegisterServerCallback('esx_billing:payBill', function(source, cb, billId)
end

xPlayer.showNotification(TranslateCap('no_money'))
cb(nil)
cb()
end
end)
end
Expand Down
Loading