feat(client/events): event reliablity

This commit is contained in:
Andyyy7666
2026-03-16 05:36:53 +01:00
parent 3d5c1c32bb
commit 075fb087f2

View File

@@ -4,27 +4,35 @@ end)
-- updates the money on the client.
RegisterNetEvent("ND:updateMoney", function(cash, bank)
if not NDCore.player then return end
if source == "" or not NDCore.player then return end
NDCore.player.cash = cash
NDCore.player.bank = bank
end)
-- Sets main character.
RegisterNetEvent("ND:characterLoaded", function(character)
if source == "" then return end
NDCore.player = character
end)
-- Update main character info.
RegisterNetEvent("ND:updateCharacter", function(character)
if source == "" or not NDCore.player then return end
NDCore.player = character
end)
-- Updates last lcoation.
RegisterNetEvent("ND:updateLastLocation", function(location)
if not NDCore.player then return end
if source == "" or not NDCore.player then return end
NDCore.player.lastLocation = location
end)
-- Unsets main character.
RegisterNetEvent("ND:characterUnloaded", function()
if source == "" or not NDCore.player then return end
NDCore.player = nil
end)
RegisterNetEvent("ND:revivePlayer", function()
if source == "" then return end
local oldPed = cache.ped
@@ -57,8 +65,6 @@ RegisterNetEvent("ND:revivePlayer", function()
end
end)
RegisterNetEvent("ND:characterUnloaded")
RegisterNetEvent("ND:clothingMenu", function()
if GetResourceState("fivem-appearance") ~= "started" then return end