mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-30 16:01:30 +00:00
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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user