Difference between revisions of "0114"

From GTAMods Wiki
Jump to navigation Jump to search
m
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{OpCode
 
{{OpCode
| ini        = 0114=3,set_actor %1d% weapon %2h% ammo_to %3d% while_in_car
+
| games      = {{Icon|t}}
| description = Sets an actor's ammo while in a vehicle. 
+
| command    = ADD_AMMO_TO_CHAR
| p1          = Actor variable
+
| description = Adds ammo to the character's [[weapon]]
| p2          = Weapon ID number
+
| syntax1    = 0114: add_ammo_to_actor [''char handle''] weapon [''int1''] rounds [''int2'']
| p3          = Ammo amount
+
| p1t        = [''char handle'']
| game        = [[GTA III]], [[Vice City]], [[San Andreas]]
+
| p1d        = The handle of the character
 +
| p2t        = [''int1'']
 +
| p2d        = [[Weapon#Lists of weapons|Weapon type]]
 +
| p3t        = [''int2'']
 +
| p3d        = Ammo
 
}}
 
}}
This opcode sets an actors ammo for the specified weapon while in a vehicle
 
  
== Sanny Builder example ==
+
This opcode adds ammo to the character's weapon. In GTA III, if the character does not have the weapon, the weapon will be given to it along with ammo. In Vice City, if the character does not have the weapon or another weapon of the same slot, nothing happens. If the character does not have the weapon but does have another weapon of the same slot, ammo will be added for that weapon instead. This opcode was never called in the [[Main.scm|original script]] of GTA III. Legacy documentations had incorrectly described this opcode as setting ammo and working only while in a car.
  
<source lang="scm">0114: set_actor $PLAYER_ACTOR weapon 38 ammo_to 200000 while_in_car</source>
+
== Keywords ==
 +
add, character, actor, weapon, ammo
  
==Keywords==
+
== See also ==
weapons, vehicles
+
* {{Icon|3}} [[0113]], adds ammo to the player's weapon

Latest revision as of 19:18, 7 July 2017

GTA III Vice City San Andreas ADD_AMMO_TO_CHAR


Description
Adds ammo to the character's weapon
Syntax
0114: add_ammo_to_actor [char handle] weapon [int1] rounds [int2]
Parameter
[char handle]
The handle of the character
[int1]
Weapon type
[int2]
Ammo

This opcode adds ammo to the character's weapon. In GTA III, if the character does not have the weapon, the weapon will be given to it along with ammo. In Vice City, if the character does not have the weapon or another weapon of the same slot, nothing happens. If the character does not have the weapon but does have another weapon of the same slot, ammo will be added for that weapon instead. This opcode was never called in the original script of GTA III. Legacy documentations had incorrectly described this opcode as setting ammo and working only while in a car.

Keywords

add, character, actor, weapon, ammo

See also

  • GTA III 0113, adds ammo to the player's weapon