Common XML Attributes
Essential XML attributes used across FiveM vehicle files.
Numeric Attributes
Integer Values
<item id="1">...</item>
<color index="0">...</color>
<damage health="100">...</damage>
Used for: IDs, counts, health, durability
Float/Decimal Values
<speed value="200.5" />
<mass>1500.75</mass>
<acceleration>0.85</acceleration>
Used for: Physics values, multipliers, percentages
String Attributes
Text Content
<name>Vehicle Name</name>
<modelName>adder</modelName>
<description>Custom vehicle mod</description>
Requirements:
- Use lowercase for IDs and hashes
- Use readable names for display text
- Escape special characters
Boolean Attributes
True/False Values
<enabled>true</enabled>
<custom>false</custom>
<isDefault>true</isDefault>
Accepted values:
trueor1for enabledfalseor0for disabled
Naming Conventions
Vehicle Models
<modelName>mycustomcar</modelName> <!-- Lowercase, no spaces -->
Handling IDs
<handlingId>MYCUSTOM</handlingId> <!-- UPPERCASE for IDs -->
Display Names
<name>My Custom Car</name> <!-- Proper case for display -->
Hashes
<gameName>MYCUSTOM</gameName> <!-- Uppercase hash -->
Commonly Used Attributes
Identification
| Attribute | Purpose | Format |
|---|---|---|
| id | Unique identifier | Integer or string |
| index | Array position | Integer |
| modelName | Model reference | Lowercase string |
| handlingId | Handling configuration | UPPERCASE |
| gameName | Game hash | UPPERCASE |
Properties
| Attribute | Purpose | Range |
|---|---|---|
| health | Durability value | 0-1000+ |
| speed | Velocity | 0-300+ |
| mass | Weight | 500-5000 |
| damage | Damage multiplier | 0.0-2.0 |
| enabled | Active/Inactive | true/false |
Color
| Attribute | Purpose | Range |
|---|---|---|
| r | Red component | 0-255 |
| g | Green component | 0-255 |
| b | Blue component | 0-255 |
| a | Alpha/transparency | 0-1 |
Position & Rotation
| Attribute | Purpose | Range |
|---|---|---|
| x | X coordinate | -∞ to +∞ |
| y | Y coordinate | -∞ to +∞ |
| z | Z coordinate | -∞ to +∞ |
| roll | X rotation | 0-360 |
| pitch | Y rotation | 0-360 |
| yaw | Z rotation | 0-360 |
Vehicle Meta Attributes
In vehicles.meta
<Item type="CVehicleModelInfo__InitDataList">
<modelName>adder</modelName> <!-- Model identifier -->
<txdName>adder</txdName> <!-- Texture reference -->
<handlingId>ADDER</handlingId> <!-- Physics reference -->
<gameName>ADDER</gameName> <!-- Game hash -->
<vehicleType>AUTOMOBILE</vehicleType> <!-- Classification -->
<class>6</class> <!-- Vehicle class -->
<plateType>0</plateType> <!-- License plate type -->
<internalName>Adder</internalName> <!-- Display name -->
</Item>
Handling Meta Attributes
Physics Properties
<Item type="CHandlingData">
<handlingName>ADDER</handlingName>
<fMass>1300.0</fMass> <!-- Weight -->
<fAcceleration>0.80</fAcceleration> <!-- Acceleration rate -->
<fInitialDragCoeff>0.27</fInitialDragCoeff> <!-- Air resistance -->
<fDownforceModifier>1.0</fDownforceModifier> <!-- Downforce -->
<fEstimatedMaxSpeed>200.0</fEstimatedMaxSpeed> <!-- Top speed -->
</Item>
Color File Attributes
carcols.xml
<colour id="0">
<name>Black</name>
<r>15</r>
<g>15</g>
<b>15</b>
</colour>
ID range: 0-255+ (unique for each color)
Variation File Attributes
carvariations.xml
<Item>
<modelName>adder</modelName>
<colors>
<color id="0">
<primaryColour>0</primaryColour>
<secondaryColour>1</secondaryColour>
<pearlColor>0</pearlColor>
</color>
</colors>
<wheels>
<wheel id="0" modelName="wheel_sport_01" />
</wheels>
</Item>
Attribute Relationships
Cross-File References
vehicles.meta
├── modelName → Must match 3D model file name
├── txdName → Must match texture file in .ytd
├── handlingId → Must match entry in handling.meta
└── layoutHash → Must reference vehiclelayouts.xml
carvariations.xml
├── modelName → Must match vehicles.meta entry
├── primaryColour → Must match carcols.xml id
├── wheel modelName → Must be valid wheel model
└── livery modelName → Must exist in mod files
carcols.xml
└── id → Referenced by carvariations.xml primaryColour/secondaryColour
Data Type Validation
Numbers
<!-- Valid -->
<mass>1500</mass>
<mass>1500.0</mass>
<!-- Invalid -->
<mass>1500.0.0</mass>
<mass>abc</mass>
Boolean
<!-- Valid -->
<enabled>true</enabled>
<enabled>false</enabled>
<enabled>1</enabled>
<enabled>0</enabled>
<!-- Invalid -->
<enabled>yes</enabled>
<enabled>no</enabled>
Text
<!-- Valid -->
<name>My Vehicle</name>
<name>custom_car_001</name>
<!-- Invalid (special chars without escape) -->
<name>My Vehicle & Mod</name> <!-- Should be & -->
Best Practices
- Match data types - Numbers as numbers, text as text
- Use consistent casing - Lowercase for IDs, proper case for display
- Validate all numbers - Ensure values are in expected ranges
- Check cross-references - IDs must match across files
- Escape special characters - Use XML escape sequences
- Document custom attributes - Note non-standard values
- Test all combinations - Verify attributes work together
Common Errors
| Error | Cause | Solution |
|---|---|---|
| "Invalid attribute value" | Wrong data type | Check number format |
| "Unknown model" | modelName doesn't match | Verify spelling |
| "Missing reference" | ID not found in file | Check cross-file IDs |
| "Syntax error" | Malformed attribute | Validate XML |
| "Value out of range" | Number outside limits | Use typical values |
Next Steps
See Troubleshooting XML for help with common XML issues.