PlayerClient

clearPlayerWantedLevel

CLEAR_PLAYER_WANTED_LEVEL0xB302540597885499

The GTA V native CLEAR_PLAYER_WANTED_LEVEL of the PLAYER namespace, as LS:MP client scripts call it: the global function clearPlayerWantedLevel, in JavaScript and in Lua.

SignatureJavaScript
clearPlayerWantedLevel(player: Player): void
SignatureLua
clearPlayerWantedLevel(player: Player)

Usage

JavaScript
clearPlayerWantedLevel(player);
Lua
clearPlayerWantedLevel(player)

Parameters

ParameterTypeJavaScriptLua
playerPlayernumberinteger

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 executes at the same as speed as setPlayerWantedLevel(player, 0, false);

getPlayerWantedLevel(player); executes in less than half the time. Which means that it's worth first checking if the wanted level needs to be cleared before clearing. However, this is mostly about good code practice and can important in other situations. The difference in time in this example is negligible.

Reference

Namespace
Player PLAYER
In the game
void CLEAR_PLAYER_WANTED_LEVEL(Player player)
Hash
0xB302540597885499

Open in the interactive natives reference