mirror of
https://github.com/ND-Framework/ND_Core.git
synced 2026-08-17 05:56:01 +01:00
feat(client/events): event reliablity
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user