0242
Revision as of 09:00, 4 January 2016 by Spaceeinstein (talk | contribs) (Created page with "{{OpCode | games = {{Icon|3}} | command = ARM_CAR_WITH_BOMB | description = Arms the car with a bomb | syntax1 = 0242: set_car [''car handle''] bomb_status_to ['...")
- Description
- Arms the car with a bomb
- Syntax
- 0242: set_car [car handle] bomb_status_to [int]
- Parameter
- [car handle]
- The handle of the vehicle
- [int]
- Bomb type
This opcode arms the car with a car bomb. It has no effect on boats or trains.
For Vice City
This opcode does not exist in Vice City but vehicles can still be armed with a car bomb. 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_0242
// 0@ - input param (car handle)
// 1@ - input param (bomb type)
05E7: 2@ = car 0@ struct
2@ += 0x1FE // car bomb offset
05E0: 3@ = read_memory 2@ size 1 virtual_protect 0
0B10: 1@ = 1@ AND 7 // requires CLEO plugins
0B10: 3@ = 3@ AND 0xF8
0B11: 3@ = 3@ OR 1@
05DF: write_memory 2@ size 1 value 3@ virtual_protect 0
05F6: ret 0
Use this line as a substitute for opcode 0242. This can be placed anywhere within the external script:
05F5: call_scm_func @opcode_0242 inputs 2 car_handle [car_handle] bomb_type [int]
Keywords
set, arm, car, vehicle, bomb, status