096D

From GTAMods Wiki
Revision as of 12:36, 25 February 2009 by Seemann (talk | contribs)
Jump to navigation Jump to search

096D=3,%1d% %2h% %3d%
Description: Gets the model of the car component
Parameter 1: Vehicle handle
Parameter 2: Slot to get car component
Parameter 3: Variable to store DFF model ID of car component
Supports: San Andreas

This opcode stores the model ID of the car component in the current slot of a vehicle. This opcode only works on cars that have a valid slot. The game will crash if the vehicle does not have a slot. To make checks to be sure that the game wouldn't crash, you have to use 06E5.

Example

This example code is taken directly from Rockstar's original mission script. The following codes uses Sanny Builder. It is somewhat misnamed in the current version. This code checks if the vehicle has all 16 valid car component slots.

:ResetValues
0006: 0@ = 0
0006: 1@ = 0

:CheckMod
00D6: if 0
001B:   16 > 0@
004D: jump_if_false @CheckModFinish
06E5: get_car 2@ possible_to_built_in_component_pool_index 3@(0@,16i) itemID_to 4@(0@,16i)
00D6: if 0
8039:   not  4@(0@,16i) == -1 
004D: jump_if_false @AddArray
000A: 1@ += 1 

:AddArray
000A: 0@ += 1 
0002: jump @CheckMod

:CheckModFinish
00D6: if 0
8039:   not 1@ == 0
004D: jump_if_false @EndThread
096D: get_car 2@ car_component 1 on_slot 3

:EndThread
004E: end_thread

Keywords

car, vehicle, component, mod