Uniform System
The uniform system allows servers to provide:
- job uniforms
- gang uniforms
- faction outfits
- department clothing
- restricted outfit presets
through clothing rooms and configured outfit groups.
System Purpose
The system was designed for roleplay-focused workflows such as:
police departments
EMS
mechanics
gangs
organizations
security factions
Uniforms are handled separately from personal saved outfits.
Uniform Workflow
Typical workflow:
1. Enter clothing room
2. Open uniform list
3. Select uniform
4. Outfit is applied
5. Appearance synchronizes
Clothing Room Integration
Uniforms are loaded through:
shared/data/clothing_rooms.lua
The system validates:
- player gender
- player job
- player gang
- player grade
- room access
before allowing uniform usage.
Outfit Source
Uniforms are defined inside:
shared/data/outfits.lua
Example structure:
Config.Outfits = {
['police'] = {
['male'] = {
[0] = {
{
outfitLabel = 'Cadet Uniform',
outfitData = {}
}
}
}
}
}
Grade Support
Uniforms support grade-based structures.
Example:
[0] = { ... }
[1] = { ... }
[2] = { ... }
This allows:
- rank uniforms
- progression systems
- department hierarchy clothing
Gender Support
Uniforms support separate configurations for:
male
female
Each gender may use completely different clothing values.
Partial Uniforms
Uniforms do not need to contain every clothing category.
Example:
outfitData = {
['vest'] = {item = 10, texture = 0}
}
Only specified categories are changed.
Useful for:
- tactical vests
- jackets
- accessories
- roleplay equipment
Prop Handling
Props are handled separately from components.
Example:
['hat'] = {item = -1, texture = 0}
Using:
item = -1
removes the prop completely.
Synchronization Workflow
When uniforms are applied:
1. Current appearance is read
2. Uniform values are merged
3. Components are rebuilt
4. Props are rebuilt
5. Appearance refresh runs
This prevents unnecessary appearance resets.
Appearance Preservation
The uniform system intentionally avoids modifying:
head blend
face features
tattoos
hair
unless explicitly configured.
This allows players to keep their identity while changing uniforms.
Clothes-Off Compatibility
Uniforms integrate directly with the clothes-off system.
Fallback states may use:
outfit fallback values
from configured outfit structures.
Restricted Access
Uniforms may be restricted using:
requiredJob
isGang
gender
Examples:
requiredJob = 'police'
or:
requiredJob = 'ballas',
isGang = true
Public Uniform Rooms
If:
requiredJob = nil
the clothing room becomes public.
No access restrictions are applied.
Recommended Usage
Recommended for:
police
ambulance
mechanics
gangs
security
staff uniforms
Internal Events
Uniform application may trigger synchronization events internally.
Useful for:
- logging systems
- inventory systems
- weapon systems
- duty systems
depending on server implementation.
Framework Independence
The uniform system intentionally avoids framework-specific logic internally.
Purpose:
easier integrations
custom permission systems
gang support
standalone compatibility
Recommended Workflow
Recommended setup workflow:
1. Create clothing room
2. Configure restrictions
3. Configure outfit groups
4. Configure grades
5. Test synchronization
Developer Notes
Unlike many appearance systems, XDEV separates:
uniform logic
outfit logic
appearance logic
This architecture improves:
- synchronization reliability
- modularity
- compatibility support
- integration flexibility