mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-31 02:08:55 +00:00
Added respawn to config, very final commit v1.2.0
This commit is contained in:
+8
-7
@@ -275,11 +275,11 @@ function RemoveItemsAfterRPDeath()
|
||||
end
|
||||
|
||||
ESX.TriggerServerCallback('esx_ambulancejob:removeItemsAfterRPDeath', function()
|
||||
ESX.SetPlayerData('lastPosition', Config.Zones.HospitalInteriorInside1.Pos)
|
||||
ESX.SetPlayerData('lastPosition', Config.RespawnPoint.coords)
|
||||
ESX.SetPlayerData('loadout', {})
|
||||
|
||||
TriggerServerEvent('esx:updateLastPosition', Config.Zones.HospitalInteriorInside1.Pos)
|
||||
RespawnPed(PlayerPedId(), Config.Zones.HospitalInteriorInside1.Pos)
|
||||
TriggerServerEvent('esx:updateLastPosition', Config.RespawnPoint.coords)
|
||||
RespawnPed(PlayerPedId(), Config.RespawnPoint.coords, Config.RespawnPoint.heading)
|
||||
|
||||
StopScreenEffect('DeathFailOut')
|
||||
DoScreenFadeIn(800)
|
||||
@@ -287,11 +287,11 @@ function RemoveItemsAfterRPDeath()
|
||||
end)
|
||||
end
|
||||
|
||||
function RespawnPed(ped, coords)
|
||||
function RespawnPed(ped, coords, heading)
|
||||
SetEntityCoordsNoOffset(ped, coords.x, coords.y, coords.z, false, false, false, true)
|
||||
NetworkResurrectLocalPlayer(coords.x, coords.y, coords.z, coords.heading, true, false)
|
||||
NetworkResurrectLocalPlayer(coords.x, coords.y, coords.z, heading, true, false)
|
||||
SetPlayerInvincible(ped, false)
|
||||
TriggerEvent('playerSpawned', coords.x, coords.y, coords.z, coords.heading)
|
||||
TriggerEvent('playerSpawned', coords.x, coords.y, coords.z)
|
||||
ClearPedBloodDamage(ped)
|
||||
|
||||
ESX.UI.Menu.CloseAll()
|
||||
@@ -340,7 +340,8 @@ AddEventHandler('esx_ambulancejob:revive', function()
|
||||
RespawnPed(playerPed, {
|
||||
x = coords.x,
|
||||
y = coords.y,
|
||||
z = coords.z
|
||||
z = coords.z,
|
||||
heading = 0.0
|
||||
})
|
||||
|
||||
StopScreenEffect('DeathFailOut')
|
||||
|
||||
@@ -27,6 +27,8 @@ Config.RemoveItemsAfterRPDeath = true
|
||||
Config.EarlyRespawnFine = false
|
||||
Config.EarlyRespawnFineAmount = 5000
|
||||
|
||||
Config.RespawnPoint = { coords = vector3(341.07, -1397.31, 32.51), heading = 48.5}
|
||||
|
||||
Config.Hospitals = {
|
||||
|
||||
CentralLosSantos = {
|
||||
|
||||
Reference in New Issue
Block a user