Difference between revisions of "047D"

From GTAMods Wiki
Jump to navigation Jump to search
m
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{Icon|3}} '''GET_NUMBER_OF_SEATS_IN_MODEL'''
+
__NOTOC__
<hr />
+
{{OpCode
'''Description'''
+
| games      = {{Icon|3}}
: Gets number of seats in vehicle with specified model
+
| command    = GET_NUMBER_OF_SEATS_IN_MODEL
'''Syntax'''
+
| description = Gets the number of seats in the model
: 047D: get_number_of_seats_in_model [''int''] store_to [''var'']
+
| syntax1    = 047D: get_number_of_seats_in_model [''int''] store_to [''var'']
'''Parameter'''
+
| p1t        = [''int'']
: [''int'']
+
| p1d        = Valid model index as defined in the [[IDE]] file; also acceptable is model's [[DFF]] name with a hash character
:: Valid vehicle model ID number as defined in the [[IDE]] file; also acceptable is model's [[DFF]] name identified by a hash character
+
| p2t        = [''var'']
: [''var'']
+
| p2d        = Variable to store number of seats
:: Variable to store number of seats
+
}}
  
This opcode stores the number of seats in a [[model]]. The model must be a valid vehicle model, otherwise the opcode returns an unexpectable result. Some returned values are [[hardcoded]] as described below:
+
This opcode stores the number of seats in the [[model]]. The model should be a valid vehicle model as defined in the [[CARS (IDE Section)|CARS section]] of the IDE file, otherwise the opcode returns a useless result. Some returned values are [[hardcoded]] as described below:
  
 
{|class="wikitable"
 
{|class="wikitable"
Line 22: Line 22:
 
|124||TRAIN||3
 
|124||TRAIN||3
 
|-
 
|-
|127||COACH||8
+
|127||COACH||2 or 9{{Ref|1}}
 
|-
 
|-
|131||RCBANDIT||0
+
|131||RCBANDIT||1
 
|}
 
|}
 +
 +
== Note ==
 +
{{Note|1}} Basically this opcode returns the number of doors for the model plus one. Thus it never returns a value less than 1. To optimize the game performance, the number of doors is only counted at the first loading of the model. If the model was not loaded before calling this opcode, the result is always 2. The Coach model is the only one influenced by the inaccurate coding: once it's loaded the opcode returns 9 as the result.
  
 
== Keywords ==
 
== Keywords ==
model, seats, store, get
+
get, store, number, model, seats
 
 
__NOTOC__
 
[[Category:OpCodes]]
 

Latest revision as of 13:30, 21 December 2016

GTA III GET_NUMBER_OF_SEATS_IN_MODEL


Description
Gets the number of seats in the model
Syntax
047D: get_number_of_seats_in_model [int] store_to [var]
Parameter
[int]
Valid model index as defined in the IDE file; also acceptable is model's DFF name with a hash character
[var]
Variable to store number of seats

This opcode stores the number of seats in the model. The model should be a valid vehicle model as defined in the CARS section of the IDE file, otherwise the opcode returns a useless result. Some returned values are hardcoded as described below:

Model Id Model Name Number of seats
97 FIRETRUK 2
124 TRAIN 3
127 COACH 2 or 9[1]
131 RCBANDIT 1

Note

^ Basically this opcode returns the number of doors for the model plus one. Thus it never returns a value less than 1. To optimize the game performance, the number of doors is only counted at the first loading of the model. If the model was not loaded before calling this opcode, the result is always 2. The Coach model is the only one influenced by the inaccurate coding: once it's loaded the opcode returns 9 as the result.

Keywords

get, store, number, model, seats