mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-30 17:58:54 +00:00
Support latest esx
This commit is contained in:
+4
-5
@@ -28,12 +28,10 @@ AddEventHandler('esx:setJob', function(job)
|
||||
ESX.PlayerData.job = job
|
||||
end)
|
||||
|
||||
AddEventHandler('playerSpawned', function()
|
||||
AddEventHandler('esx:onPlayerSpawn', function()
|
||||
isDead = false
|
||||
TriggerServerEvent('esx_ambulancejob:onPlayerSpawn')
|
||||
|
||||
if firstSpawn then
|
||||
exports.spawnmanager:setAutoSpawn(false) -- disable respawn
|
||||
firstSpawn = false
|
||||
|
||||
if Config.AntiCombatLog then
|
||||
@@ -310,10 +308,11 @@ function RespawnPed(ped, coords, heading)
|
||||
SetEntityCoordsNoOffset(ped, coords.x, coords.y, coords.z, false, false, false, true)
|
||||
NetworkResurrectLocalPlayer(coords.x, coords.y, coords.z, heading, true, false)
|
||||
SetPlayerInvincible(ped, false)
|
||||
TriggerEvent('playerSpawned', coords.x, coords.y, coords.z)
|
||||
ClearPedBloodDamage(ped)
|
||||
|
||||
ESX.UI.Menu.CloseAll()
|
||||
TriggerServerEvent('esx:onPlayerSpawn')
|
||||
TriggerEvent('esx:onPlayerSpawn')
|
||||
TriggerEvent('playerSpawned') -- compatibility with old scripts, will be removed soon
|
||||
end
|
||||
|
||||
RegisterNetEvent('esx_phone:loaded')
|
||||
|
||||
+2
-2
@@ -43,8 +43,8 @@ AddEventHandler('esx_ambulancejob:onPlayerDistress', function()
|
||||
end
|
||||
end)
|
||||
|
||||
RegisterNetEvent('esx_ambulancejob:onPlayerSpawn')
|
||||
AddEventHandler('esx_ambulancejob:onPlayerSpawn', function()
|
||||
RegisterNetEvent('esx:onPlayerSpawn')
|
||||
AddEventHandler('esx:onPlayerSpawn', function()
|
||||
if deadPlayers[source] then
|
||||
deadPlayers[source] = nil
|
||||
TriggerClientEvent('esx_ambulancejob:setDeadPlayers', -1, deadPlayers)
|
||||
|
||||
Reference in New Issue
Block a user