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_1 to extra_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:

requiredExtras

 

βœ… 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.meta configuration
  • Script method = flexible but less clean