Difference between revisions of "0A30"

From GTAMods Wiki
Jump to navigation Jump to search
 
Line 1: Line 1:
<code>0A30=1,%1d%</code><br>
+
{{Icon|SA}}
'''Description''': Repairs the vehicle<br>
+
<hr />
'''Parameter 1''': Vehicle handle<br>
+
'''Description'''
'''Supports''': San Andreas<br>
+
: Repairs the specified vehicle
 +
'''Syntax'''
 +
: 0A30: repair_car [''car handle'']
 +
'''Parameter'''
 +
: [''car handle'']
 +
:: The handle of the vehicle
  
This opcode can repair the vehicle from all damages done to it.
+
This opcode repairs the vehicle from all damages done to it, including all physical damages like damaged panels or popped tires.
  
==Keywords==
+
== For GTA III and Vice City ==
 +
This opcode does not exist in GTA III and Vice City, but there exist a function that behaves similarly to this opcode in both games. The following example, using Sanny Builder with [[CLEO]] for either GTA III or Vice City, and tested on US v1.0, should work similarly to this opcode by tapping into the spray shop function.
 +
 
 +
<source lang="scm">
 +
// set constants
 +
const
 +
PLAYER_CAR = 0@
 +
MEM_VALUE = 1@
 +
PLAYING_VC = 2@
 +
end
 +
 
 +
PLAYING_VC = true  // if playing III, set to false
 +
if
 +
    00E0:  player $PLAYER_CHAR driving
 +
then
 +
    03C1: PLAYER_CAR = player $PLAYER_CHAR car
 +
    0224: set_car PLAYER_CAR health_to 1000
 +
    if
 +
        PLAYING_VC == true
 +
    then
 +
        05E7: MEM_VALUE = car PLAYER_CAR struct
 +
        MEM_VALUE += 0x29C
 +
        05E0: MEM_VALUE = read_memory MEM_VALUE size 1 virtual_protect 0
 +
        05E7: PLAYER_CAR = car PLAYER_CAR struct
 +
        if
 +
            MEM_VALUE == 0
 +
        then
 +
            05E3: call_method 0x588530 PLAYER_CAR num_params 0 pop 0
 +
        else
 +
            05E3: call_method 0x609F00 PLAYER_CAR num_params 0 pop 0
 +
        end
 +
    else
 +
        05E7: PLAYER_CAR = car PLAYER_CAR struct
 +
        05E3: call_method 0x53C240 PLAYER_CAR num_params 0 pop 0
 +
    end
 +
end
 +
</source>
 +
 
 +
== Keywords ==
 
repair, vehicle, car, damage
 
repair, vehicle, car, damage
  
[[Category:OpCodes]]
+
== External link ==
 +
* {{GTAG|16671|Vice City Aspirine}}, a mod for Vice City
 +
 
 +
[[Category:OpCodes]][[Category:Code Snippets]]

Revision as of 17:52, 5 December 2011

San Andreas


Description

Repairs the specified vehicle

Syntax

0A30: repair_car [car handle]

Parameter

[car handle]
The handle of the vehicle

This opcode repairs the vehicle from all damages done to it, including all physical damages like damaged panels or popped tires.

For GTA III and Vice City

This opcode does not exist in GTA III and Vice City, but there exist a function that behaves similarly to this opcode in both games. The following example, using Sanny Builder with CLEO for either GTA III or Vice City, and tested on US v1.0, should work similarly to this opcode by tapping into the spray shop function.

// set constants
const
PLAYER_CAR = 0@
MEM_VALUE = 1@
PLAYING_VC = 2@
end

PLAYING_VC = true  // if playing III, set to false
if
    00E0:   player $PLAYER_CHAR driving
then
    03C1: PLAYER_CAR = player $PLAYER_CHAR car
    0224: set_car PLAYER_CAR health_to 1000
    if
        PLAYING_VC == true
    then
        05E7: MEM_VALUE = car PLAYER_CAR struct
        MEM_VALUE += 0x29C
        05E0: MEM_VALUE = read_memory MEM_VALUE size 1 virtual_protect 0
        05E7: PLAYER_CAR = car PLAYER_CAR struct
        if
            MEM_VALUE == 0
        then
            05E3: call_method 0x588530 PLAYER_CAR num_params 0 pop 0
        else
            05E3: call_method 0x609F00 PLAYER_CAR num_params 0 pop 0
        end
    else
        05E7: PLAYER_CAR = car PLAYER_CAR struct
        05E3: call_method 0x53C240 PLAYER_CAR num_params 0 pop 0
    end
end

Keywords

repair, vehicle, car, damage

External link