Difference between revisions of "03C9"

From GTAMods Wiki
Jump to navigation Jump to search
(Created page with "{{Icon|3}} '''IS_CAR_VISIBLY_DAMAGED''' <hr /> '''Description''' : Checks if the vehicle is visibly damaged '''Syntax''' : 03C9:   car [''car handle''] damaged '''Paramet...")
 
m
Line 1: Line 1:
{{Icon|3}} '''IS_CAR_VISIBLY_DAMAGED'''
+
{{OpCode
<hr />
+
| games      = {{Icon|3}}
'''Description'''
+
| command    = IS_CAR_VISIBLY_DAMAGED
: Checks if the vehicle is visibly damaged
+
| description = Checks if the vehicle is visibly damaged
'''Syntax'''
+
| syntax1    = 03C9: &nbsp; car [''car handle''] damaged
: 03C9: &nbsp; car [''car handle''] damaged
+
| p1t        = [''car handle'']
'''Parameter'''
+
| p1d        = The handle of the vehicle
: [''car handle'']
+
}}
:: The handle of the vehicle
 
  
 
This opcode returns true if the vehicle is visibly damaged. It does not depend on the health of the vehicle.
 
This opcode returns true if the vehicle is visibly damaged. It does not depend on the health of the vehicle.
Line 21: Line 20:
 
05FE: 0@ = 0@ SHR 1
 
05FE: 0@ = 0@ SHR 1
 
05F9: 0@ = 0@ AND 1
 
05F9: 0@ = 0@ AND 1
  0@ == 1  // is car visibly damaged
+
    0@ == 1  // is car visibly damaged
 
05F6: ret 0
 
05F6: ret 0
 
</syntaxhighlight>
 
</syntaxhighlight>
Line 29: Line 28:
 
// ...
 
// ...
 
if
 
if
  05F5: call_scm_func @opcode_03C9 inputs 1 car_handle [car handle]
+
    05F5: call_scm_func @opcode_03C9 inputs 1 car_handle [car handle]
 
then
 
then
  // [RETURNED TRUE]
+
    // [RETURNED TRUE]
 
else
 
else
  // [RETURNED FALSE]
+
    // [RETURNED FALSE]
 
end
 
end
 
// ...
 
// ...
Line 40: Line 39:
 
== Keywords ==
 
== Keywords ==
 
check, car, vehicle, visibly, visible, damage, damaged
 
check, car, vehicle, visibly, visible, damage, damaged
 
[[Category:OpCodes]]
 
[[Category:Code Snippets]]
 

Revision as of 03:34, 16 November 2016

GTA III IS_CAR_VISIBLY_DAMAGED


Description
Checks if the vehicle is visibly damaged
Syntax
03C9:   car [car handle] damaged
Parameter
[car handle]
The handle of the vehicle

This opcode returns true if the vehicle is visibly damaged. It does not depend on the health of the vehicle.

For Vice City

This opcode does not exist in Vice City but it is still possible to check if a vehicle is visibly damaged. 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_03C9
// 0@ - input param (car handle)
05E7: 0@ = car 0@ struct
0@ += 0x1FB
05E0: 0@ = read_memory 0@ size 1 virtual_protect 0
05FE: 0@ = 0@ SHR 1
05F9: 0@ = 0@ AND 1
    0@ == 1  // is car visibly damaged
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_03C9 inputs 1 car_handle [car handle]
then
    // [RETURNED TRUE]
else
    // [RETURNED FALSE]
end
// ...

Keywords

check, car, vehicle, visibly, visible, damage, damaged