Player.WantedLevel

From Liberty Unleashed Wiki
Revision as of 16:31, 25 October 2010 by Force (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This function sets/returns the players wanted level.

Syntax

  1. int player.WantedLevel
  1. player.WantedLevel = int value

Arguments

  • value - The value to set the wanted level to. From 0 - 6.

Example 1. Returning

This will tell the player their current wanted level when type '/wanted'.

  1.  
  2. function onPlayerCommand( pPlayer, szCommand, szText )
  3. {
  4. if ( szCommand == "wanted" )
  5. {
  6. MessagePlayer( "Your current wanted level is - " + pPlayer.WantedLevel, pPlayer );
  7. }
  8. return 1;
  9. }
  10.  

Example 2. Setting

This will give the player a 1 star wanted level when they type '/wanted2'.

  1.  
  2. function onPlayerCommand( pPlayer, szCommand, szText )
  3. {
  4. if ( szCommand == "wanted2" )
  5. {
  6. pPlayer.WantedLevel = 1;
  7. }
  8. return 1;
  9. }
  10.  

Notes

The function MessagePlayer and event onPlayerCommand were used in these examples. More info about them in the corresponding pages.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox