exports('openMenuSkin', function(target)
if not target or type(target) ~= 'number' then
print("[ERROR] Invalid target provided to openMenuSkin")
return
end
local storageData = STORAGE:load("storage.json")
if not storageData then
print("[ERROR] Failed to load storage data from storage.json")
return
end
TriggerClientEvent('gw_skin:openMenu', target, storageData)
end)
Utilisation
exports["gw-skinV2"]:openMenuSkin(target)
Cette fonction ouvre le menu de skin pour un joueur (côté serveur).
openMenuSpecial
Ouvre le menu de skin avec des options de filtrage.
Syntaxe
exports('openMenuSpecial', function(target, filter)
if not target or type(target) ~= 'number' then
print("[ERROR] Invalid target provided to openMenuSpecial")
return
end
if filter and type(filter) ~= 'table' then
print("[ERROR] Filter must be a table")
return
end
local storageData = STORAGE:load("storage.json")
if not storageData then
print("[ERROR] Failed to load storage data from storage.json")
return
end
TriggerClientEvent('gw_skin:openMenuSpecial', target, storageData, #filter > 0 and filter or nil)
end)
Utilisation
-- Ouvre le menu sans filtres
exports["gw-skinV2"]:openMenuSkin(target)
-- Ouvre le menu avec des catégories spécifiques
exports["gw-skinV2"]:openMenuSpecial(target, {
'tshirt', 'torso', 'pants'
})
-- Ouvre le menu avec toutes les catégories disponibles
exports["gw-skinV2"]:openMenuSpecial(target, availableCategories)