0220
Revision as of 04:34, 4 January 2016 by Spaceeinstein (talk | contribs) (Created page with "{{OpCode | games = {{Icon|3}} | command = IS_CAR_ARMED_WITH_ANY_BOMB | description = Checks if the vehicle is armed with any bomb | syntax1 = 0220: car ['...")
- Description
- Checks if the vehicle is armed with any bomb
- Syntax
- 0220: car [car handle] has_car_bomb
- Parameter
- [car handle]
- The handle of the vehicle
This conditional opcode returns true if the vehicle is armed with any car bomb.
For Vice City
This opcode does not exist in Vice City but the type of the car bomb armed in a vehicle can still be retrieved. 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_0220
// 0@ - input param (car handle)
05E7: 0@ = car 0@ struct
0@ += 0x1FE // car bomb offset
05E0: 0@ = read_memory 0@ size 1 virtual_protect 0
0@ -= 8 // subtract to reflect bomb type used in script
0@ > 0 // check if has bomb
05F6: ret 0
Use this line as a substitute for opcode 0220. This can be placed anywhere within the external script as a conditional statement:
// ...
if
05F5: call_scm_func @opcode_0220 inputs 1 car_handle [car_handle]
then
// [RETURNED TRUE]
else
// [RETURNED FALSE]
end
// ...
Keywords
check, car, vehicle, armed, has, any, bomb, status
See also
- 0228, checks if the vehicle is armed with a specific bomb