mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 17:28:53 +00:00
Fixed Bug Recconect When Die
when your die and you recconect you still alive and your item not removed
This commit is contained in:
@@ -40,7 +40,7 @@ AddEventHandler('esx:setJob', function(job)
|
||||
ESX.PlayerData.job = job
|
||||
end)
|
||||
|
||||
AddEventHandler('playerSpawned', function()
|
||||
--[[AddEventHandler('playerSpawned', function()
|
||||
IsDead = false
|
||||
|
||||
if FirstSpawn then
|
||||
@@ -58,6 +58,18 @@ AddEventHandler('playerSpawned', function()
|
||||
end
|
||||
end)
|
||||
end
|
||||
end)]]
|
||||
|
||||
RegisterNetEvent('esx_ambulancejob:multicharacter')
|
||||
AddEventHandler('esx_ambulancejob:multicharacter', function()
|
||||
IsDead = false
|
||||
|
||||
ESX.TriggerServerCallback('esx_ambulancejob:getDeathStatus', function(isDead)
|
||||
if isDead and Config.AntiCombatLog then
|
||||
ESX.ShowNotification(_U('combatlog_message'))
|
||||
RemoveItemsAfterRPDeath()
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
||||
-- Create blips
|
||||
@@ -180,13 +192,15 @@ end
|
||||
|
||||
function SendDistressSignal()
|
||||
local playerPed = PlayerPedId()
|
||||
local coords = GetEntityCoords(playerPed)
|
||||
PedPosition = GetEntityCoords(playerPed)
|
||||
|
||||
local PlayerCoords = { x = PedPosition.x, y = PedPosition.y, z = PedPosition.z }
|
||||
|
||||
ESX.ShowNotification(_U('distress_sent'))
|
||||
TriggerServerEvent('esx_phone:send', 'ambulance', _U('distress_message'), false, {
|
||||
x = coords.x,
|
||||
y = coords.y,
|
||||
z = coords.z
|
||||
|
||||
TriggerServerEvent('esx_addons_gcphone:startCall', 'ambulance', _U('distress_message'), PlayerCoords, {
|
||||
|
||||
PlayerCoords = { x = PedPosition.x, y = PedPosition.y, z = PedPosition.z },
|
||||
})
|
||||
end
|
||||
|
||||
@@ -332,13 +346,23 @@ function RemoveItemsAfterRPDeath()
|
||||
end)
|
||||
end
|
||||
|
||||
function RespawnPed(ped, coords, heading)
|
||||
--[[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()
|
||||
end]]
|
||||
|
||||
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('esx_ambulancejob:multicharacter', coords.x, coords.y, coords.z)
|
||||
ClearPedBloodDamage(ped)
|
||||
|
||||
ESX.UI.Menu.CloseAll()
|
||||
end
|
||||
|
||||
|
||||
+112
-15
@@ -2,9 +2,9 @@ Config = {}
|
||||
|
||||
Config.DrawDistance = 100.0
|
||||
|
||||
Config.Marker = { type = 21, x = 1.5, y = 1.5, z = 0.5, r = 102, g = 0, b = 102, a = 100, rotate = true }
|
||||
Config.Marker = { type = 21, x = 1.5, y = 1.5, z = 0.5, r = 102, g = 255, b = 102, a = 100, rotate = true }
|
||||
|
||||
Config.ReviveReward = 350 -- revive reward, set to 0 if you don't want it enabled
|
||||
Config.ReviveReward = 250 -- revive reward, set to 0 if you don't want it enabled
|
||||
Config.AntiCombatLog = true -- enable anti-combat logging?
|
||||
Config.LoadIpl = true -- disable if you're using fivem-ipl or other IPL loaders
|
||||
|
||||
@@ -26,34 +26,34 @@ Config.RemoveItemsAfterRPDeath = true
|
||||
Config.EarlyRespawnFine = false
|
||||
Config.EarlyRespawnFineAmount = 5000
|
||||
|
||||
Config.RespawnPoint = { coords = vector3(281.27, -581.24, 42.75), heading = 65.5 }
|
||||
Config.RespawnPoint = { coords = vector3(341.0, -1397.3, 32.5), heading = 48.5 }
|
||||
|
||||
Config.Hospitals = {
|
||||
|
||||
CentralLosSantos = {
|
||||
|
||||
Blip = {
|
||||
coords = vector3(289.71, -585.82, 42.19),
|
||||
coords = vector3(332.86, -1389.43, 32.5),
|
||||
sprite = 61,
|
||||
scale = 1.2,
|
||||
color = 2
|
||||
},
|
||||
|
||||
AmbulanceActions = {
|
||||
vector3(310.48, -599.23, 43.29)
|
||||
vector3(348.85, -1424.7, 32.94)
|
||||
},
|
||||
|
||||
Pharmacies = {
|
||||
vector3(270.5, -1363.22, 24.53)
|
||||
vector3(359.44, -1387.91, 32.43)
|
||||
},
|
||||
|
||||
|
||||
Vehicles = {
|
||||
{
|
||||
Spawner = vector3(295.27, -600.8, 43.3),
|
||||
Spawner = vector3(304.5, -1432.39, 29.93),
|
||||
InsideShop = vector3(446.7, -1355.6, 43.5),
|
||||
Marker = { type = 36, x = 1.0, y = 1.0, z = 1.0, r = 100, g = 50, b = 200, a = 100, rotate = true },
|
||||
SpawnPoints = {
|
||||
{ coords = vector3(290.26, -599.41, 43.15), heading = 151.5, radius = 1.0 },
|
||||
{ coords = vector3(297.2, -1429.5, 29.8), heading = 227.6, radius = 4.0 },
|
||||
{ coords = vector3(294.0, -1433.1, 29.8), heading = 227.6, radius = 4.0 },
|
||||
{ coords = vector3(309.4, -1442.5, 29.8), heading = 227.6, radius = 6.0 }
|
||||
}
|
||||
@@ -62,11 +62,11 @@ Config.Hospitals = {
|
||||
|
||||
Helicopters = {
|
||||
{
|
||||
Spawner = vector3(345.46, -580.32, 74.16),
|
||||
Spawner = vector3(317.5, -1449.5, 46.5),
|
||||
InsideShop = vector3(305.6, -1419.7, 41.5),
|
||||
Marker = { type = 34, x = 1.5, y = 1.5, z = 1.5, r = 100, g = 150, b = 150, a = 100, rotate = true },
|
||||
SpawnPoints = {
|
||||
{ coords = vector3(352.06, -588.03, 74.16), heading = 330.5, radius = 10.0 },
|
||||
{ coords = vector3(313.5, -1465.1, 46.5), heading = 142.7, radius = 10.0 },
|
||||
{ coords = vector3(299.5, -1453.2, 46.5), heading = 142.7, radius = 10.0 }
|
||||
}
|
||||
}
|
||||
@@ -98,14 +98,110 @@ Config.Hospitals = {
|
||||
},
|
||||
|
||||
{
|
||||
From = vector3(298.57, -584.43, 42.28),
|
||||
To = { coords = vector3(303.48, -586.12, 42.29), heading = 0.0 },
|
||||
From = vector3(298.58, -599.69, 42.4),
|
||||
To = { coords = vector3(337.67, -594.29, 27.83), heading = 70.88 },
|
||||
Marker = { type = 1, x = 1.5, y = 1.5, z = 1.0, r = 102, g = 0, b = 102, a = 100, rotate = false }
|
||||
},
|
||||
|
||||
{
|
||||
From = vector3(300.57, -585.11, 42.31),
|
||||
To = { coords = vector3(296.79, -584.34, 42.16), heading = 0.0 },
|
||||
From = vector3(340.55, -595.33, 27.8),
|
||||
To = { coords = vector3(299.35, -597.53, 42.4), heading = 335.43 },
|
||||
Marker = { type = 1, x = 1.5, y = 1.5, z = 1.0, r = 102, g = 0, b = 102, a = 100, rotate = false }
|
||||
}
|
||||
},
|
||||
|
||||
FastTravelsPrompt = {
|
||||
{
|
||||
From = vector3(237.4, -1373.8, 26.0),
|
||||
To = { coords = vector3(251.9, -1363.3, 38.5), heading = 0.0 },
|
||||
Marker = { type = 1, x = 1.5, y = 1.5, z = 0.5, r = 102, g = 0, b = 102, a = 100, rotate = false },
|
||||
Prompt = _U('fast_travel')
|
||||
},
|
||||
|
||||
{
|
||||
From = vector3(256.5, -1357.7, 36.0),
|
||||
To = { coords = vector3(235.4, -1372.8, 26.3), heading = 0.0 },
|
||||
Marker = { type = 1, x = 1.5, y = 1.5, z = 0.5, r = 102, g = 0, b = 102, a = 100, rotate = false },
|
||||
Prompt = _U('fast_travel')
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
|
||||
HOSPITAL2 = {
|
||||
|
||||
Blip = {
|
||||
coords = vector3(289.71, -585.82, 42.19),
|
||||
sprite = 61,
|
||||
scale = 1.2,
|
||||
color = 2
|
||||
},
|
||||
|
||||
AmbulanceActions = {
|
||||
vector3(310.48, -599.23, 43.29)
|
||||
},
|
||||
|
||||
Pharmacies = {
|
||||
vector3(270.5, -1363.22, 24.53)
|
||||
},
|
||||
|
||||
Vehicles = {
|
||||
{
|
||||
Spawner = vector3(295.27, -600.8, 43.3),
|
||||
InsideShop = vector3(446.7, -1355.6, 43.5),
|
||||
Marker = { type = 36, x = 1.0, y = 1.0, z = 1.0, r = 100, g = 50, b = 200, a = 100, rotate = true },
|
||||
SpawnPoints = {
|
||||
{ coords = vector3(290.26, -599.41, 43.15), heading = 151.5, radius = 1.0 }
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Helicopters = {
|
||||
{
|
||||
Spawner = vector3(345.46, -580.32, 74.16),
|
||||
InsideShop = vector3(305.6, -1419.7, 41.5),
|
||||
Marker = { type = 34, x = 1.5, y = 1.5, z = 1.5, r = 100, g = 150, b = 150, a = 100, rotate = true },
|
||||
SpawnPoints = {
|
||||
{ coords = vector3(352.06, -588.03, 74.16), heading = 330.5, radius = 10.0 },
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
FastTravels = {
|
||||
{
|
||||
From = vector3(0, 0, 0.0),
|
||||
To = { coords = vector3(272.8, -1358.8, 23.5), heading = 0.0 },
|
||||
Marker = { type = 1, x = 2.0, y = 2.0, z = 0.5, r = 102, g = 0, b = 102, a = 100, rotate = false }
|
||||
},
|
||||
|
||||
{
|
||||
From = vector3(275.3, -1361, 23.5),
|
||||
To = { coords = vector3(295.8, -1446.5, 28.9), heading = 0.0 },
|
||||
Marker = { type = 1, x = 2.0, y = 2.0, z = 0.5, r = 102, g = 0, b = 102, a = 100, rotate = false }
|
||||
},
|
||||
|
||||
{
|
||||
From = vector3(247.3, -1371.5, 23.5),
|
||||
To = { coords = vector3(333.1, -1434.9, 45.5), heading = 138.6 },
|
||||
Marker = { type = 1, x = 1.5, y = 1.5, z = 0.5, r = 102, g = 0, b = 102, a = 100, rotate = false }
|
||||
},
|
||||
|
||||
{
|
||||
From = vector3(335.5, -1432.0, 45.50),
|
||||
To = { coords = vector3(249.1, -1369.6, 23.5), heading = 0.0 },
|
||||
Marker = { type = 1, x = 2.0, y = 2.0, z = 0.5, r = 102, g = 0, b = 102, a = 100, rotate = false }
|
||||
},
|
||||
|
||||
{
|
||||
From = vector3(234.5, -1373.7, 20.9),
|
||||
To = { coords = vector3(320.9, -1478.6, 28.8), heading = 0.0 },
|
||||
Marker = { type = 1, x = 1.5, y = 1.5, z = 1.0, r = 102, g = 0, b = 102, a = 100, rotate = false }
|
||||
},
|
||||
|
||||
{
|
||||
From = vector3(317.9, -1476.1, 28.9),
|
||||
To = { coords = vector3(238.6, -1368.4, 23.5), heading = 0.0 },
|
||||
Marker = { type = 1, x = 1.5, y = 1.5, z = 1.0, r = 102, g = 0, b = 102, a = 100, rotate = false }
|
||||
}
|
||||
},
|
||||
@@ -129,6 +225,7 @@ Config.Hospitals = {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Config.AuthorizedVehicles = {
|
||||
|
||||
ambulance = {
|
||||
|
||||
Reference in New Issue
Block a user