Weapon

From GTAMods Wiki
Jump to navigation Jump to search
This article contains information about weapons related to mission scripting. For the definition of weapons through IDE files see WEAP and for the placement using IPL see PICK.

A weapon is anything that can damage other objects, including vehicles and pedestrians. It is one of the core gameplay features of Grand Theft Auto.

Mission Script

The following opcodes is related to weapons. Some of the opcodes are specific to one game so click on the opcode to see more information about it, if it exists.

  • 0114, sets an actor's weapon ammo while in a vehicle
  • 017B, sets an actor's weapon ammo
  • 01B2, gives an actor a weapon
  • 01B9, sets an actor's currently armed weapon
  • 0237, sets a gang's weapons
  • 02D6, checks if a weapon is being fired in a location
  • 02D8, checks the current weapon an actor is holding
  • 02E2, sets an actor's weapon accuracy
  • 031D, checks if an actor is hit by a weapon
  • 031E, checks if a vehicle is hit by a weapon
  • 032B, creates a pickup with ammo info – usually used for weapons
  • 041A, gets the current amount of ammo for the weapon
  • 0467, resets 031D
  • 0468, resets 031E
  • 0470, gets an actor's current weapon
  • 048F, removes weapons from an actor
  • 0491, checks if an actor has the weapon
  • 04B8, gets the weapon's data from an actor
  • 0501, sets the player's ability to drive by
  • 0555, removes a specific weapon from an actor
  • 0563, sets the player's drive by ammo
  • 06AB, hides all weapons
  • 0713, makes an actor do drive bys
  • 081A, sets an actor's weapon skill
  • 087E, sets an actor to drop weapons after a death
  • 0881, sets an actor be able to shoot
  • 0946, sets an actor oblivious to weapon fire
  • 0992, sets the player's ability to scroll through weapons

Native functions

This section is incomplete. You can help by fixing and expanding it.

Lists of Weapons

GTA III

Unlike in Vice City and San Andreas, where each weapon has a separate mesh and texture, GTA3's weapons are stored in a single DFF and TXD file, namely weapons.dff and generic.txd; only the selected object from the model hierarchy, e.g. pistol or Uzi is visible when the player chooses a weapon. Most of the information on the weapons are located in the weapon.dat file.

Vice City

Vice City is the first GTA that lets you replace a weapon of the same type. Most of the information on the weapons are located in the weapon.dat file. Information on melee combat is located in the melee.dat file. The textures and models of the weapons are located in the gta3.img file. The HUD icon of the first is located in the hud.txd file. All sound effects listed here are hardcoded and their values correspond to the SFX file.

The last five columns contain values that are associated with an entry in the SFX file. Hardcoded arrays are used to assign sound effects to the weapons. For VC v1.0:

  1. ^ Array starts at 0x6B6558, for group 1 weapons only. Every swing of a melee weapon creates a sound.
  2. ^ Array starts at 0x6B657C, for group 1 weapons only. Whenever the player hits a character, it plays a sound effect.
  3. ^ Array starts at 0x6B65A0. For weapons that allow reloading, a sound is played each time the weapon is reloaded.
  4. ^ Array starts at 0x6B65F0. For weapons that fires bullets, a combination of sounds is played each time the weapon is fired.
  5. ^ Array starts at 0x6B6660. Certain weapons play a short and soft sound effect when the player stops firing the weapon.

Note that some weapons share the same SFX but plays them differently (M4 and Ruger firing sound for example).

San Andreas

San Andreas is the first GTA that lets you dual wield weapons. Information on weapons, melee combat, textures, and models are located in the same files as in Vice City.

GTA IV

Main article: List of Weapons (GTA4)

External links