setPlayerWantedLevel | Multi Theft Auto: Wiki Skip to content

setPlayerWantedLevel

Client-side
Server-side
Shared

Pair: getPlayerWantedLevel

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function is used to set a player's wanted level. The wanted level is indicated by the amount of stars a player has on the GTA HUD.

Syntax

setPlayerWantedLevel ( )

Code Examples

server

This example sets a player's wanted level to six stars if they enter a certain colshape:

-- assume that there exists a collision shape named 'policeStation'
function policeStationHit ( thePlayer )
setPlayerWantedLevel ( thePlayer, 6 ) -- set the player's wanted level to 6 stars
outputChatBox ( getPlayerName ( thePlayer ) .. " entered the police station!" )
end
-- call 'policeStationHit' when a player enters the collision shape:
addEventHandler ( "onColShapeHit", policeStation, policeStationHit )

See Also