Difference between revisions of "017B"

From GTAMods Wiki
Jump to navigation Jump to search
(Created page with '{{OpCode | ini = 017b=3,set_actor %1d% weapon %2d% ammo_to %3d% | description = Sets an actor's weapon ammo. | p1 = Actor variable | p2 = Weapon ID n…')
 
(page updates)
Line 1: Line 1:
{{OpCode
+
{{Icon|3}} {{Icon|SA}} '''SET_CHAR_AMMO'''
| ini        = 017b=3,set_actor %1d% weapon %2d% ammo_to %3d%
+
<hr />
| description = Sets an actor's weapon ammo
+
'''Description'''
| p1          = Actor variable
+
: Sets the character's weapon ammo
| p2          = Weapon ID number
+
'''Syntax'''
| p3          = Ammo amount
+
: 017B: set_actor [''char handle''] weapon [''int1''] ammo_to [''int2'']
| game        = [[GTA III]], [[Vice City]], [[San Andreas]]
+
'''Parameter'''
}}
+
: [''char handle'']
 +
:: The handle of the character
 +
: [''int1'']
 +
:: [[Weapon#Lists of Weapons|Weapon number]]
 +
: [''int2'']
 +
:: Ammo
  
This opcode sets an actors ammo for the specified weapon.  
+
This opcode sets the character's weapon ammo. If the character does not have the weapon, the weapon is given to it. Unlike opcode [[01B2]], it sets rather than adds to the ammo count and does not set the weapon as the current one for the character. You have to use opcode [[01B9]] to set it as the current one. When the character dies, it drops the weapon as a [[0213#Weapons|pickup type 4 with predefined ammo count]]. This opcode was never called in the [[Main.scm|original script]] of GTA III.
  
== Sanny Builder example ==
+
== Keywords ==
 +
set, character, actor, weapon, ammo
  
<source lang="scm">017B: set_actor $PLAYER_ACTOR weapon 22 ammo_to 10</source>
+
[[Category:OpCodes]]
 
 
==Keywords==
 
weapons
 

Revision as of 22:51, 26 July 2015

GTA III San Andreas SET_CHAR_AMMO


Description

Sets the character's weapon ammo

Syntax

017B: set_actor [char handle] weapon [int1] ammo_to [int2]

Parameter

[char handle]
The handle of the character
[int1]
Weapon number
[int2]
Ammo

This opcode sets the character's weapon ammo. If the character does not have the weapon, the weapon is given to it. Unlike opcode 01B2, it sets rather than adds to the ammo count and does not set the weapon as the current one for the character. You have to use opcode 01B9 to set it as the current one. When the character dies, it drops the weapon as a pickup type 4 with predefined ammo count. This opcode was never called in the original script of GTA III.

Keywords

set, character, actor, weapon, ammo