Skip to content

accessExtraSwitchParams

Provides access to the configuration and live state of a car’s “Extra” switches (Extra A, Extra B, etc.). It returns an ac.CarExtraSwitchParams object used to simulate inputs or check the availability of these custom controls.

Access the parameters for the “Extra A” switch (Index 0).

local switch = ac.accessExtraSwitchParams(0)

The ac.accessExtraSwitchParams function is used to interact with the custom interactive elements of a vehicle mod. These switches are commonly used by vehicle mods to trigger animations such as opening doors, toggling interior lights, or changing aerodynamic configurations.

The returned structure allows scripts to check whether a switch is active or being held, verify if the switch is available for the current vehicle, and simulate or override the switch state for logic-based triggers.

ParameterTypeRequiredDescription
indexintegerYesThe 0-based index of the extra switch to access.
TypeDescription
ac.CarExtraSwitchParamsAn object providing access to the switch parameters. Returns nil if invalid.

Verifying if “Extra A” is actually configured for the current vehicle before running logic.

local extraA = ac.accessExtraSwitchParams(0)
if extraA and extraA.available then
ac.log("Extra A is available on this car.")
end