Skip to content

Recipes

RegisterNetEvent('my_admin:giveSlot', function(target)
local src = source
if not IsPlayerAceAllowed(src, 'command.mcperks') then return end
CreateThread(function()
local identifier = exports.nuggs_multicharacter:GetIdentifier(target)
if not identifier then return end
exports.nuggs_multicharacter:GrantSlots(identifier, 1, 0, nil)
-- Show it immediately if they are still on the character screen.
exports.nuggs_multicharacter:RefreshCharacterScreen(target)
end)
end)
CreateThread(function()
local membership = exports.nuggs_multicharacter:GetMembership(source)
local rank = membership and membership.tier.rank or 0
if rank >= 2 then
-- silver or better: let them in early
end
end)

Load a character’s starter outfits into your own wardrobe

Section titled “Load a character’s starter outfits into your own wardrobe”
RegisterNetEvent('my_wardrobe:open', function()
local src = source
CreateThread(function()
local identifier = exports.nuggs_multicharacter:GetIdentifier(src)
local slot = 1 -- whichever slot this character is in
local charKey = exports.nuggs_multicharacter:GetCharacterKey(identifier, slot)
local outfits = exports.nuggs_multicharacter:GetCharacterOutfits(charKey)
-- { { slot = 1, label = "Work Boots", values = { torso_1 = 5, ... } }, ... }
TriggerClientEvent('my_wardrobe:show', src, outfits)
end)
end)

You only need this for a wardrobe of your own design. If yours is one of the stores under Compatibility, the outfits are already there.

Backfill outfits into a wardrobe you have just installed

Section titled “Backfill outfits into a wardrobe you have just installed”
RegisterCommand('republishoutfits', function(source)
if source ~= 0 then return end
CreateThread(function()
local identifier = exports.nuggs_multicharacter:NormaliseIdentifier('license:...')
for slot = 1, 8 do
local charKey = exports.nuggs_multicharacter:GetCharacterKey(identifier, slot)
if charKey then
exports.nuggs_multicharacter:PublishCharacterOutfits(charKey)
end
end
end)
end, true)

Keep a HUD out of the way of the character screen

Section titled “Keep a HUD out of the way of the character screen”
AddEventHandler('nuggs_multicharacter:screenOpened', function()
exports.my_hud:SetVisible(false)
end)
AddEventHandler('nuggs_multicharacter:characterSpawned', function(isNew)
exports.my_hud:SetVisible(true)
if isNew then
exports.my_hud:ShowWelcome()
end
end)
AddEventHandler('nuggs_multicharacter:characterCreated', function(src, slot, charKey)
print(('%s created character %s in slot %s'):format(GetPlayerName(src), charKey, slot))
end)