RedM Natives

GET_VEHICLE_NEON_ENABLED

Getter to check if one of the neon lights of a vehicle is enabled.

Hash0x684BDBF2
Runtime nameGetVehicleNeonEnabled
NamespaceCFX
SideServer
NameOfficial
Docs

Signature

BOOL GET_VEHICLE_NEON_ENABLED(Vehicle vehicle, int neonIndex);

Parameters

NameTypeDescription
vehicleVehicle

The vehicle to check.

neonIndexint

A value from the neonIndex enum representing the neon light to check.

Returns BOOL — Returns `true` if the specified neon light is enabled, `false` otherwise.

Description

Cfx.re native reference

Getter to check if one of the neon lights of a vehicle is enabled. This native is the server side getter of IS_VEHICLE_NEON_LIGHT_ENABLED.

enum neonIndex
{
    NEON_BACK = 0,   // Back neon
    NEON_RIGHT = 1,  // Right neon
    NEON_LEFT = 2,   // Left neon
    NEON_FRONT = 3   // Front neon
};

Usage

Lua
local retval = GetVehicleNeonEnabled(vehicle, neonIndex)

-- always works, by hash
local retval = Citizen.InvokeNative(0x684bdbf2, vehicle, neonIndex, Citizen.ReturnResultAnyway())
JavaScript and C#
JavaScript
const retval = GetVehicleNeonEnabled(vehicle, neonIndex);

// by hash
const retval = Citizen.invokeNative('0x684bdbf2', vehicle, neonIndex, Citizen.returnResultAnyway());
C#
bool retval = Function.Call<bool>((Hash)0x684bdbf2, vehicle, neonIndex);

Examples

LUA · Cfx.re native reference
local vehicle = GetVehiclePedIsIn(GetPlayerPed(1), false) -- 1 is the source here
local isRightNeonOn = GetVehicleNeonEnabled(vehicle, 1)
print(isRightNeonOn)
JS · Cfx.re native reference
const vehicle = GetVehiclePedIsIn(GetPlayerPed(1), false); // 1 is the source here
const isRightNeonOn = GetVehicleNeonEnabled(vehicle, 1);
console.log(isRightNeonOn);
CS · Cfx.re native reference
using static CitizenFX.Core.Native.API;

int vehicle = GetVehiclePedIsIn(GetPlayerPed(1), false); // 1 is the source here
bool isRightNeonOn = GetVehicleNeonEnabled(vehicle, 1);
Debug.WriteLine($"{isRightNeonOn}");

Sources

Cfx.re native reference

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