mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-01 02:38:53 +00:00
Adds new timer
This commit is contained in:
+43
-4
@@ -34,6 +34,45 @@ ESX.RegisterServerCallback('esx_ambulancejob:removeItemsAfterRPDeath', function(
|
||||
|
||||
end)
|
||||
|
||||
ESX.RegisterServerCallback('esx_ambulancejob:removeItemsAfterRPDeathRemoveMoney', function(source, cb)
|
||||
|
||||
local xPlayer = ESX.GetPlayerFromId(source)
|
||||
|
||||
if Config.RemoveCashAfterRPDeath then
|
||||
xPlayer.set('money', 0)
|
||||
xPlayer.setAccountMoney('black_money', 0)
|
||||
end
|
||||
|
||||
if Config.EarlyRespawn and Config.EarlyRespawnFine then
|
||||
xPlayer.removeAccountMoney('bank', Config.EarlyRespawnFineAmount)
|
||||
end
|
||||
|
||||
if Config.RemoveItemsAfterRPDeath then
|
||||
for i=1, #xPlayer.inventory, 1 do
|
||||
if xPlayer.inventory[i].count > 0 then
|
||||
xPlayer.setInventoryItem(xPlayer.inventory[i].name, 0)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if Config.RemoveWeaponsAfterRPDeath then
|
||||
for i=1, #xPlayer.loadout, 1 do
|
||||
xPlayer.removeWeapon(xPlayer.loadout[i].name)
|
||||
end
|
||||
end
|
||||
|
||||
cb()
|
||||
|
||||
end)
|
||||
|
||||
ESX.RegisterServerCallback('esx_ambulancejob:getBankMoney', function(source, cb)
|
||||
|
||||
local xPlayer = ESX.GetPlayerFromId(source)
|
||||
local money = xPlayer.getAccount('bank').money
|
||||
|
||||
cb(money)
|
||||
end)
|
||||
|
||||
TriggerEvent('esx_phone:registerCallback', function(source, phoneNumber, message, anon)
|
||||
|
||||
local xPlayer = ESX.GetPlayerFromId(source)
|
||||
@@ -48,11 +87,11 @@ TriggerEvent('esx_phone:registerCallback', function(source, phoneNumber, message
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end)
|
||||
|
||||
TriggerEvent('es:addGroupCommand', 'respawn', 'admin', function(source, args, user)
|
||||
|
||||
TriggerEvent('es:addGroupCommand', 'revive', 'admin', function(source, args, user)
|
||||
|
||||
if args[2] ~= nil then
|
||||
TriggerClientEvent('esx_ambulancejob:revive', tonumber(args[2]))
|
||||
else
|
||||
@@ -61,4 +100,4 @@ TriggerEvent('es:addGroupCommand', 'respawn', 'admin', function(source, args, us
|
||||
|
||||
end, function(source, args, user)
|
||||
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Insufficient Permissions.")
|
||||
end, {help = 'Respawn', params = {{name = 'id'}}})
|
||||
end, {help = _U('revive_help'), params = {{name = 'id'}}})
|
||||
|
||||
Reference in New Issue
Block a user