SetVehicleInfluencesWantedLevel
DocsSetVehicleInfluencesWantedLevel(vehicle, influenceWantedLevel)Description
This native sets whether a specific vehicle influences the player's wanted level when it is involved in an incident that typically triggers a wanted response, such as being marked as a "victim" vehicle.
This is particularly useful when utilizing the wanted system from GTA, and you want to prevent a vehicle from affecting the wanted level when it is stolen. In the decompiled scripts this native is only used to disable the influence of the vehicle on the wanted level.
Parameters
| Name | Type | Description |
|---|---|---|
vehicle | Vehicle | The specific vehicle to be set for influencing the wanted level. |
influenceWantedLevel | BOOL | A boolean value. Set to `true` to make the vehicle influence the wanted level; `false` to prevent it from doing so. |
Quick Snippet: Get Vehiclevehicle
vehicleUse this to get the current vehicle handle for this native.
-- Get the vehicle the player is currently in
local ped = PlayerPedId()
local vehicle = GetVehiclePedIsIn(ped, false)
if vehicle ~= 0 then
print("Vehicle handle: " .. vehicle)
print("Model: " .. GetEntityModel(vehicle))
else
print("Player is not in a vehicle")
endVehicle Models

adder
alpha
blade
ardent
asea
cogcabrio
baller
blistaReturns
voidThis native does not return a value.
Examples
Official
-- This example will prevent the closest vehicle from influencing the wanted level.
-- Retrieve the LocalPlayer
local playerPed = PlayerPedId()
-- Retrieve the coordinates of the player.
local playerCoords = GetEntityCoords(playerPed)
-- Retrieve the closest vehicle.
local vehicle = GetClosestVehicle(playerCoords.x, playerCoords.y, playerCoords.z, 3, 0, 70)
-- Check if the vehicle exists in the game world.
if not DoesEntityExist(vehicle) then
-- If the vehicle does not exist, end the execution of the code here.
return
end
-- Set the vehicle to not influence the wanted level.
SetVehicleInfluencesWantedLevel(vehicle, false)