Skip to main content

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:

  • true or 1 for enabled
  • false or 0 for 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

AttributePurposeFormat
idUnique identifierInteger or string
indexArray positionInteger
modelNameModel referenceLowercase string
handlingIdHandling configurationUPPERCASE
gameNameGame hashUPPERCASE

Properties

AttributePurposeRange
healthDurability value0-1000+
speedVelocity0-300+
massWeight500-5000
damageDamage multiplier0.0-2.0
enabledActive/Inactivetrue/false

Color

AttributePurposeRange
rRed component0-255
gGreen component0-255
bBlue component0-255
aAlpha/transparency0-1

Position & Rotation

AttributePurposeRange
xX coordinate-∞ to +∞
yY coordinate-∞ to +∞
zZ coordinate-∞ to +∞
rollX rotation0-360
pitchY rotation0-360
yawZ rotation0-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 &amp; -->

Best Practices

  1. Match data types - Numbers as numbers, text as text
  2. Use consistent casing - Lowercase for IDs, proper case for display
  3. Validate all numbers - Ensure values are in expected ranges
  4. Check cross-references - IDs must match across files
  5. Escape special characters - Use XML escape sequences
  6. Document custom attributes - Note non-standard values
  7. Test all combinations - Verify attributes work together

Common Errors

ErrorCauseSolution
"Invalid attribute value"Wrong data typeCheck number format
"Unknown model"modelName doesn't matchVerify spelling
"Missing reference"ID not found in fileCheck cross-file IDs
"Syntax error"Malformed attributeValidate XML
"Value out of range"Number outside limitsUse typical values

Next Steps

See Troubleshooting XML for help with common XML issues.

📺 Live Stream