Implemented weapon tint support (desc), closes #477

- Implemented two new xPlayer functions:
  - .getWeaponTint(weaponName)
  - .setWeaponTint(weaponName, weaponTintIndex)

Thanks to @profex1999 for co authoring this!

Co-Authored-By: Andrea Passarini <profex1999@users.noreply.github.com>
This commit is contained in:
ElPumpo
2020-02-11 21:11:54 +01:00
parent 8e13cf6613
commit baa9ca3afc
13 changed files with 194 additions and 37 deletions
+3 -2
View File
@@ -159,7 +159,7 @@ ESX.GetItemLabel = function(item)
end
end
ESX.CreatePickup = function(type, name, count, label, playerId, components)
ESX.CreatePickup = function(type, name, count, label, playerId, components, tintIndex)
local pickupId = (ESX.PickupId == 65635 and 0 or ESX.PickupId + 1)
local xPlayer = ESX.GetPlayerFromId(playerId)
@@ -173,9 +173,10 @@ ESX.CreatePickup = function(type, name, count, label, playerId, components)
if type == 'item_weapon' then
ESX.Pickups[pickupId].components = components
ESX.Pickups[pickupId].tintIndex = tintIndex
end
TriggerClientEvent('esx:createPickup', -1, pickupId, label, playerId, type, name, components)
TriggerClientEvent('esx:createPickup', -1, pickupId, label, playerId, type, name, components, tintIndex)
ESX.PickupId = pickupId
end