Difference between revisions of "096D"

From GTAMods Wiki
Jump to navigation Jump to search
(someone double check)
 
 
(One intermediate revision by one other user not shown)
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 the Sanny Builder. It is somewhat misnamed in the current version. This code checks if the vehicle has all 16 valid car component slots.<br>
 
<code>:ResetValues</code><br>
 
<code>[[0006]]: 0@ = 0</code><br>
 
<code>0006: 1@ = 0</code><br>
 
<code></code><br>
 
<code>:CheckMod</code><br>
 
<code>[[00D6]]: if 0</code><br>
 
<code>[[001B]]:  16 > 0@</code><br>
 
<code>[[004D]]: jump_if_false @CheckModFinish</code><br>
 
<code>[[06E5]]: get_car 2@ possible_to_built_in_component_pool_index 3@(0@,16i) itemID_to 4@(0@,16i)</code><br>
 
<code>00D6: if 0</code><br>
 
<code>[[8039]]:  not  4@(0@,16i) == -1 </code><br>
 
<code>004D: jump_if_false @AddArray</code><br>
 
<code>[[000A]]: 1@ += 1 </code><br>
 
<code></code><br>
 
<code>:AddArray</code><br>
 
<code>000A: 0@ += 1 </code><br>
 
<code>[[0002]]: jump @CheckMod2</code><br>
 
<code></code><br>
 
<code>:CheckModFinish</code><br>
 
<code>00D6: if 0</code><br>
 
<code>8039:  not 1@ == 0</code><br>
 
<code>004D: jump_if_false @EndThread</code><br>
 
<code>096D: get_car 2@ car_component 1 on_slot 3@</code><br>
 
<code></code><br>
 
<code>:EndThread</code><br>
 
<code>[[004E]]: end_thread</code>
 
==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