mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-04 08:13:21 +00:00
fix(server): Don't set money to 0 before respawn if amount is negative
This commit is contained in:
+18
-4
@@ -15,8 +15,15 @@ ESX.RegisterServerCallback('esx_ambulancejob:removeItemsAfterRPDeath', function(
|
||||
local xPlayer = ESX.GetPlayerFromId(source)
|
||||
|
||||
if Config.RemoveCashAfterRPDeath then
|
||||
xPlayer.removeMoney(xPlayer.getMoney())
|
||||
xPlayer.setAccountMoney('black_money', 0)
|
||||
|
||||
if xPlayer.getMoney() > 0 then
|
||||
xPlayer.removeMoney(xPlayer.getMoney())
|
||||
end
|
||||
|
||||
if xPlayer.getAccount('black_money').money > 0 then
|
||||
xPlayer.setAccountMoney('black_money', 0)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
if Config.RemoveItemsAfterRPDeath then
|
||||
@@ -42,8 +49,15 @@ ESX.RegisterServerCallback('esx_ambulancejob:removeItemsAfterRPDeathRemoveMoney'
|
||||
local xPlayer = ESX.GetPlayerFromId(source)
|
||||
|
||||
if Config.RemoveCashAfterRPDeath then
|
||||
xPlayer.removeMoney(xPlayer.getMoney())
|
||||
xPlayer.setAccountMoney('black_money', 0)
|
||||
|
||||
if xPlayer.getMoney() > 0 then
|
||||
xPlayer.removeMoney(xPlayer.getMoney())
|
||||
end
|
||||
|
||||
if xPlayer.getAccount('black_money').money > 0 then
|
||||
xPlayer.setAccountMoney('black_money', 0)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
if Config.EarlyRespawn and Config.EarlyRespawnFine then
|
||||
|
||||
Reference in New Issue
Block a user