ClearPlayerWantedLevel
DocsClearPlayerWantedLevel(player)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](?\_0xB302540597885499).
Parameters
| Name | Type | Description |
|---|---|---|
player | Player | — |
Quick Snippet: Get Playerplayer
playerUse this to get the local player ID or a target player's server ID.
-- Get the local player index (client-side)
local playerId = PlayerId()
-- Get the local player's server ID (for server events)
local serverId = GetPlayerServerId(playerId)
print("Player ID: " .. playerId)
print("Server ID: " .. serverId)
-- Get player ped from a server ID:
-- local targetPed = GetPlayerPed(GetPlayerFromServerId(targetServerId))Returns
voidThis native does not return a value.