0220

From GTAMods Wiki
Jump to navigation Jump to search

GTA III IS_CAR_ARMED_WITH_ANY_BOMB


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 stage 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
05F9: 0@ = 0@ AND 7
    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, stage

See also

  • GTA III 0228, checks if the vehicle is armed with a specific bomb
  • GTA III 0242, arms vehicle with bomb