RedM Natives

GET_VEHICLE_LIGHTS_STATE

Hash0x7C278621
Runtime nameGetVehicleLightsState
NamespaceCFX
SideServer
NameOfficial
Docs

Signature

BOOL GET_VEHICLE_LIGHTS_STATE(Vehicle vehicle, BOOL* lightsOn, BOOL* highbeamsOn);

Parameters

NameTypeDescription
vehicleVehicle—
lightsOnBOOL*—
highbeamsOnBOOL*—

Returns BOOL

Usage

Lua
local retval, lightsOn, highbeamsOn = GetVehicleLightsState(vehicle)

-- always works, by hash
local retval, lightsOn, highbeamsOn = Citizen.InvokeNative(0x7c278621, vehicle, Citizen.PointerValueInt() --[[ BOOL* ]], Citizen.PointerValueInt() --[[ BOOL* ]], Citizen.ReturnResultAnyway())
JavaScript and C#
JavaScript
const [retval, lightsOn, highbeamsOn] = GetVehicleLightsState(vehicle);

// by hash
const [retval, lightsOn, highbeamsOn] = Citizen.invokeNative('0x7c278621', vehicle, Citizen.pointerValueInt() /* BOOL* */, Citizen.pointerValueInt() /* BOOL* */, Citizen.returnResultAnyway());
C#
var lightsOn = new OutputArgument();
var highbeamsOn = new OutputArgument();
bool retval = Function.Call<bool>((Hash)0x7c278621, vehicle, lightsOn, highbeamsOn);
// lightsOn.GetResult<bool>()
// highbeamsOn.GetResult<bool>()
  • Pointer (out) arguments are not passed in Lua/JS: their values are returned after the result, in order.

Sources

Cfx.re native reference

Something wrong or missing? Contribute a verified note — corrections ship through pull requests.