Difference between revisions of "010E"
Jump to navigation
Jump to search
(updating page) |
|||
Line 1: | Line 1: | ||
− | {{ | + | {{Icon|trilogy}} |
− | + | <hr /> | |
− | + | '''Description''' | |
− | + | : Sets the player's minimum wanted level | |
− | + | '''Syntax''' | |
− | + | : 010E: set_player [''player handle''] minimum_wanted_level_to [''int''] | |
− | + | '''Parameter''' | |
− | + | : [''player handle''] | |
− | This | + | :: The handle of the player |
+ | : [''int''] | ||
+ | :: Wanted level, range from 0 to 6 | ||
+ | '''Native analog''' | ||
+ | : [[ALTER_WANTED_LEVEL_NO_DROP]] | ||
+ | |||
+ | This opcode sets the player's wanted level ranging from 0 to 6. If placed in a loop, this will set the minimum wanted level; the wanted level will not drop below the set value but a higher wanted level can be attained. | ||
+ | |||
+ | == Example == | ||
+ | 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. | ||
+ | |||
+ | <source lang="scm"> | ||
+ | // 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 | ||
+ | </source> | ||
==Keywords== | ==Keywords== | ||
set, change, alter, player, minimum, wanted, level | set, change, alter, player, minimum, wanted, level | ||
+ | |||
+ | [[Category:OpCodes]] |
Revision as of 04:48, 28 August 2011
Description
- Sets the player's minimum wanted level
Syntax
- 010E: set_player [player handle] minimum_wanted_level_to [int]
Parameter
- [player handle]
- The handle of the player
- [int]
- Wanted level, range from 0 to 6
Native analog
This opcode sets the player's wanted level ranging from 0 to 6. If placed in a loop, this will set the minimum wanted level; the wanted level will not drop below the set value but a higher wanted level can be attained.
Example
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
Keywords
set, change, alter, player, minimum, wanted, level