Implemented ESX weapon drops with components support, closes #421

This commit is contained in:
ElPumpo
2020-01-04 01:33:12 +01:00
parent 2f75152457
commit fdabf80657
11 changed files with 97 additions and 51 deletions
+7 -3
View File
@@ -160,7 +160,7 @@ ESX.GetItemLabel = function(item)
end
end
ESX.CreatePickup = function(type, name, count, label, playerId)
ESX.CreatePickup = function(type, name, count, label, playerId, components)
local pickupId = (ESX.PickupId == 65635 and 0 or ESX.PickupId + 1)
local xPlayer = ESX.GetPlayerFromId(playerId)
@@ -169,10 +169,14 @@ ESX.CreatePickup = function(type, name, count, label, playerId)
name = name,
count = count,
label = label,
coords = xPlayer.getCoords()
coords = xPlayer.getCoords(),
}
TriggerClientEvent('esx:pickup', -1, pickupId, label, playerId)
if type == 'item_weapon' then
ESX.Pickups[pickupId].components = components
end
TriggerClientEvent('esx:createPickup', -1, pickupId, label, playerId, type, name, components)
ESX.PickupId = pickupId
end