0228
Description
- Checks current type of bomb armed in the vehicle
Syntax
- 0228: car [car handle] bomb_status == [int]
Parameter
- [car handle]
- The handle of the vehicle
- [int]
This conditional opcode returns true if the vehicle contains the current status type of the bomb.
Bomb types
Type | Enum | Description |
---|---|---|
0 | CARBOMB_NONE | No bomb |
1 | CARBOMB_TIMED | Inactive timed bomb, can be obtained from garage type 2 |
2 | CARBOMB_ONIGNITION | Inactive ignition bomb, can be obtained from garage type 3 |
3 | CARBOMB_REMOTE | Remote detonation bomb, can be obtained from garage type 4 |
4 | CARBOMB_TIMEDACTIVE | Active timed bomb, activated from bomb type 1 |
5 | CARBOMB_ONIGNITIONACTIVE | Active ignition bomb, activated from bomb type 2 |
For Vice City
This opcode does not exist in Vice City but the status of the car bomb 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, retrieves the value of the status of the car bomb.
:opcode_0228_workaround
// 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 status used in script
05F6: ret 1 0@ // return car bomb status
Use this line to retrieve the value which can be used to check its current status. This can be placed anywhere within the external script:
05F5: call_scm_func @opcode_0228_workaround inputs 1 car_handle [car handle] store_to [var] // change [car handle] to the actual handle of the car
Keywords
check, car, vehicle, bomb, status
See also
- 0242, arms the car with the type of bomb