mirror of
https://github.com/ND-Framework/ND_Core.git
synced 2026-08-17 05:56:01 +01:00
Merge pull request #78 from ND-Framework/feat/replace-armor
feat(client): replace armor on revive
This commit is contained in:
@@ -23,14 +23,17 @@ end)
|
|||||||
|
|
||||||
RegisterNetEvent("ND:revivePlayer", function()
|
RegisterNetEvent("ND:revivePlayer", function()
|
||||||
if source == "" then return end
|
if source == "" then return end
|
||||||
local veh = GetVehiclePedIsIn(cache.ped)
|
local oldPed = cache.ped
|
||||||
|
local veh = GetVehiclePedIsIn(oldPed)
|
||||||
local seat = cache.seat
|
local seat = cache.seat
|
||||||
local coords = GetEntityCoords(cache.ped)
|
local coords = GetEntityCoords(oldPed)
|
||||||
NetworkResurrectLocalPlayer(coords.x, coords.y, coords.z, GetEntityHeading(cache.ped), true, true, false)
|
local armor = GetPedArmour(oldPed)
|
||||||
|
|
||||||
|
NetworkResurrectLocalPlayer(coords.x, coords.y, coords.z, GetEntityHeading(oldPed), true, true, false)
|
||||||
|
|
||||||
local ped = PlayerPedId()
|
local ped = PlayerPedId()
|
||||||
if cache.ped ~= ped then
|
if oldPed ~= ped then
|
||||||
DeleteEntity(cache.ped)
|
DeleteEntity(oldPed)
|
||||||
ClearAreaOfPeds(coords.x, coords.y, coords.z, 0.2, false)
|
ClearAreaOfPeds(coords.x, coords.y, coords.z, 0.2, false)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -43,6 +46,7 @@ RegisterNetEvent("ND:revivePlayer", function()
|
|||||||
SetBlockingOfNonTemporaryEvents(ped, false)
|
SetBlockingOfNonTemporaryEvents(ped, false)
|
||||||
SetPedCanRagdollFromPlayerImpact(ped, true)
|
SetPedCanRagdollFromPlayerImpact(ped, true)
|
||||||
ClearPedTasksImmediately(ped)
|
ClearPedTasksImmediately(ped)
|
||||||
|
SetPedArmour(ped, armor)
|
||||||
|
|
||||||
if veh and veh ~= 0 then
|
if veh and veh ~= 0 then
|
||||||
SetPedIntoVehicle(ped, veh, seat)
|
SetPedIntoVehicle(ped, veh, seat)
|
||||||
|
|||||||
Reference in New Issue
Block a user