Command Palette
Search for a command to run...
PERMISSIONS#
The permissions configuration (config/permissions.lua) controls item availability through blacklists, whitelists, and model restrictions.
Overview#
The permission system has multiple layers:
- Model Whitelist - Restrict ped models by license
- Global Blacklist - Block items across all shops
- Shop Type Blacklist - Block items for specific shop types
- Shop Specific Permissions - Per-shop whitelist/blacklist
Model Whitelist#
Restrict certain ped models to specific players:
config/permissions.luaAllowListModel = { ["mp_m_freemode_01"] = { allowed = true, licenses = nil -- All players can use }, ["mp_f_freemode_01"] = { allowed = true, licenses = nil }, ["s_m_y_cop_01"] = { allowed = true, licenses = { "license:abc123", "license:def456" } }, ["a_f_m_beach_01"] = { allowed = false -- Completely disabled } }
| Property | Type | Description |
|---|---|---|
allowed | boolean | Whether model can be used |
licenses | table/nil | Allowed license identifiers (nil = all) |
Use this to restrict special models like police or military peds to authorized players only.
Global Blacklist#
Block items across ALL shops:
config/permissions.luaGlobalBlackListClothes = { male = { mask = { 1, 5, 10, 15 }, torso = { 100, 101, 102 }, pants = { 50, 51 }, hat = { 120, 121, 122 } }, female = { mask = { 1, 5, 10, 15 }, torso = { 80, 81, 82 }, pants = { 40, 41 } } }
Structure:
GlobalBlackListClothes = {
[gender] = {
[category] = { itemId1, itemId2, ... }
}
}
Items in the global blacklist cannot be equipped from ANY shop, including admin menus (unless admin blacklist is disabled).
Shop Type Blacklist#
Block items for specific shop types:
config/permissions.luaShopTypeBlackListClothes = { ["clothes"] = { male = { mask = { 20, 21, 22 }, -- Block at clothing stores torso = { 150, 151 } }, female = { mask = { 20, 21 } } }, ["barber"] = { male = { hair = { 70, 71, 72 } -- Block certain hairstyles } }, ["tattoos"] = { male = { tattoos = { "gang_1", "gang_2" } -- Block gang tattoos } } }
Structure:
ShopTypeBlackListClothes = {
[shopType] = {
[gender] = {
[category] = { itemId1, itemId2, ... }
}
}
}
Shop Specific Permissions#
Configure per-shop whitelist and blacklist:
config/permissions.luaShopSpecificPermissions = { ["clothes_1"] = { -- Whitelist: Only allow these items whitelist = { male = { torso = { 1, 2, 3, 4, 5 }, pants = { 1, 2, 3, 4, 5 } }, female = { torso = { 1, 2, 3, 4, 5 } } }, -- Blacklist: Block these items(applied after whitelist) blacklist = { male = { mask = { 50, 51, 52 } } } }, ["barber_vip"] = { -- Whitelist exclusive hairstyles whitelist = { male = { hair = { 70, 71, 72, 73, 74 } -- VIP-only styles }, female = { hair = { 60, 61, 62, 63, 64 } } } }, ["police_locker"] = { -- Only police uniform items whitelist = { male = { torso = { 55, 56, 57 }, pants = { 25, 26 }, shoes = { 10, 11 }, hat = { 45, 46 } } } } }
Whitelist vs Blacklist:
- Whitelist: Only listed items are available (everything else blocked)
- Blacklist: Listed items are blocked (everything else available)
- If both are defined, whitelist is applied first, then blacklist removes from whitelist
Legacy Blacklist#
For backwards compatibility with older configurations:
config/permissions.luaBlackListClothes = { male = { mask = { 1, 2, 3 } }, female = { mask = { 1, 2, 3 } } }
This is merged with GlobalBlackListClothes for compatibility. Use GlobalBlackListClothes for new configurations.
Helper Functions#
The permissions system provides utility functions:
Check If Item Is Blacklisted#
config/permissions.lua-- Check if a specific item is blacklisted local isBlocked = IsItemBlacklisted(gender, category, itemId, shopId, shopType) -- Example local blocked = IsItemBlacklisted("male", "mask", 15, "clothes_1", "clothes") if blocked then print("This mask is not available at this shop") end
Get All Blacklisted Items#
config/permissions.lua-- Get all blacklisted items for a category local blacklisted = GetBlacklistedItems(gender, category, shopId, shopType) -- Example local blockedMasks = GetBlacklistedItems("male", "mask", "clothes_1", "clothes") for _, maskId in ipairs(blockedMasks) do print("Blocked mask ID: " .. maskId) end
Get Compiled Blacklist For Shop#
config/permissions.lua-- Get the effective blacklist for a shop(combines all layers) local compiled = GetCompiledBlacklistForShop(shopId, shopType) -- Returns: -- { -- male = { mask = {1,2,3}, torso = {10,11} }, -- female = { mask = {1,2} } -- }
Validate Configuration#
config/permissions.lua-- Check for configuration conflicts local issues = ValidateBlacklistConfiguration() -- Returns array of potential issues for _, issue in ipairs(issues) do print("Config Issue: " .. issue) end
Dynamic Blacklist Handler#
Update blacklists at runtime:
Client Script-- Add items to blacklist dynamically TriggerEvent('onex-creation:client:DynamicBlackListClothesHandler', { action = "add", gender = "male", category = "mask", items = { 100, 101, 102 } }) -- Remove items from blacklist TriggerEvent('onex-creation:client:DynamicBlackListClothesHandler', { action = "remove", gender = "male", category = "mask", items = { 100, 101 } }) -- Clear category blacklist TriggerEvent('onex-creation:client:DynamicBlackListClothesHandler', { action = "clear", gender = "male", category = "mask" })
Permission Priority#
When multiple permission layers apply, they're evaluated in this order:
- Model Whitelist - Can player use this ped model?
- Global Blacklist - Is item globally blocked?
- Shop Type Blacklist - Is item blocked for this shop type?
- Shop Specific Whitelist - Is item in shop's whitelist?
- Shop Specific Blacklist - Is item in shop's blacklist?
Items must pass ALL checks to be available. Being blocked at any level results in the item being unavailable.
Common Use Cases#
Police Uniform Restriction#
config/permissions.luaShopSpecificPermissions = { ["police_locker"] = { whitelist = { male = { torso = { 55, 56, 57, 58 }, pants = { 25, 26, 27 }, shoes = { 10, 11 }, hat = { 45, 46, 47 }, vest = { 12, 13 } } } } }
VIP-Only Items#
config/permissions.lua-- Block premium items from regular stores ShopTypeBlackListClothes = { ["clothes"] = { male = { torso = { 200, 201, 202 }, -- Premium jackets hat = { 150, 151 } -- Premium hats } } } -- Allow at VIP store ShopSpecificPermissions = { ["vip_store"] = { whitelist = { male = { torso = { 200, 201, 202 }, hat = { 150, 151 } } } } }
Block Gang/Inappropriate Content#
config/permissions.luaGlobalBlackListClothes = { male = { tattoos = { "gang_torso_1", "gang_arm_1", "inappropriate_1" }, decals = { 50, 51, 52 } -- Gang badges }, female = { tattoos = { "gang_torso_1", "gang_arm_1" } } }