Fix thrown items not synced with mid-joined players

This commit is contained in:
ElPumpo
2019-09-18 13:47:41 +02:00
parent 5159e892fe
commit 8586fdcce2
3 changed files with 25 additions and 3 deletions
+6 -3
View File
@@ -162,16 +162,19 @@ ESX.GetItemLabel = function(item)
end
end
ESX.CreatePickup = function(type, name, count, label, player)
ESX.CreatePickup = function(type, name, count, label, playerId)
local pickupId = (ESX.PickupId == 65635 and 0 or ESX.PickupId + 1)
local xPlayer = ESX.GetPlayerFromId(playerId)
ESX.Pickups[pickupId] = {
type = type,
name = name,
count = count
count = count,
label = label,
coords = xPlayer.getCoords()
}
TriggerClientEvent('esx:pickup', -1, pickupId, label, player)
TriggerClientEvent('esx:pickup', -1, pickupId, label, playerId)
ESX.PickupId = pickupId
end