Exports
This page documents public integration points intended for use by other FiveM scripts.
Client Events
Section titled “Client Events”ars_iclothing:client:reloadClothing
Section titled “ars_iclothing:client:reloadClothing”Forces a player’s clothing to reload from the database. This event is intended to be called by skin menus or other scripts that modify player clothing to ensure the clothing-as-items system stays in sync.
Side:clientUsage:trigger
When to use:
- After a skin menu applies clothing changes
- After character customization
- After job uniform changes
- When external scripts modify player clothing directly
-- Example: Trigger from your skin menu after applying changesTriggerClientEvent('ars_iclothing:client:reloadClothing', source)
-- Example: Trigger from client-side scriptTriggerEvent('ars_iclothing:client:reloadClothing')What it does:
- Fetches the player’s current inventory
- Compares equipped clothing with inventory items
- Removes any clothing the player no longer has items for
- Re-applies clothing items the player currently has in inventory
- Ensures visual clothing state matches inventory state
Recommended use case: If your script modifies player clothing (skin menus, barber shops, wardrobe systems) and is not in the list of supported systems below, call this event to ensure ARS iClothing’s clothing tracking remains accurate.
Note: The following systems are already supported automatically and do not need to call this event:
- illenium-appearance (client and server)
- qb-clothing (server)
- qb-clothes (server)
- fivem-appearance (client and server)
- esx_skin (server)
- ak47_inventory (server)
Framework Integration Events
Section titled “Framework Integration Events”esx:removeInventoryItem
Section titled “esx:removeInventoryItem”An ESX inventory event that ARS iClothing listens to for automatic clothing removal. This event is part of the ESX framework, not specific to ARS iClothing.
Side:clientUsage:listen
-- Your inventory script should trigger this event when removing itemsTriggerEvent('esx:removeInventoryItem', source, itemName, count)QBCore:Client:OnRemoveInventoryItem
Section titled “QBCore:Client:OnRemoveInventoryItem”A QBCore inventory event that ARS iClothing listens to for automatic clothing removal. This event is part of the QBCore framework, not specific to ARS iClothing.
Side:clientUsage:listen
-- Your inventory script should trigger this event when removing itemsTriggerEvent('QBCore:Client:OnRemoveInventoryItem', source, itemName)Note: These framework events are documented here for inventory developers who want to ensure their inventory properly integrates with ARS iClothing’s automatic clothing removal system.
Integration Best Practices
Section titled “Integration Best Practices”Skin Menus
Section titled “Skin Menus”If you develop a skin menu or clothing customization script, always call the reload event after applying changes:
-- After applying skin/clothing changesTriggerClientEvent('ars_iclothing:client:reloadClothing', source)Inventory Systems
Section titled “Inventory Systems”If you develop a custom inventory system, ensure you trigger the appropriate framework event when items are removed:
-- For ESX-based inventoriesTriggerEvent('esx:removeInventoryItem', source, itemName, count)
-- For QBCore-based inventoriesTriggerEvent('QBCore:Client:OnRemoveInventoryItem', source, itemName)Testing Integration
Section titled “Testing Integration”- Equip a clothing item from inventory
- Use your external script to modify clothing
- Verify that ARS iClothing’s tracking stays in sync
- Remove item from inventory and confirm clothing is removed
Common Integration Patterns
Section titled “Common Integration Patterns”After Skin Menu Save
Section titled “After Skin Menu Save”RegisterNetEvent('your-skin-menu:server:saveSkin', function(playerId, skinData) -- Save skin data to database MySQL.Async.execute('UPDATE players SET skin = @skin WHERE id = @id', { ['@skin'] = json.encode(skinData), ['@id'] = GetPlayerIdentifier(playerId, 0) })
-- Notify ARS iClothing to reload TriggerClientEvent('ars_iclothing:client:reloadClothing', playerId)end)After Job Uniform Change
Section titled “After Job Uniform Change”RegisterNetEvent('your-job-script:server:setUniform', function(playerId, uniformData) -- Apply uniform to player local ped = GetPlayerPed(playerId) -- ... apply uniform logic ...
-- Notify ARS iClothing to reload TriggerClientEvent('ars_iclothing:client:reloadClothing', playerId)end)Note: This guide is written by a third party. If you find any incorrect or outdated information, please contact us on Discord so we can update it for you.