mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-04 16:23:21 +00:00
Death screen update, see description
The system has been changed, so that you will first enter a 'respawn available in x' timer, then after that a bleedout timer will appear.
This commit is contained in:
+6
-5
@@ -71,7 +71,7 @@ ESX.RegisterServerCallback('esx_ambulancejob:removeItemsAfterRPDeath', function(
|
||||
cb()
|
||||
end)
|
||||
|
||||
if Config.EarlyRespawn and Config.EarlyRespawnFine then
|
||||
if Config.EarlyRespawnFine then
|
||||
ESX.RegisterServerCallback('esx_ambulancejob:checkBalance', function(source, cb)
|
||||
local xPlayer = ESX.GetPlayerFromId(source)
|
||||
local bankBalance = xPlayer.getAccount('bank').money
|
||||
@@ -79,12 +79,13 @@ if Config.EarlyRespawn and Config.EarlyRespawnFine then
|
||||
cb(bankBalance >= Config.EarlyRespawnFineAmount)
|
||||
end)
|
||||
|
||||
ESX.RegisterServerCallback('esx_ambulancejob:payFine', function(source, cb)
|
||||
RegisterServerEvent('esx_ambulancejob:payFine')
|
||||
AddEventHandler('esx_ambulancejob:payFine', function()
|
||||
local xPlayer = ESX.GetPlayerFromId(source)
|
||||
TriggerClientEvent('esx:showNotification', xPlayer.source, _U('respawn_fine', Config.EarlyRespawnFineAmount))
|
||||
xPlayer.removeAccountMoney('bank', Config.EarlyRespawnFineAmount)
|
||||
local fineAmount = Config.EarlyRespawnFineAmount
|
||||
|
||||
cb()
|
||||
TriggerClientEvent('esx:showNotification', xPlayer.source, _U('respawn_bleedout_fine_msg', ESX.Math.GroupDigits(fineAmount)))
|
||||
xPlayer.removeAccountMoney('bank', fineAmount)
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user