GET_VEHICLE_LIGHTS_STATE
Signature
BOOL GET_VEHICLE_LIGHTS_STATE(Vehicle vehicle, BOOL* lightsOn, BOOL* highbeamsOn);Parameters
| Name | Type | Description |
|---|---|---|
vehicle | Vehicle | — |
lightsOn | BOOL* | — |
highbeamsOn | BOOL* | — |
Returns BOOL
Usage
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#
const [retval, lightsOn, highbeamsOn] = GetVehicleLightsState(vehicle);
// by hash
const [retval, lightsOn, highbeamsOn] = Citizen.invokeNative('0x7c278621', vehicle, Citizen.pointerValueInt() /* BOOL* */, Citizen.pointerValueInt() /* BOOL* */, Citizen.returnResultAnyway());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
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.