Difference between revisions of "010E"

From GTAMods Wiki
Jump to navigation Jump to search
 
(highlight)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<code>010E=2,%1d% %2d%</code><br>
+
{{OpCode
'''Description''': Sets the player's minimum wanted level<br>
+
| games      = {{Icon|t}}
'''Parameter 1''': Player handle<br>
+
| command    = ALTER_WANTED_LEVEL_NO_DROP
'''Parameter 2''': Integer<br>
+
| description = Sets the player's minimum [[wanted level]]
'''Supports''': GTA3, Vice City, San Andreas<br>
+
| syntax1    = 010E: set_player [''player handle''] minimum_wanted_level_to [''int'']
 +
| p1t        = [''player handle'']
 +
| p1d        = The [[0053|handle of the player]]
 +
| p2t        = [''int'']
 +
| p2d        = Wanted level, range from 0 to 6
 +
| native      = [[ALTER_WANTED_LEVEL_NO_DROP]]
 +
}}
  
This can set the player's minimum wanted level 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.
  
==Keywords==
+
== Example ==
set, player, minimum, wanted, level
+
The following example spawns a ped close to the player. While the ped 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 ped is killed.
  
[[Category:OpCodes]]
+
{{Pre|class=sb-code|1=
 +
<span class="c1">// set constants</span>
 +
<span class="k">const</span>
 +
CHAR_MODEL = <span class="nt">#BFORI</span>  <span class="c1">// set your character model</span>
 +
CHAR_HANDLE = <span class="nv">0@</span>
 +
X_POS = <span class="nv">1@</span>
 +
Y_POS = <span class="nv">2@</span>
 +
Z_POS = <span class="nv">3@</span>
 +
<span class="k">end</span>
 +
 
 +
<span class="c1">// spawn character</span>
 +
[[0247]]: request_model CHAR_MODEL
 +
[[038B]]: load_requested_models
 +
[[00A0]]: store_actor <span class="nv">$PLAYER_ACTOR</span> position_to X_POS Y_POS Z_POS
 +
X_POS += <span class="m">4.0</span>
 +
[[009A]]: CHAR_HANDLE = create_actor <span class="m">4</span> CHAR_MODEL at X_POS Y_POS Z_POS
 +
<span class="c1">// attain minimum wanted level</span>
 +
<span class="k">while</span> <span class="k">if</span> [[0118|8118]]:  <span class="k">not</span> actor CHAR_HANDLE dead
 +
    <span class="k">wait</span> <span class="m">10</span>
 +
    <span class="k">if</span>
 +
        8184:  <span class="k">not</span> actor CHAR_HANDLE health >= <span class="m">95</span>
 +
    <span class="k">then</span>
 +
        010E: set_player <span class="nv">$PLAYER_CHAR</span> minimum_wanted_level_to <span class="m">3</span>
 +
    <span class="k">end</span>
 +
<span class="k">end</span>
 +
<span class="c1">// cleanup</span>
 +
[[0249]]: release_model CHAR_MODEL
 +
[[01C2]]: mark_actor_as_no_longer_needed CHAR_HANDLE
 +
}}
 +
 
 +
== Keywords ==
 +
set, change, alter, player, minimum, wanted, level, no, drop

Latest revision as of 05:54, 15 April 2017

GTA III Vice City San Andreas ALTER_WANTED_LEVEL_NO_DROP


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
ALTER_WANTED_LEVEL_NO_DROP

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.

Example

The following example spawns a ped close to the player. While the ped 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 ped is killed.

// set constants
const
CHAR_MODEL = #BFORI  // set your character model
CHAR_HANDLE = 0@
X_POS = 1@
Y_POS = 2@
Z_POS = 3@
end

// spawn character
0247: request_model CHAR_MODEL
038B: load_requested_models
00A0: store_actor $PLAYER_ACTOR position_to X_POS Y_POS Z_POS
X_POS += 4.0
009A: CHAR_HANDLE = create_actor 4 CHAR_MODEL at X_POS Y_POS Z_POS
// attain minimum wanted level
while if 8118:   not actor CHAR_HANDLE dead
    wait 10
    if
        8184:   not actor CHAR_HANDLE health >= 95
    then
        010E: set_player $PLAYER_CHAR minimum_wanted_level_to 3
    end
end
// cleanup
0249: release_model CHAR_MODEL
01C2: mark_actor_as_no_longer_needed CHAR_HANDLE

Keywords

set, change, alter, player, minimum, wanted, level, no, drop