Difference between revisions of "096D"

From GTAMods Wiki
Jump to navigation Jump to search
 
Line 1: Line 1:
<code>096D=3,%1d% %2h% %3d%</code><br>
+
{{OpCode
'''Description''': Gets the model of the car component<br>
+
| games      = {{Icon|SA}}
'''Parameter 1''': Vehicle handle<br>
+
| command    = GET_CURRENT_CAR_MOD
'''Parameter 2''': Slot to get car component<br>
+
| description = Gets the model of the car component
'''Parameter 3''': Variable to store [[DFF]] model ID of car component<br>
+
| syntax1    = 096D: get_car [''car handle''] component_on_slot [''int''] model_to [''var'']
'''Supports''': San Andreas<br>
+
| p1t        = [''car handle'']
 +
| p1d        = The handle of the vehicle
 +
| p2t        = [''int'']
 +
| p2d        = Slot
 +
| p3t        = [''var'']
 +
| p3d        = Variable to store the model index
 +
}}
  
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]].
+
This opcode stores the model index of the car component in the selected slot of the vehicle. If the slot is not valid, the game will crash.
  
==Example==
+
== Keywords ==
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.
 
<source lang="scm">
 
: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
 
</source>
 
 
 
==Keywords==
 
 
car, vehicle, component, mod
 
car, vehicle, component, mod
 
[[Category:OpCodes]]
 

Latest revision as of 10:06, 3 December 2016

San Andreas GET_CURRENT_CAR_MOD


Description
Gets the model of the car component
Syntax
096D: get_car [car handle] component_on_slot [int] model_to [var]
Parameter
[car handle]
The handle of the vehicle
[int]
Slot
[var]
Variable to store the model index

This opcode stores the model index of the car component in the selected slot of the vehicle. If the slot is not valid, the game will crash.

Keywords

car, vehicle, component, mod