Difference between revisions of "02B9"

From GTAMods Wiki
Jump to navigation Jump to search
m
m
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Icon|3}} {{Icon|SA}}
+
{{OpCode
<hr />
+
| games      = {{Icon|3}} {{Icon|SA}}
<onlyinclude>{{#ifeq:{{{transcludesection|opcode}}}|opcode|'''Description'''
+
| command    = DEACTIVATE_GARAGE
: Deactivates a [[garage]]
+
| description = Deactivates the [[garage]]
'''Syntax'''
+
| syntax1    = {{Icon|3}} 02B9: deactivate_garage [''garage handle'']
: {{Icon|3}} 02B9: deactivate_garage [''garage handle'']
+
| syntax2    = {{Icon|SA}} 02B9: deactivate_garage '[''string'']'
: {{Icon|SA}} 02B9: deactivate_garage [''string'']
+
| syntax3    = {{Icon|SA}} Garage.Deactivate( '[''string'']' )
: {{Icon|SA}} Garage.Deactivate( [''string''] )
+
| p1t        = [''garage handle'']
'''Parameter'''
+
| p1d        = The [[Garage#GTA III 2|handle of the garage]], for GTA III
: [''garage handle'']
+
| p2t        = [''string'']
:: The [[Garage#GTA III 2|handle of the garage]], for GTA III
+
| p2d        = The [[Garage#San Andreas 2|name of the garage]], for San Andreas
: [''string'']
+
}}
:: The [[Garage#San Andreas 2|name of the garage]], for San Andreas
 
  
This opcode deactivates a garage. It can be reactivated by using opcode [[0299]]. Normal garage functions will be limited, like save garages not opening, spray shops not being able to finish spraying, and bomb shops not being able to finish fitting the bomb.}}</onlyinclude>
+
This opcode deactivates the garage. It can be reactivated by using opcode [[0299]]. Normal garage functions will be limited, like save garages not opening, spray shops not being able to finish spraying, and bomb shops not being able to finish fitting the bomb.
  
 
== For Vice City ==
 
== For Vice City ==
This opcode does not exist in Vice City, but the deactivation behavior of the garage remains. The following example, using Sanny Builder with [[CLEO]] for Vice City, and tested on US v1.0, should work similarly to this opcode
+
This opcode does not exist in Vice City, but the deactivation behavior of the garage remains. 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:
<source lang="scm">
+
{{Pre|class=sb-code|1=
008B: 0@ = [garage handle// change [garage handle] to the actual handle of the garage, i.e. $655 for the Links View Apartment garage
+
<span class="nl">:opcode_02B9</span>
0@ *= 0xA8  // size of each garage block
+
<span class="c1">// 0@ - input param (garage handle)</span>
0@ += 0x812668  // add to beginning of garage block
+
<span class="nv">0@</span> *= <span class="m">0xA8</span> <span class="c1">// size of each garage struct</span>
0@ += 0x5  // offset that controls deactivation
+
<span class="nv">0@</span> += <span class="m">0x812668</span> <span class="c1">// base address for garages</span>
05DF: write_memory 0@ size 1 value 1 virtual_protect 0  // deactivate garage
+
<span class="nv">0@</span> += <span class="m">0x5</span> <span class="c1">// activation offset</span>
</source>
+
05DF: write_memory <span class="nv">0@</span> size <span class="m">1</span> value <span class="m">1</span> virtual_protect <span class="m">0</span> <span class="c1">// deactivate garage</span>
 +
05F6: ret <span class="m">0</span>
 +
}}
 +
 
 +
Use this line as a substitute for opcode 02B9. This can be placed anywhere within the external script:
 +
{{Pre|class=sb-code|1=
 +
05F5: call_scm_func <span class="nl">@opcode_02B9</span> inputs <span class="m">1</span> garage_handle [garage handle]
 +
}}
  
 
== Keywords ==
 
== Keywords ==
 
garage, deactivate, disable
 
garage, deactivate, disable
 
[[Category:OpCodes]][[Category:Code Snippets]]
 

Latest revision as of 18:42, 24 December 2016

GTA III San Andreas DEACTIVATE_GARAGE


Description
Deactivates the garage
Syntax
GTA III 02B9: deactivate_garage [garage handle]
San Andreas 02B9: deactivate_garage '[string]'
San Andreas Garage.Deactivate( '[string]' )
Parameter
[garage handle]
The handle of the garage, for GTA III
[string]
The name of the garage, for San Andreas

This opcode deactivates the garage. It can be reactivated by using opcode 0299. Normal garage functions will be limited, like save garages not opening, spray shops not being able to finish spraying, and bomb shops not being able to finish fitting the bomb.

For Vice City

This opcode does not exist in Vice City, but the deactivation behavior of the garage remains. 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_02B9
// 0@ - input param (garage handle)
0@ *= 0xA8  // size of each garage struct
0@ += 0x812668  // base address for garages
0@ += 0x5  // activation offset
05DF: write_memory 0@ size 1 value 1 virtual_protect 0  // deactivate garage
05F6: ret 0

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

05F5: call_scm_func @opcode_02B9 inputs 1 garage_handle [garage handle]

Keywords

garage, deactivate, disable