Skip to content

Exports & Callbacks

From this page you can learn about many important exports and callbacks.

Get Source Skin & Apply Skin Callback#

QB#

lua
QBCore.Functions.TriggerCallback('0r-clothing:getSkin:server', function(skin)
    TriggerEvent('0r-clothing:client:loadPlayerClothing', skin, PlayerPedId())
end)

ESX#

lua
Core.TriggerServerCallback('0r-clothing:getSkin:server', function(skin)
    TriggerEvent('0r-clothing:client:loadPlayerClothing', skin, PlayerPedId())
end)

Open Character Creation Menu#

lua
-- Opens without resetting current outfit and not teleporting
TriggerEvent('0r-clothing:openCharacterCreationMenu', true, true)

-- Opens with resetting current outfit and teleporting to Config.TeleportWhenCreatingChar.Coords
TriggerEvent('0r-clothing:openCharacterCreationMenu', false, false)

-- You can check if player completed or not
TriggerEvent('0r-clothing:openCharacterCreationMenu', true, true, function(state)
    if state then
        print("Finished")
    elseif state then
        print("Cancelled")
    end
end)

Open Character Creation Menu Without Resetting Current Outfit#

lua
TriggerEvent('0r-clothing:openCharacterCreationMenuWithoutReset')

-- You can check if player completed or not
TriggerEvent('0r-clothing:openCharacterCreationMenuWithoutReset', function(state)
    if state then
        print("Finished")
    elseif state then
        print("Cancelled")
    end
end)

Open Clothing Store Menu#

lua
exports["0r-clothingv2"]:openClothStore("clothing")
exports["0r-clothingv2"]:openClothStore("barber")
exports["0r-clothingv2"]:openClothStore("tattoo")

Wear On & Off Clothes#

lua
-- Mask
TriggerEvent('0r-clothing:wearOnOff:client', 'masks')

-- Hair
TriggerEvent('0r-clothing:wearOnOff:client', 'hair')

-- Arms & Gloves
TriggerEvent('0r-clothing:wearOnOff:client', 'arms')

-- Pants
TriggerEvent('0r-clothing:wearOnOff:client', 'pants')

-- Shoes
TriggerEvent('0r-clothing:wearOnOff:client', 'shoes')

-- Undershirt
TriggerEvent('0r-clothing:wearOnOff:client', 'undershirt')

-- Vest
TriggerEvent('0r-clothing:wearOnOff:client', 'vest')

-- Torso
TriggerEvent('0r-clothing:wearOnOff:client', 'torso')

-- Hat
TriggerEvent('0r-clothing:wearOnOff:client', 'hat')

-- Glass
TriggerEvent('0r-clothing:wearOnOff:client', 'glass')

-- Ear
TriggerEvent('0r-clothing:wearOnOff:client', 'ear')

-- Watch
TriggerEvent('0r-clothing:wearOnOff:client', 'watch')

-- Bracelet
TriggerEvent('0r-clothing:wearOnOff:client', 'bracelet')