Difference between revisions of "0A30"

From GTAMods Wiki
Jump to navigation Jump to search
(code update)
m
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{{Icon|SA}}
+
{{Icon|SA}} '''FIX_CAR'''
 
<hr />
 
<hr />
 
'''Description'''
 
'''Description'''
Line 14: Line 14:
  
 
== For GTA III and Vice City ==
 
== For GTA III and Vice City ==
This opcode does not exist in GTA III and Vice City, but there exist a function used in spray shops that behaves similarly to this opcode in both games. The following example, using Sanny Builder with [[CLEO]] for GTA III and Vice City in an external script (not the main one), and tested on US v1.0, with some changes needed for GTA III, should work similarly to this opcode. Place this at the end of the file:
+
This opcode does not exist in GTA III and Vice City, but there exist a function used in spray shops that behaves similarly to this opcode in both games. The following example, using Sanny Builder with [[CLEO]] for GTA III and 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 for Vice City:
 
<source lang="scm">
 
<source lang="scm">
 
:opcode_0A30
 
:opcode_0A30
Line 26: Line 26:
 
     1@ == 0  // is car
 
     1@ == 0  // is car
 
then
 
then
     05E3: call_method 0x588530 0@ num_params 0 pop 0  // car repair, for GTA III please use 0x53C240
+
     05E3: call_method 0x588530 0@ num_params 0 pop 0  // car repair
 
else
 
else
     05E3: call_method 0x609F00 0@ num_params 0 pop 0  // others repair, for GTA III please use 0x53C240
+
     05E3: call_method 0x609F00 0@ num_params 0 pop 0  // others repair
 
end
 
end
 
05F6: ret 0
 
05F6: ret 0
 
</source>
 
</source>
 +
 +
or for GTA III:
 +
<source lang="scm">
 +
:opcode_0A30
 +
// 0@ - input param (car handle)
 +
0224: set_car 0@ health_to 1000
 +
05E7: 0@ = car 0@ struct
 +
05E3: call_method 0x53C240 0@ num_params 0 pop 0  // car repair
 +
05F6: ret 0
 +
</source>
 +
 
Use this line as a substitute for opcode 0A30. This can be placed anywhere within the external script:
 
Use this line as a substitute for opcode 0A30. This can be placed anywhere within the external script:
 
<source lang="scm">
 
<source lang="scm">
5F5: call_scm_func @opcode_0A30 inputs 1 car_handle [car handle]  // change [car handle] to the actual handle of the car
+
05F5: call_scm_func @opcode_0A30 inputs 1 car_handle [car handle]  // change [car handle] to the actual handle of the car
 
</source>
 
</source>
  
Line 41: Line 52:
  
 
== External link ==
 
== External link ==
* {{GTAG|16671|Vice City Aspirine}}, a mod for Vice City
+
* {{GTAG|16671|Vice City Aspirine}}, a mod for Vice City that simulates this behavior
  
 
[[Category:OpCodes]][[Category:Code Snippets]]
 
[[Category:OpCodes]][[Category:Code Snippets]]

Latest revision as of 04:17, 31 December 2014

San Andreas FIX_CAR


Description

Fixes the specified vehicle

Syntax

0A30: repair_car [car handle]

Parameter

[car handle]
The handle of the vehicle

Native analog

FIX_CAR

This opcode fixes 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 used in spray shops that behaves similarly to this opcode in both games. The following example, using Sanny Builder with CLEO for GTA III and 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 for Vice City:

:opcode_0A30
// 0@ - input param (car handle) 
0224: set_car 0@ health_to 1000
05E7: 1@ = car 0@ struct
1@ += 0x29C  // vehicle type offset
05E0: 1@ = read_memory 1@ size 1 virtual_protect 0
05E7: 0@ = car 0@ struct
if
    1@ == 0  // is car
then
    05E3: call_method 0x588530 0@ num_params 0 pop 0  // car repair
else
    05E3: call_method 0x609F00 0@ num_params 0 pop 0  // others repair
end
05F6: ret 0

or for GTA III:

:opcode_0A30
// 0@ - input param (car handle) 
0224: set_car 0@ health_to 1000
05E7: 0@ = car 0@ struct
05E3: call_method 0x53C240 0@ num_params 0 pop 0  // car repair
05F6: ret 0

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

05F5: call_scm_func @opcode_0A30 inputs 1 car_handle [car handle]  // change [car handle] to the actual handle of the car

Keywords

fix, repair, heal, vehicle, car, damage

External link