- Sets the player's minimum wanted level
- 010E: set_player [player handle] minimum_wanted_level_to [int]
- [player handle]
- The handle of the player
- Wanted level, range from 0 to 6
This opcode sets the player's current wanted level ranging from 0 to 6, similar to opcode 010D. Unlike 010D, if placed in a loop, the wanted level will not drop below the set value but a higher wanted level can be attained.
The following example, using Sanny Builder, will spawn a ped close to the player character. If the character is hurt but not killed, the player will attain a minimum wanted level of 3. The player can only clear its wanted level after the character is killed.
// set constants const CHAR_MODEL = #BFORI SPAWNED_CHAR = 0@ X_POS = 1@ Y_POS = 2@ Z_POS = 3@ end // load model, required to prevent unnecessary crash! 0247: request_model CHAR_MODEL // check if model is loaded repeat wait 0 if 0248: model CHAR_MODEL available then break end until false // spawn character 00A0: store_actor $PLAYER_ACTOR position_to X_POS Y_POS Z_POS X_POS += 4.0 009A: SPAWNED_CHAR = create_actor 4 CHAR_MODEL at X_POS Y_POS Z_POS // attain minimum wanted level while 8118: not actor SPAWNED_CHAR dead wait 10 if 8184: not actor SPAWNED_CHAR health >= 95 then 010E: set_player $PLAYER_CHAR minimum_wanted_level_to 3 end end // cleanup 0249: release_model CHAR_MODEL 01C2: remove_references_to_actor CHAR_MODEL
set, change, alter, player, minimum, wanted, level