Categories
Vehicle Extras System (FiveM)
Extras are additional vehicle components that can be enabled or disabled. They are commonly used for:
- police lights
- spoilers
- bullbars
- alternative body parts
β How do Extras Work?
In GTA/FiveM vehicle files, the author defines extra components such as:
extra_1toextra_12
Each extra has its own ID and can be toggled independently.
Players or scripts (e.g. vMenu, mechanic scripts, tuning systems) can:
- enable extras
- disable extras
- dynamically change vehicle appearance
π How Extras Work in Our Vehicles
In our vehicles:
- extras are mainly used for police lighting setups
- we do NOT force extras by default on spawn
β‘οΈ Reason:
Not every server wants the same configuration or visual setup.
However, you can force them manually (explained below).
βοΈ How to Force Extras on Spawn
π§ Option 1 β Script Method
Example Code:
RegisterCommand("spawnbuffalo", function()
local playerPed = PlayerPedId() -- Get the player's ped (character)
local coords = GetEntityCoords(playerPed) -- Get the player's current coordinates
local model = `nkbuffalos` -- Set the vehicle model name
RequestModel(model) -- Request the model to be loaded
while not HasModelLoaded(model) do -- Wait until the model is fully loaded
Wait(100)
end
local vehicle = CreateVehicle(model, coords.x + 2, coords.y, coords.z, GetEntityHeading(playerPed), true, false) -- Create the vehicle 2 units away from the player
SetPedIntoVehicle(playerPed, vehicle, -1) -- Put the player into the driver seat
-- Forcing extras
SetVehicleModKit(vehicle, 0) -- Required before modifying vehicle extras
-- false = enabled, true = disabled
SetVehicleExtra(vehicle, 1, false) -- enabled
SetVehicleExtra(vehicle, 2, true) -- disabled
SetVehicleExtra(vehicle, 3, false) -- enabled
-- You can also disable all extras first, then enable selected ones
-- for i = 0, 12 do
-- if DoesExtraExist(vehicle, i) then
-- SetVehicleExtra(vehicle, i, false)
-- end
-- end
-- Optional cleanup
SetEntityAsNoLongerNeeded(vehicle)
SetModelAsNoLongerNeeded(model)
end)
βοΈ Option 2 β vehicles.meta Method (Recommended)
This is the preferred and most stable method.
β Step 1 β Find Required Section
Open vehicles.meta and locate:
β Step 2 β Choose Extras
Select which extras should always be active.
Example:
- EXTRA_1
- EXTRA_2
- EXTRA_4
- EXTRA_5
β Step 3 β Add Extras
Add them to the requiredExtras section in the file.
β Step 4 β Save & Apply
Ensure the same extras are also correctly defined in the corresponding configuration section of the vehicle.
π Step 5 β Restart Server
Restart your server and test the vehicle.
β‘οΈ If configured correctly:
- extras will automatically apply on spawn
- no additional scripts required
π‘ Summary
- Extras = modular vehicle components
- Can be toggled dynamically or forced
- Best method:
vehicles.metaconfiguration - Script method = flexible but less clean