mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-04 16:23:21 +00:00
Fix thrown items not synced with mid-joined players
This commit is contained in:
@@ -40,6 +40,24 @@ AddEventHandler('esx:playerLoaded', function(xPlayer)
|
||||
end
|
||||
end)
|
||||
|
||||
RegisterNetEvent('esx:createMissingPickups')
|
||||
AddEventHandler('esx:createMissingPickups', function(pickups)
|
||||
for pickupId,v in pairs(pickups) do
|
||||
ESX.Game.SpawnLocalObject('prop_money_bag_01', v.coords, function(obj)
|
||||
SetEntityAsMissionEntity(obj, true, false)
|
||||
PlaceObjectOnGroundProperly(obj)
|
||||
|
||||
Pickups[pickupId] = {
|
||||
id = pickupId,
|
||||
obj = obj,
|
||||
label = v.label,
|
||||
inRange = false,
|
||||
coords = v.coords
|
||||
}
|
||||
end)
|
||||
end
|
||||
end)
|
||||
|
||||
AddEventHandler('playerSpawned', function()
|
||||
while not ESX.PlayerLoaded do
|
||||
Citizen.Wait(1)
|
||||
|
||||
Reference in New Issue
Block a user