Difference between revisions of "0413"

From GTAMods Wiki
Jump to navigation Jump to search
(Created page with '{{Icon|3}} '''SET_GET_OUT_OF_JAIL_FREE''' <hr /> <onlyinclude>{{#ifeq:{{{transcludesection|opcode}}}|opcode| '''Description''' : Enables get out of jail free for the player '''Sy…')
 
(code improved by Seemann)
Line 19: Line 19:
 
<source lang="scm">
 
<source lang="scm">
 
:opcode_0413
 
:opcode_0413
// 0@ - input param (placeholder)
+
// 0@ - input param (player handle)
 
// 1@ - input param (flag)
 
// 1@ - input param (flag)
0@ = 0x94AD28
+
0@ *= 368
 +
0@ += 0x94AD28
 
0@ += 0x145
 
0@ += 0x145
 
05DF: write_memory 0@ size 1 value 1@ virtual_protect 0
 
05DF: write_memory 0@ size 1 value 1@ virtual_protect 0

Revision as of 20:38, 2 February 2015

GTA III SET_GET_OUT_OF_JAIL_FREE


Description

Enables get out of jail free for the player

Syntax

0413: set_player [player handle] get_out_of_jail_free [int]

Parameter

[player handle]
The handle of the player
[int]
0 = disable out of jail free, 1 = enable out of jail free

This opcode sets get out of jail free for the player. When enabled, if the player is busted, he will not lose any cash after respawning, but weapons will still be removed. The get out of jail free works once only, so to allow this again, you have to enable it through this opcode again.

For Vice City

This opcode does not exist in Vice City, but the function that controls the busted sequence still contains this feature. 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_0413
// 0@ - input param (player handle)
// 1@ - input param (flag)
0@ *= 368
0@ += 0x94AD28
0@ += 0x145
05DF: write_memory 0@ size 1 value 1@ virtual_protect 0
05F6: ret 0

Use this line as a substitute for opcode 0413. This can be placed anywhere within the external script:

05F5: call_scm_func @opcode_0413 inputs 2 player_handle [player handle] get_out_of_jail_free [int]
// change [player handle] to the actual handle of the player, i.e. $PLAYER_CHAR, and change [int] to a flag

Keywords

set, toggle, player, free, prison, police, busted