Difference between revisions of "04B8"

From GTAMods Wiki
Jump to navigation Jump to search
m
m
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
<code>04B8=5,%1d% %2h% %3d% %4d% %5d%</code><br>
+
{{OpCode
'''Description''': Stores the weapons data from an actor<br>
+
| games      = {{Icon|VC}} {{Icon|SA}}
'''Parameter 1''': Actor handle<br>
+
| command    = GET_CHAR_WEAPON_IN_SLOT
'''Parameter 2''': [[Weapon]] group<br>
+
| description = Gets the character's [[weapon]] data in the weapon slot
'''Parameter 3''': A variable to store the weapon number<br>
+
| syntax1    = 04B8: get_weapon_data_from_actor [''char handle''] slot [''int''] weapon [''var1''] ammo [''var2''] model [''var3'']
'''Parameter 4''': A variable to store the weapon ammo<br>
+
| p1t        = [''char handle'']
'''Parameter 5''': A variable to store the weapon model<br>
+
| p1d        = The handle of the character
'''Supports''': GTA3, Vice City, San Andreas<br>
+
| p2t        = [''int'']
 +
| p2d        = Slot + 1
 +
| p3t        = [''var1'']
 +
| p3d        = Variable to store the weapon type
 +
| p4t        = [''var2'']
 +
| p4d        = Variable to store the weapon ammo count
 +
| p5t        = [''var3'']
 +
| p5d        = Variable to store the weapon model index
 +
}}
  
This stores the weapon number, ammo, and model of the weapon in the weapon group of an actor. If there is no weapon for that weapon group, the weapon number returns 0 and the model returns -1.
+
This opcode gets the weapon type, ammo, and model in the weapon slot of the character. The model index is derived from the model id column in the [[weapon.dat]] file. If there is no weapon for that slot, the weapon type returns ''0'' and the model returns ''-1''.
  
==Keywords==
+
== Keywords ==
store, get, weapon, number, model
+
store, get, actor, character, weapon, type, model, slot
 
 
[[Category:OpCodes]]
 

Latest revision as of 18:14, 8 July 2017

Vice City San Andreas GET_CHAR_WEAPON_IN_SLOT


Description
Gets the character's weapon data in the weapon slot
Syntax
04B8: get_weapon_data_from_actor [char handle] slot [int] weapon [var1] ammo [var2] model [var3]
Parameter
[char handle]
The handle of the character
[int]
Slot + 1
[var1]
Variable to store the weapon type
[var2]
Variable to store the weapon ammo count
[var3]
Variable to store the weapon model index

This opcode gets the weapon type, ammo, and model in the weapon slot of the character. The model index is derived from the model id column in the weapon.dat file. If there is no weapon for that slot, the weapon type returns 0 and the model returns -1.

Keywords

store, get, actor, character, weapon, type, model, slot