TasksClient

clearPrimaryVehicleTask

CLEAR_PRIMARY_VEHICLE_TASK0xDBBC7A2432524127

The GTA V native CLEAR_PRIMARY_VEHICLE_TASK of the TASK namespace, as LS:MP client scripts call it: the global function clearPrimaryVehicleTask, in JavaScript and in Lua.

SignatureJavaScript
clearPrimaryVehicleTask(vehicle: Vehicle): void
SignatureLua
clearPrimaryVehicleTask(vehicle: Vehicle)

Usage

JavaScript
clearPrimaryVehicleTask(vehicle);
Lua
clearPrimaryVehicleTask(vehicle)

Parameters

ParameterTypeJavaScriptLua
vehicleVehiclenumberinteger

Returns

Nothing. In JavaScript the call evaluates to undefined.

Notes

From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.

This native is very useful when switching the player to a ped inside a vehicle that has a task assigned prior to the player switch.
It is necessary to clear the ped's tasks AND call this native with the vehicle the player is switching into in order to allow the player to control the vehicle after the player switches.

Reference

Namespace
Tasks TASK
In the game
void CLEAR_PRIMARY_VEHICLE_TASK(Vehicle vehicle)
Hash
0xDBBC7A2432524127
Introduced
Game build 1290 legacy numbering
Formerly
_CLEAR_VEHICLE_TASKS

Open in the interactive natives reference