RedM Natives

GET_VEHICLE_LOCK_ON_TARGET

Gets the vehicle that is locked on to for the specified vehicle.

Hash0x4A557117
Runtime nameGetVehicleLockOnTarget
NamespaceCFX
SideServer
NameOfficial
Docs

Signature

Vehicle GET_VEHICLE_LOCK_ON_TARGET(Vehicle vehicle);

Parameters

NameTypeDescription
vehicleVehicle

The vehicle to check.

Returns Vehicle — The vehicle that is locked on. 0 returned if no vehicle is locked on.

Description

Cfx.re native reference

Gets the vehicle that is locked on to for the specified vehicle.

Usage

Lua
local retval = GetVehicleLockOnTarget(vehicle)

-- always works, by hash
local retval = Citizen.InvokeNative(0x4a557117, vehicle, Citizen.ResultAsInteger())
JavaScript and C#
JavaScript
const retval = GetVehicleLockOnTarget(vehicle);

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

Sources

Cfx.re native reference

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