Server exports
ox_inventory invokes these with its item-use signature (event, item, inventory). Do not call them from another resource.
Item defs: Item setup.
setweapontint
server.export = 'MrNewbWeaponTints.setweapontint'
exports('setweapontint', function(event, item, inventory)| Arg | Purpose |
|---|---|
event | 'usingItem' allows the use. 'usedItem' writes metadata |
item | Must have item.server.tint (1–7) |
inventory.id | Player source |
Returns false when GetCurrentWeapon is empty (notify WeaponTints.NotEquipped). Returns true on usingItem when a weapon is equipped.
On usedItem:
- Reads
item.server.tint - If the weapon name contains
MK2, remaps through the table inresource/server/weapon_items.lua - Sets
metadata.tintandmetadata.weapontint(item.label) SetMetadataon that slot, success notify (WeaponTints.HasBeenApplied),ox_inventory:disarm
newbserialfile
server.export = 'MrNewbWeaponTints.newbserialfile'
exports('newbserialfile', function(event, item, inventory)Same equipped-weapon gate as the tint export.
On usedItem sets metadata.serial to locale WeaponTints.SerialRemoved, then metadata, notify (WeaponTints.SerialRemovedSuccess), and disarm. Does not change tint.