Difference between revisions of "0130"
Jump to navigation
Jump to search
(highlight) |
m |
||
Line 14: | Line 14: | ||
{{Pre|class=sb-code|1= | {{Pre|class=sb-code|1= | ||
<span class="nl">:opcode_0130</span> | <span class="nl">:opcode_0130</span> | ||
+ | <span class="c1">// 0@ - input param (player handle)</span> | ||
<span class="nv">0@</span> *= <span class="m">0x170</span> <span class="c1">// size of each player info struct</span> | <span class="nv">0@</span> *= <span class="m">0x170</span> <span class="c1">// size of each player info struct</span> | ||
− | <span class="nv">0@</span> += <span class="m"> | + | <span class="nv">0@</span> += <span class="m">0x94AD28</span> <span class="c1">// base address for player info</span> |
+ | <span class="nv">0@</span> += <span class="m">0xCC</span> <span class="c1">// wasted/busted status offset</span> | ||
05E0: <span class="nv">0@</span> = read_memory <span class="nv">0@</span> size <span class="m">1</span> virtual_protect <span class="m">0</span> <span class="c1">// read status</span> | 05E0: <span class="nv">0@</span> = read_memory <span class="nv">0@</span> size <span class="m">1</span> virtual_protect <span class="m">0</span> <span class="c1">// read status</span> | ||
<span class="nv">0@</span> == <span class="m">2</span> <span class="c1">// is busted</span> | <span class="nv">0@</span> == <span class="m">2</span> <span class="c1">// is busted</span> |
Latest revision as of 21:20, 26 November 2016
- Description
- Checks if the player is arrested
- Syntax
- 0130: player [player handle] busted
- Parameter
- [player handle]
- The handle of the player
This conditional opcode returns true if the busted screen pops up.
For Vice City
This opcode does not exist in Vice City but it is still possible to check if the player is busted. The following example, using Sanny Builder with CLEO for Vice City in an external script (not the main one) and tested on US v1.0, should work similarly to this opcode. Place this at the end of the file:
:opcode_0130 // 0@ - input param (player handle) 0@ *= 0x170 // size of each player info struct 0@ += 0x94AD28 // base address for player info 0@ += 0xCC // wasted/busted status offset 05E0: 0@ = read_memory 0@ size 1 virtual_protect 0 // read status 0@ == 2 // is busted 05F6: ret 0
Use this line as a substitute for opcode 03C9. This can be placed anywhere within the external script as a conditional statement.
// ... if 05F5: call_scm_func @opcode_0130 inputs 1 player_handle [player_handle] then // [RETURNED TRUE] else // [RETURNED FALSE] end // ...
Keywords
check, player, busted, arrested
See also
- 0256, checks if the player is playing