CLEAR_PLAYER_WANTED_LEVEL
This executes at the same as speed as PLAYER::SET_PLAYER_WANTED_LEVEL(player, 0, false); This is the server-side RPC native equivalent of the client native CLEAR_PLAYER_WANTED_LEVEL.
Signature
void CLEAR_PLAYER_WANTED_LEVEL(Player player);Parameters
| Name | Type | Description |
|---|---|---|
player | Player | — |
Returns void
Description
This executes at the same as speed as PLAYER::SET_PLAYER_WANTED_LEVEL(player, 0, false);
PLAYER::GET_PLAYER_WANTED_LEVEL(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.This is the server-side RPC native equivalent of the client native CLEAR_PLAYER_WANTED_LEVEL.
Usage
ClearPlayerWantedLevel(player)
-- always works, by hash
Citizen.InvokeNative(0x54ea5bcc, player)JavaScript and C#
ClearPlayerWantedLevel(player);
// by hash
Citizen.invokeNative('0x54ea5bcc', player);Function.Call((Hash)0x54ea5bcc, player);See also
GET_PLAYER_WANTED_LEVELReturns given players wanted level server-side.SET_PLAYER_WANTED_LEVELSET_PLAYER_WANTED_LEVEL This is the server-side RPC native equivalent of the client native SET_PLAYER_WANTED_LEVEL.
Sources
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.