Difference between revisions of "Weapon"

From GTAMods Wiki
Jump to navigation Jump to search
(External links)
 
(25 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{This|This article contains generic information about weapons, their placement and usage. For the definition through [[IDE]] 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''.
  
A '''weapon''' is anything that can damage other objects, including vehicles and pedestrians. It is one of the core gameplay feature of Grand Theft Auto.
+
== Mission script ==
 
+
=== Opcodes ===
== Mission Script ==
+
{|class="nowrap-col-2"
The following [[opcode]]s 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.<br>
+
|[[0113]] ||{{Icon|3}} ||adds ammo to the player's weapon
[[0114]] - Sets an actor's weapon ammo while in a vehicle<br>
+
|-
[[017B]] - Sets an actor's weapon ammo<br>
+
|[[0114]] ||{{Icon|t}} ||adds ammo to the character's weapon
[[01B2]] - Gives an actor a weapon<br>
+
|-
[[01B9]] - Sets an actor's currently armed weapon<br>
+
|[[017A]] ||{{Icon|3}} {{Icon|VC}} ||sets the player's weapon ammo
[[0237]] - Sets a gang's weapons<br>
+
|-
[[02D6]] - Checks if a weapon is being fired in a location<br>
+
|[[017B]] ||{{Icon|3}} {{Icon|SA}} ||sets the character's weapon ammo
[[02D8]] - Checks the current weapon an actor is holding<br>
+
|-
[[02E2]] - Sets an actor's weapon accuracy<br>
+
|[[01B1]] ||{{Icon|3}} {{Icon|VC}} ||gives the weapon to the player
[[031D]] - Checks if an actor is hit by a weapon<br>
+
|-
[[031E]] - Checks if a vehicle is hit by a weapon<br>
+
|[[01B2]] ||{{Icon|t}} ||gives the weapon to the character
[[032B]] - Creates a pickup with ammo info &ndash; usually used for weapons<br>
+
|-
[[041A]] - Gets the current amount of ammo for the weapon<br>
+
|[[01B8]] ||{{Icon|3}} {{Icon|VC}} ||sets the current weapon of the player
[[0467]] - Resets 031D<br>
+
|-
[[0468]] - Resets 031E<br>
+
|[[01B9]] ||{{Icon|t}} ||sets the current weapon of the character
[[0470]] - Gets an actor's current weapon<br>
+
|-
[[048F]] - Removes weapons from an actor<br>
+
|[[0213]] ||{{Icon|t}} ||creates a [[pickup]] with predefined ammo
[[0491]] - Checks if an actor has the weapon<br>
+
|-
[[04B8]] - Gets the weapon's data from an actor<br>
+
|[[0237]] ||{{Icon|t}} ||sets the gang's weapons
[[0501]] - Sets the player's ability to drive by<br>
+
|-
[[0555]] - Removes a specific weapon from an actor<br>
+
|[[02D7]] ||{{Icon|3}} {{Icon|VC}} ||checks the current weapon of the player
[[0563]] - Sets the player's drive by ammo<br>
+
|-
[[06AB]] - Hides all weapons<br>
+
|[[02D8]] ||{{Icon|t}} ||checks the current weapon of the character
[[0713]] - Makes an actor do drive bys<br>
+
|-
[[081A]] - Sets an actor's weapon skill<br>
+
|[[02E2]] ||{{Icon|t}} ||sets the character's weapon accuracy
[[087E]] - Sets an actor to drop weapons after a death<br>
+
|-
[[0881]] - Sets an actor be able to shoot<br>
+
|[[031D]] ||{{Icon|t}} ||checks if the character is damaged by the weapon
[[0946]] - Sets an actor oblivious to weapon fire<br>
+
|-
[[0992]] - Sets the player's ability to scroll through weapons<br><br>
+
|[[031E]] ||{{Icon|t}} ||checks if the vehicle is damaged by the weapon
<!--- [[SannyBuilder]] got a mistake in is SASCM.ini file here. 032B wants "group" instead of "type", but the group is defined through the weapon object id - see below -->
+
|-
Some opcodes (like [[032B]] or [[0213]]) require a pickup type. There are several pickup types. For a list of all types see ''[[0213#Types_of_Pickups|Pickup types]]''.
+
|[[032B]] ||{{Icon|t}} ||creates a pickup with ammo
 +
|-
 +
|[[0419]] ||{{Icon|3}} {{Icon|VC}} ||gets the ammo of the player's weapon
 +
|-
 +
|[[041A]] ||{{Icon|3}} ||gets the ammo of the character's weapon
 +
|-
 +
|[[0467]] ||{{Icon|t}} ||clears the character's last weapon damage
 +
|-
 +
|[[0468]] ||{{Icon|t}} ||clears the vehicle's last weapon damage
 +
|-
 +
|[[046F]] ||{{Icon|3}} {{Icon|VC}} ||gets the player's current weapon
 +
|-
 +
|[[0470]] ||{{Icon|t}} ||gets the character's current weapon
 +
|-
 +
|[[048F]] ||{{a|r}} |{{Icon|VC}} {{Icon|SA}} ||removes all of the character's weapons
 +
|-
 +
|[[0490]] ||{{a|c}} |{{Icon|VC}} ||checks if the player has the weapon
 +
|-
 +
|[[0491]] ||{{a|r}} |{{Icon|SA}} ||checks if the character has the weapon
 +
|-
 +
|[[04B8]] ||{{a|r}} |{{Icon|VC}} {{Icon|SA}} ||gets the character's weapon data
 +
|-
 +
|[[0501]] ||{{a|r}} |{{Icon|VC}} {{Icon|SA}} ||sets player can do drive by
 +
|-
 +
|[[0555]] ||{{a|r}} |{{Icon|SA}} ||removes the weapon from the character
 +
|-
 +
|[[0563]] ||{{a|r}} |{{Icon|VC}} {{Icon|SA}} ||ensures player has a drive-by weapon
 +
|-
 +
|[[06AB]] ||{{a|r}} |{{Icon|SA}} ||hides all weapons
 +
|-
 +
|[[0713]] ||{{a|r}} |{{Icon|SA}} ||makes the character do drive bys
 +
|-
 +
|[[081A]] ||{{a|r}} |{{Icon|SA}} ||sets the character's weapon skill
 +
|-
 +
|[[087E]] ||{{a|r}} |{{Icon|SA}} ||sets the character to drop weapons after a death
 +
|-
 +
|[[0881]] ||{{a|r}} |{{Icon|SA}} ||sets the character be able to shoot
 +
|-
 +
|[[0946]] ||{{a|r}} |{{Icon|SA}} ||sets the character oblivious to weapon fire
 +
|-
 +
|[[0992]] ||{{a|r}} |{{Icon|SA}} ||sets the player's ability to scroll through weapons
 +
|}
  
 
=== [[Native function]]s ===
 
=== [[Native function]]s ===
Line 45: Line 86:
 
{{Incomplete}}
 
{{Incomplete}}
  
== Lists of Weapons ==
+
== Lists of weapons ==
=== GTA3 ===
+
=== GTA 2 ===
{{Incomplete}}
+
{|class="mw-collapsible sortable mw-collapsed wikitable center-col-1"
 +
!Type ||Enum ||Name ||Icon
 +
|-
 +
|0 ||PISTOL ||Pistol ||style="height: 44px; text-align: right; vertical-align: top;" |[[File:Gta2 pistol.png|Pistol]]
 +
|-
 +
|1 ||MACHINE_<wbr>GUN ||S-Uzi Machine Gun ||style="height: 44px; text-align: right; vertical-align: top;" |[[File:Gta2 machinegun.png|S-Uzi Machine Gun]]
 +
|-
 +
|2 ||ROCKET_<wbr>LAUNCHER ||Rocket Launcher ||style="height: 44px; text-align: right; vertical-align: top;" |[[File:Gta2 rocketlauncher.png|Rocket Launcher]]
 +
|-
 +
|3 ||ELECTRO_<wbr>GUN ||ElectroGun ||style="height: 44px; text-align: right; vertical-align: top;" |[[File:Gta2 electrogun.png|ElectroGun]]
 +
|-
 +
|4 ||MOLOTOV ||Molotov Cocktails ||style="height: 44px; text-align: right; vertical-align: top;" |[[File:Gta2 molotov.png|Molotov Cocktails]]
 +
|-
 +
|5 ||GRENADE ||Grenades ||style="height: 44px; text-align: right; vertical-align: top;" |[[File:Gta2 grenade.png|Grenades]]
 +
|-
 +
|6 ||SHOTGUN ||Shotgun ||style="height: 44px; text-align: right; vertical-align: top;" |[[File:Gta2 shotgun.png|Shotgun]]
 +
|-
 +
|7 ||ELECTRO_<wbr>BATON ||ElectroBaton ||style="height: 44px; text-align: right; vertical-align: top;" |[[File:Gta2 electrobaton.png|ElectroBaton]]
 +
|-
 +
|8 ||FLAME_<wbr>THROWER ||Flamethrower ||style="height: 44px; text-align: right; vertical-align: top;" |[[File:Gta2 flamethrower.png|Flamethrower]]
 +
|-
 +
|9 ||SILENCED_<wbr>MACHINE_<wbr>GUN ||Silenced S-Uzi Machine Gun ||style="height: 44px; text-align: right; vertical-align: top;" |[[File:Gta2 silencedmachinegun.png|Silenced S-Uzi Machine Gun]]
 +
|-
 +
|10 ||DUAL_<wbr>PISTOL ||Dual Pistol ||style="height: 44px; text-align: right; vertical-align: top;" |[[File:Gta2 dualpistol.png|Dual Pistol]]
 +
|-
 +
|11 ||WEAPON_<wbr>11 ||na ||style="height: 44px; text-align: right; vertical-align: top;" |[[File:Gta2 weapon11.png]]
 +
|-
 +
|12 ||WEAPON_<wbr>12 ||na ||style="height: 44px; text-align: right; vertical-align: top;" |[[File:Gta2 weapon12.png]]
 +
|-
 +
|13 ||WEAPON_<wbr>13 ||na ||style="height: 44px; text-align: right; vertical-align: top;" |[[File:Gta2 weapon13.png]]
 +
|-
 +
|14 ||WEAPON_<wbr>14 ||na ||style="height: 44px; text-align: right; vertical-align: top;" |[[File:Gta2 weapon14.png]]
 +
|}
 +
 
 +
=== 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 <code>weapons.dff</code> and <code>generic.txd</code>; only the selected object from the model hierarchy, e.g. pistol or Uzi is visible when the player chooses a weapon.
 +
{|class="mw-collapsible sortable mw-collapsed wikitable center-col-1"
 +
!Type ||Enum ||Name ||Model<br>index ||Model<br>name ||Icon
 +
|-
 +
|0 ||WEAPONTYPE_<wbr>UNARMED ||Unarmed ||||||[[File:gta3_fist.png]]
 +
|-
 +
|1 ||WEAPONTYPE_<wbr>BASEBALLBAT ||Bat ||172 ||bat ||[[File:gta3_bat.png]]
 +
|-
 +
|2 ||WEAPONTYPE_<wbr>PISTOL ||Pistol ||173 ||colt45 ||[[File:gta3_pistol.png]]
 +
|-
 +
|3 ||WEAPONTYPE_<wbr>UZI ||Uzi ||178 ||uzi ||[[File:gta3_uzi.png]]
 +
|-
 +
|4 ||WEAPONTYPE_<wbr>SHOTGUN ||Shotgun ||176 ||shotgun ||[[File:gta3_shotgun.png]]
 +
|-
 +
|5 ||WEAPONTYPE_<wbr>CHAINGUN ||AK47 ||171 ||ak47 ||[[File:gta3_ak47.png]]
 +
|-
 +
|6 ||WEAPONTYPE_<wbr>M16 ||M16 ||180 ||m16 ||[[File:gta3_m16.png]]
 +
|-
 +
|7 ||WEAPONTYPE_<wbr>SNIPERRIFLE ||Sniper Rifle ||177 ||sniper ||[[File:gta3_sniper.png]]
 +
|-
 +
|8 ||WEAPONTYPE_<wbr>ROCKET ||Rocket Launcher ||175 ||rocket ||[[File:gta3_rocket.png]]
 +
|-
 +
|9 ||WEAPONTYPE_<wbr>FLAMETHROWER ||Flamethrower ||181 ||flame ||[[File:gta3_flame.png]]
 +
|-
 +
|10 ||WEAPONTYPE_<wbr>MOLOTOV ||Molotov Cocktail ||174 ||molotov ||[[File:gta3_molotov.png]]
 +
|-
 +
|11 ||WEAPONTYPE_<wbr>GRENADE ||Grenade ||170 ||grenade ||[[File:gta3_grenade.png]]
 +
|-
 +
|12 ||WEAPONTYPE_<wbr>DETONATOR ||Detonator ||182 ||bomb ||[[File:gta3_detonator.png]]
 +
|}
  
 
=== Vice City ===
 
=== 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 <code>[[weapon.dat]]</code> file. Information on melee combat is located in the <code>[[melee.dat]]</code> file. The textures and models of the weapons are located in the <code>[[gta3.img]]</code> file. The HUD icon of the first is located in the <code>[[hud.txd]]</code> file.
+
[[Vice City]] is the first GTA that lets you replace a weapon of the same type. Information on melee combat is located in the <code>[[melee.dat]]</code> file. The textures and models of the weapons are located in the <code>[[gta3.img]]</code> file. The HUD icon of the fist is located in the <code>[[hud.txd]]</code> file.
{|{{Prettytable}} width="100%" class="collapsible collapsed sortable"
+
{|class="mw-collapsible sortable mw-collapsed wikitable center-col-1"
! Name
+
!Type ||[[SCM language III/VC definitions#WEAPONTYPE|Enum]] ||Name ||Model<br>index ||Model<br>name ||Icon ||Slot
! ID
 
! Model
 
! Group
 
! Number
 
 
|-
 
|-
| Unarmed
+
|0 ||WEAPONTYPE_<wbr>UNARMED ||Unarmed || || ||[[File:VC fist.png]] ||0
|  
 
|  
 
|  
 
| 0
 
 
|-
 
|-
| Brass Knuckle
+
|1 ||WEAPONTYPE_<wbr>BRASSKNUCKLE ||Brass Knuckle ||259 ||brassknuckle ||[[File:VC brassknuckle.png]] ||0
| 259
 
| #brassknuckle
 
|  
 
| 1
 
 
|-
 
|-
| Screw Driver
+
|2 ||WEAPONTYPE_<wbr>SCREWDRIVER ||Screw Driver ||260 ||screwdriver ||[[File:VC screwdriver.png]] ||1
| 260
 
| #screwdriver
 
|  
 
| 2
 
 
|-
 
|-
| Golf Club
+
|3 ||WEAPONTYPE_<wbr>GOLFCLUB ||Golf Club ||261 ||golfclub ||[[File:VC golfclub.png]] ||1
| 261
 
| #golfclub
 
|  
 
| 3
 
 
|-
 
|-
| Night Stick
+
|4 ||WEAPONTYPE_<wbr>NIGHTSTICK ||Night Stick ||262 ||nitestick ||[[File:VC nitestick.png]] ||1
| 262
 
| #nitestick
 
|  
 
| 4
 
 
|-
 
|-
| Knife
+
|5 ||WEAPONTYPE_<wbr>KNIFE ||Knife ||263 ||knifecur ||[[File:VC knifecur.png]] ||1
| 263
 
| #knifecur
 
|  
 
| 5
 
 
|-
 
|-
| Baseball Bat
+
|6 ||WEAPONTYPE_<wbr>BASEBALLBAT ||Baseball Bat ||264 ||bat ||[[File:VC bat.png]] ||1
| 264
 
| #bat
 
|  
 
| 6
 
 
|-
 
|-
| Hammer
+
|7 ||WEAPONTYPE_<wbr>HAMMER ||Hammer ||265 ||hammer ||[[File:VC hammer.png]] ||1
| 265
 
| #hammer
 
|  
 
| 7
 
 
|-
 
|-
| Cleaver
+
|8 ||WEAPONTYPE_<wbr>CLEAVER ||Cleaver ||266 ||cleaver ||[[File:VC cleaver.png]] ||1
| 266
 
| #cleaver
 
|  
 
| 8
 
 
|-
 
|-
| Machete
+
|9 ||WEAPONTYPE_<wbr>MACHETE ||Machete ||267 ||machete ||[[File:VC machete.png]] ||1
| 267
 
| #machete
 
|  
 
| 9
 
 
|-
 
|-
| Katana
+
|10 ||WEAPONTYPE_<wbr>KATANA ||Katana ||268 ||katana ||[[File:VC katana.png]] ||1
| 268
 
| #katana
 
|  
 
| 10
 
 
|-
 
|-
| Chainsaw
+
|11 ||WEAPONTYPE_<wbr>CHAINSAW ||Chainsaw ||269 ||chnsaw ||[[File:VC chnsaw.png]] ||1
| 269
 
| #chnsaw
 
|  
 
| 11
 
 
|-
 
|-
| Grenade
+
|12 ||WEAPONTYPE_<wbr>GRENADE ||Grenade ||270 ||grenade ||[[File:VC grenade.png]] ||2
| 270
 
| #grenade
 
| 2
 
| 12
 
 
|-
 
|-
| Remote Detonator
+
|13 ||WEAPONTYPE_<wbr>DETONATOR_GRENADE ||Remote Detonator ||270<br>291 ||grenade<br>bomb ||[[File:VC grenade.png]]<br>[[File:VC bomb.png]] ||2
| 291
 
| #bomb
 
| 2
 
| 13
 
 
|-
 
|-
| Tear Gas
+
|14 ||WEAPONTYPE_<wbr>TEARGAS ||Tear Gas ||271 ||teargas ||[[File:VC teargas.png]] ||2
| 271
 
| #teargas
 
| 2
 
| 14
 
 
|-
 
|-
| Molotov
+
|15 ||WEAPONTYPE_<wbr>MOLOTOV ||Molotov ||272 ||molotov ||[[File:VC molotov.png]] ||2
| 272
 
| #molotov
 
| 2
 
| 15
 
 
|-
 
|-
| Missile
+
|16 ||WEAPONTYPE_<wbr>ROCKET ||Missile ||273 ||missile ||style="height: 64px;" |- ||2
| 273
 
| #missile
 
| 2
 
| 16
 
 
|-
 
|-
| Colt .45 (Pistol)
+
|17 ||WEAPONTYPE_<wbr>PISTOL ||Colt .45 (Pistol) ||274 ||colt45 ||[[File:VC colt45.png]] ||3
| 274
 
| #colt45
 
| 3
 
| 17
 
 
|-
 
|-
| Python (.357)
+
|18 ||WEAPONTYPE_<wbr>PYTHON ||Python (.357) ||275 ||python ||[[File:VC python.png]] ||3
| 275
 
| #python
 
| 3
 
| 18
 
 
|-
 
|-
| Chrome Shotgun
+
|19 ||WEAPONTYPE_<wbr>SHOTGUN ||Chrome Shotgun ||277 ||chromegun ||[[File:VC chromegun.png]] ||4
| 276
 
| #chromegun
 
| 4
 
| 19
 
 
|-
 
|-
| Spaz Shotgun (S.P.A.S. 12)
+
|20 ||WEAPONTYPE_<wbr>SPAS12_SHOTGUN ||Spaz Shotgun (S.P.A.S. 12) ||278 ||shotgspa ||[[File:VC shotgspa.png]] ||4
| 277
 
| #shotgspa
 
| 4
 
| 20
 
 
|-
 
|-
| Stubby Shotgun
+
|21 ||WEAPONTYPE_<wbr>STUBBY_SHOTGUN ||Stubby Shotgun ||279 ||buddyshot ||[[File:VC buddyshot.png]] ||4
| 278
 
| #buddyshot
 
| 4
 
| 21
 
 
|-
 
|-
| Tec-9
+
|22 ||WEAPONTYPE_<wbr>TEC9 ||Tec-9 ||281 ||tec9 ||[[File:VC tec9.png]] ||5
| 281
 
| #tec9
 
| 5
 
| 22
 
 
|-
 
|-
| Uzi 9mm (Uz-I)
+
|23 ||WEAPONTYPE_<wbr>UZI ||Uzi 9mm (Uz-I) ||282 ||uzi ||[[File:VC uzi.png]] ||5
| 282
 
| #uzi
 
| 5
 
| 23
 
 
|-
 
|-
| Ingram Mac 10
+
|24 ||WEAPONTYPE_<wbr>SILENCED_INGRAM ||Ingram Mac 10 ||283 ||ingramsl ||[[File:VC ingramsl.png]] ||5
| 283
 
| #ingramsl
 
| 5
 
| 24
 
 
|-
 
|-
| MP5 (MP)
+
|25 ||WEAPONTYPE_<wbr>MP5 ||MP5 (MP) ||284 ||mp5lng ||[[File:VC mp5lng.png]] ||5
| 284
 
| #mp5lng
 
| 5
 
| 25
 
 
|-
 
|-
| M4
+
|26 ||WEAPONTYPE_<wbr>M4 ||M4 ||280 ||m4 ||[[File:VC m4.png]] ||6
| 280
 
| #m4
 
| 6
 
| 26
 
 
|-
 
|-
| Ruger (Kruger)
+
|27 ||WEAPONTYPE_<wbr>RUGER ||Ruger (Kruger) ||276 ||ruger ||[[File:VC ruger.png]] ||6
| 276
 
| #ruger
 
| 6
 
| 27
 
 
|-
 
|-
| Rocket Launcher
+
|28 ||WEAPONTYPE_<wbr>SNIPERRIFLE ||Sniper Rifle ||285 ||sniper ||[[File:VC sniper.png]] ||8
| 287
 
| #rocketla
 
| 7
 
| 30
 
 
|-
 
|-
| Flame Thrower
+
|29 ||WEAPONTYPE_<wbr>LASERSCOPE ||PSG-1 (.308 Sniper) ||286 ||laser ||[[File:VC laser.png]] ||8
| 288
 
| #flame
 
| 7
 
| 31
 
 
|-
 
|-
| M60
+
|30 ||WEAPONTYPE_<wbr>ROCKETLAUNCHER ||Rocket Launcher ||287 ||rocketla ||[[File:VC rocketla.png]] ||7
| 289
+
|-
| #M60
+
|31 ||WEAPONTYPE_<wbr>FLAMETHROWER ||Flame Thrower ||288 ||flame ||[[File:VC flame.png]] ||7
| 7
+
|-
| 32
+
|32 ||WEAPONTYPE_<wbr>M60 ||M60 ||289 ||m60 ||[[File:VC m60.png]] ||7
 +
|-
 +
|33 ||WEAPONTYPE_<wbr>MINIGUN ||Minigun ||290<br>294 ||minigun<br>minigun2 ||[[File:VC minigun.png]] ||7
 +
|-
 +
|34 ||WEAPONTYPE_<wbr>DETONATOR ||Detonator ||291 ||bomb ||[[File:VC bomb.png]] ||9
 +
|-
 +
|35 ||WEAPONTYPE_<wbr>HELICANNON ||HeliCanon ||289 ||m60 ||style="height: 64px;" |- ||7
 +
|-
 +
|36 ||WEAPONTYPE_<wbr>CAMERA ||Camera ||292 ||camera ||[[File:VC camera.png]] ||9
 
|}
 
|}
 +
 
=== San Andreas ===
 
=== 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.
 
[[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.
  
{|{{Prettytable}} width="100%" class="collapsible collapsed sortable"
+
{|class="mw-collapsible sortable mw-collapsed wikitable center-col-1"
! Name
+
!Type ||Name ||Model<br>index ||Model<br>name ||Icon ||Slot
! ID
 
! Model
 
! Group
 
! Number
 
 
|-
 
|-
| Unarmed
+
|0 ||Unarmed ||||||[[File:Sa fist.png]] ||1
|  
 
|  
 
| 1
 
| 0
 
 
|-
 
|-
| Brass Knuckle
+
|1 ||Brass Knuckle ||331 ||brassknuckle ||[[File:Sa brassknukle.png]] ||1
| 331
 
| #brassknuckle
 
| 1
 
| 1
 
 
|-
 
|-
| Golf Club
+
|2 ||Golf Club ||333 ||golfclub ||[[File:Sa golfclub.png]] ||2
| 333
 
| #golfclub
 
| 2
 
| 2
 
 
|-
 
|-
| Night Stick
+
|3 ||Night Stick ||334 ||nitestick ||[[File:Sa nitestick.png]] ||2
| 334
 
| #nitestick
 
| 2
 
| 3
 
 
|-
 
|-
| Knife
+
|4 ||Knife ||335 ||knifecur ||[[File:Sa knifecur.png]] ||2
| 335
 
| #knifecur
 
| 2
 
| 4
 
 
|-
 
|-
| Baseball Bat
+
|5 ||Baseball Bat ||336 ||bat ||[[File:Sa bat.png]] ||2
| 336
 
| #bat
 
| 2
 
| 5
 
 
|-
 
|-
| Shovel
+
|6 ||Shovel ||337 ||shovel ||[[File:Sa shovel.png]] ||2
| 337
 
| #shovel
 
| 2
 
| 6
 
 
|-
 
|-
| Pool Cue
+
|7 ||Pool Cue ||338 ||poolcue ||[[File:Sa poolcue.png]] ||2
| 338
 
| #poolcue
 
| 2
 
| 7
 
 
|-
 
|-
| Katana
+
|8 ||Katana ||339 ||katana ||[[File:Sa katana.png]] ||2
| 339
 
| #katana
 
| 2
 
| 8
 
 
|-
 
|-
| Chainsaw
+
|9 ||Chainsaw ||341 ||chnsaw ||[[File:Sa chnsaw.png]] ||2
| 341
 
| #chnsaw
 
| 2
 
| 9
 
 
|-
 
|-
| Purple Dildo
+
|10 ||Purple Dildo ||321 ||gun_dildo1 ||[[File:Sa gun dildo1.png]] ||11
| 321
 
| #gun_dildo1
 
| 11
 
| 10
 
 
|-
 
|-
| White Dildo
+
|11 ||White Dildo ||322 ||gun_dildo2 ||[[File:Sa gun dildo2.png]] ||11
| 322
 
| #gun_dildo2
 
| 11
 
| 11
 
 
|-
 
|-
| Long White Vibrator
+
|12 ||Long White Vibrator ||323 ||gun_vibe1 ||[[File:Sa gun vibe1.png]] ||11
| 323
 
| #gun_vibe1
 
| 11
 
| 12
 
 
|-
 
|-
| Short White Vibrator
+
|13 ||Short White Vibrator ||324 ||gun_vibe2 ||[[File:Sa gun vibe2.png]] ||11
| 324
 
| #gun_vibe2
 
| 11
 
| 13
 
 
|-
 
|-
| Flowers
+
|14 ||Flowers ||325 ||flowera ||[[File:Sa flowera.png]] ||11
| 325
 
| #flowera
 
| 11
 
| 14
 
 
|-
 
|-
| Cane
+
|15 ||Cane ||326 ||gun_cane ||[[File:Sa gun_cane.png]] ||11
| 326
 
| #gun_cane
 
| 11
 
| 15
 
 
|-
 
|-
| Grenade
+
|16 ||Grenade ||342 ||grenade ||[[File:Sa grenade.png]] ||9
| 342
 
| #grenade
 
| 9
 
| 16
 
 
|-
 
|-
| Tear Gas
+
|17 ||Tear Gas ||343 ||teargas ||[[File:Sa teargas.png]] ||9
| 343
 
| #teargas
 
| 9
 
| 17
 
 
|-
 
|-
| Molotov Cocktail
+
|18 ||Molotov Cocktail ||344 ||molotov ||[[File:Sa molotov.png]] ||9
| 344
 
| #molotov
 
| 9
 
| 18
 
 
|-
 
|-
| Pistol
+
|22 ||Pistol ||346 ||colt45 ||[[File:Sa colt45.png]] ||3
| 346
 
| #colt45
 
| 3
 
| 22
 
 
|-
 
|-
| Silenced Pistol
+
|23 ||Silenced Pistol ||347 ||silenced ||[[File:Sa silenced.png]] ||3
| 347
 
| #silenced
 
| 3
 
| 23
 
 
|-
 
|-
| Desert Eagle
+
|24 ||Desert Eagle ||348 ||desert_eagle ||[[File:Sa desert eagle.png]] ||3
| 348
 
| #desert_eagle
 
| 3
 
| 24
 
 
|-
 
|-
| Shotgun
+
|25 ||Shotgun ||349 ||chromegun ||[[File:Sa chromegun.png]] ||4
| 349
 
| #chromegun
 
| 4
 
| 25
 
 
|-
 
|-
| Sawnoff Shotgun
+
|26 ||Sawnoff Shotgun ||350 ||sawnoff ||[[File:Sa sawnoff.png]] ||4
| 350
 
| #sawnoff
 
| 4
 
| 26
 
 
|-
 
|-
| Combat Shotgun
+
|27 ||Combat Shotgun ||351 ||shotgspa ||[[File:Sa shotgspa.png]] ||4
| 351
 
| #shotgspa
 
| 4
 
| 27
 
 
|-
 
|-
| Micro SMG
+
|28 ||Micro SMG ||352 ||micro_uzi ||[[File:Sa micro uzi.png]] ||5
| 352
 
| #micro_uzi
 
| 5
 
| 28
 
 
|-
 
|-
| SMG
+
|29 ||SMG ||353 ||mp5lng ||[[File:Sa mp5lng.png]] ||5
| 353
 
| #mp5lng
 
| 5
 
| 29
 
 
|-
 
|-
| AK47
+
|30 ||AK47 ||355 ||ak47 ||[[File:Sa ak47.png]] ||6
| 355
 
| #ak47
 
| 6
 
| 30
 
 
|-
 
|-
| M4
+
|31 ||M4 ||356 ||m4 ||[[File:Sa m4.png]] ||6
| 356
 
| #m4
 
| 6
 
| 31
 
 
|-
 
|-
| Tec9
+
|32 ||Tec9 ||372 ||tec9 ||[[File:Sa tec9.png]] ||5
| 372
 
| #tec9
 
| 5
 
| 32
 
 
|-
 
|-
| Rifle
+
|33 ||Rifle ||357 ||cuntgun ||[[File:Sa cuntgun.png]] ||7
| 357
 
| #cuntgun
 
| 7
 
| 33
 
 
|-
 
|-
| Sniper Rifle
+
|34 ||Sniper Rifle ||358 ||sniper ||[[File:Sa sniper.png]] ||7
| 358
 
| #sniper
 
| 7
 
| 34
 
 
|-
 
|-
| Rocket Launcher
+
|35 ||Rocket Launcher ||359 ||rocketla ||[[File:Sa rocketla.png]] ||8
| 359
 
| #rocketla
 
| 8
 
| 35
 
 
|-
 
|-
| Heat Seeking Rocket Launcher
+
|36 ||Heat Seeking Rocket Launcher ||360 ||heatseek ||[[File:Sa heatseek.png]] ||8
| 360
 
| #heatseek
 
| 8
 
| 36
 
 
|-
 
|-
| Flame Thrower
+
|37 ||Flame Thrower ||361 ||flame ||[[File:Sa flame.png]] ||8
| 361
 
| #flame
 
| 8
 
| 37
 
 
|-
 
|-
| Minigun
+
|38 ||Minigun ||362 ||minigun ||[[File:Sa minigun.png]] ||8
| 362
 
| #minigun
 
| 8
 
| 38
 
 
|-
 
|-
| Satchel Charges
+
|39 ||Satchel Charges ||363 ||satchel ||[[File:Sa satchel.png]] ||9
| 363
 
| #satchel
 
| 9
 
| 39
 
 
|-
 
|-
| Detonator
+
|40 ||Detonator ||364 ||bomb ||[[File:Sa bomb.png]] ||13
| 364
 
| #bomb
 
| 13
 
| 40
 
 
|-
 
|-
| Spray Paint
+
|41 ||Spray Paint ||365 ||spraycan ||[[File:Sa spraycan.png]] ||10
| 365
 
| #spraycan
 
| 10
 
| 41
 
 
|-
 
|-
| Fire Extinguisher
+
|42 ||Fire Extinguisher ||366 ||fire_ex ||[[File:Sa fire ex.png]] ||10
| 366
 
| #fire_ex
 
| 10
 
| 42
 
 
|-
 
|-
| Camera
+
|43 ||Camera ||367 ||camera ||[[File:Sa camera.png]] ||10
| 367
 
| #camera
 
| 10
 
| 43
 
 
|-
 
|-
| Night-vision Goggles
+
|44 ||Night-vision Goggles ||368 ||nvgoggles ||[[File:Sa nvgoggles.png]] ||12
| 368
 
| #nvgoggles
 
| 12
 
| 44
 
 
|-
 
|-
| Thermal Goggles
+
|45 ||Thermal Goggles ||369 ||irgoggles ||[[File:Sa irgoggles.png]] ||12
| 369
 
| #irgoggles
 
| 12
 
| 45
 
 
|-
 
|-
| Parachute
+
|46 ||Parachute ||371 ||gun_para ||[[File:Sa gun paraIcon.png]] ||12
| 371
 
| #gun_para
 
| 12
 
| 46
 
 
|}
 
|}
  
=== GTA 4 ===
+
=== GTA IV ===
 
''Main article:'' [[List of Weapons (GTA4)]]
 
''Main article:'' [[List of Weapons (GTA4)]]
  
== External Link ==
+
== See also ==
 +
* {{Icon|t}} [[Pickup]], general pickup information including weapon pickups
 +
* {{Icon|t}} [[weapon.dat]], file containing general weapon data
 +
* {{Icon|VC}} {{Icon|SA}} [[WEAP]], an [[IDE]] section for weapon definitions
 +
* {{Icon|SA}} [[PICK]], an [[IPL]] section for weapon pickups
 +
 
 +
== External links ==
 +
* {{Icon|VC}} [http://www.gtavice.com/weapons/ Vice City Weapons]
 +
* {{Icon|SA}} [http://www.gtasanandreas.net/weapons/ San Andreas Weapons]
 
* {{GTAF|205020|Generic SA SCM Documentation}}
 
* {{GTAF|205020|Generic SA SCM Documentation}}
 +
* {{Icon|VC}} [https://web.archive.org/web/20230111221512/http://archive.vc-mp.org/to2014/index.php?topic=194.msg1230 More Model Ids For Vice City] - Includes body armor model id.
  
{{N|4|SA}}
+
{{N|4|LCS|SA|VC|3}}
  
[[Category:Mission Script]][[Category:GTA 3]][[Category:GTA VC]][[Category:GTA LCS]][[Category:GTA VCS]]
+
[[Category:Mission Script]][[Category:GTA 2]][[Category:GTA LCS]][[Category:GTA VCS]]

Latest revision as of 22:25, 11 January 2023

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

Opcodes

0113 GTA III adds ammo to the player's weapon
0114 GTA III Vice City San Andreas adds ammo to the character's weapon
017A GTA III Vice City sets the player's weapon ammo
017B GTA III San Andreas sets the character's weapon ammo
01B1 GTA III Vice City gives the weapon to the player
01B2 GTA III Vice City San Andreas gives the weapon to the character
01B8 GTA III Vice City sets the current weapon of the player
01B9 GTA III Vice City San Andreas sets the current weapon of the character
0213 GTA III Vice City San Andreas creates a pickup with predefined ammo
0237 GTA III Vice City San Andreas sets the gang's weapons
02D7 GTA III Vice City checks the current weapon of the player
02D8 GTA III Vice City San Andreas checks the current weapon of the character
02E2 GTA III Vice City San Andreas sets the character's weapon accuracy
031D GTA III Vice City San Andreas checks if the character is damaged by the weapon
031E GTA III Vice City San Andreas checks if the vehicle is damaged by the weapon
032B GTA III Vice City San Andreas creates a pickup with ammo
0419 GTA III Vice City gets the ammo of the player's weapon
041A GTA III gets the ammo of the character's weapon
0467 GTA III Vice City San Andreas clears the character's last weapon damage
0468 GTA III Vice City San Andreas clears the vehicle's last weapon damage
046F GTA III Vice City gets the player's current weapon
0470 GTA III Vice City San Andreas gets the character's current weapon
048F Vice City San Andreas removes all of the character's weapons
0490 Vice City checks if the player has the weapon
0491 San Andreas checks if the character has the weapon
04B8 Vice City San Andreas gets the character's weapon data
0501 Vice City San Andreas sets player can do drive by
0555 San Andreas removes the weapon from the character
0563 Vice City San Andreas ensures player has a drive-by weapon
06AB San Andreas hides all weapons
0713 San Andreas makes the character do drive bys
081A San Andreas sets the character's weapon skill
087E San Andreas sets the character to drop weapons after a death
0881 San Andreas sets the character be able to shoot
0946 San Andreas sets the character oblivious to weapon fire
0992 San Andreas 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 2

Type Enum Name Icon
0 PISTOL Pistol Pistol
1 MACHINE_GUN S-Uzi Machine Gun S-Uzi Machine Gun
2 ROCKET_LAUNCHER Rocket Launcher Rocket Launcher
3 ELECTRO_GUN ElectroGun ElectroGun
4 MOLOTOV Molotov Cocktails Molotov Cocktails
5 GRENADE Grenades Grenades
6 SHOTGUN Shotgun Shotgun
7 ELECTRO_BATON ElectroBaton ElectroBaton
8 FLAME_THROWER Flamethrower Flamethrower
9 SILENCED_MACHINE_GUN Silenced S-Uzi Machine Gun Silenced S-Uzi Machine Gun
10 DUAL_PISTOL Dual Pistol Dual Pistol
11 WEAPON_11 na Gta2 weapon11.png
12 WEAPON_12 na Gta2 weapon12.png
13 WEAPON_13 na Gta2 weapon13.png
14 WEAPON_14 na Gta2 weapon14.png

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.

Type Enum Name Model
index
Model
name
Icon
0 WEAPONTYPE_UNARMED Unarmed Gta3 fist.png
1 WEAPONTYPE_BASEBALLBAT Bat 172 bat Gta3 bat.png
2 WEAPONTYPE_PISTOL Pistol 173 colt45 Gta3 pistol.png
3 WEAPONTYPE_UZI Uzi 178 uzi Gta3 uzi.png
4 WEAPONTYPE_SHOTGUN Shotgun 176 shotgun Gta3 shotgun.png
5 WEAPONTYPE_CHAINGUN AK47 171 ak47 Gta3 ak47.png
6 WEAPONTYPE_M16 M16 180 m16 Gta3 m16.png
7 WEAPONTYPE_SNIPERRIFLE Sniper Rifle 177 sniper Gta3 sniper.png
8 WEAPONTYPE_ROCKET Rocket Launcher 175 rocket Gta3 rocket.png
9 WEAPONTYPE_FLAMETHROWER Flamethrower 181 flame Gta3 flame.png
10 WEAPONTYPE_MOLOTOV Molotov Cocktail 174 molotov Gta3 molotov.png
11 WEAPONTYPE_GRENADE Grenade 170 grenade Gta3 grenade.png
12 WEAPONTYPE_DETONATOR Detonator 182 bomb Gta3 detonator.png

Vice City

Vice City is the first GTA that lets you replace a weapon of the same type. 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 fist is located in the hud.txd file.

Type Enum Name Model
index
Model
name
Icon Slot
0 WEAPONTYPE_UNARMED Unarmed VC fist.png 0
1 WEAPONTYPE_BRASSKNUCKLE Brass Knuckle 259 brassknuckle VC brassknuckle.png 0
2 WEAPONTYPE_SCREWDRIVER Screw Driver 260 screwdriver VC screwdriver.png 1
3 WEAPONTYPE_GOLFCLUB Golf Club 261 golfclub VC golfclub.png 1
4 WEAPONTYPE_NIGHTSTICK Night Stick 262 nitestick VC nitestick.png 1
5 WEAPONTYPE_KNIFE Knife 263 knifecur VC knifecur.png 1
6 WEAPONTYPE_BASEBALLBAT Baseball Bat 264 bat VC bat.png 1
7 WEAPONTYPE_HAMMER Hammer 265 hammer VC hammer.png 1
8 WEAPONTYPE_CLEAVER Cleaver 266 cleaver VC cleaver.png 1
9 WEAPONTYPE_MACHETE Machete 267 machete VC machete.png 1
10 WEAPONTYPE_KATANA Katana 268 katana VC katana.png 1
11 WEAPONTYPE_CHAINSAW Chainsaw 269 chnsaw VC chnsaw.png 1
12 WEAPONTYPE_GRENADE Grenade 270 grenade VC grenade.png 2
13 WEAPONTYPE_DETONATOR_GRENADE Remote Detonator 270
291
grenade
bomb
VC grenade.png
VC bomb.png
2
14 WEAPONTYPE_TEARGAS Tear Gas 271 teargas VC teargas.png 2
15 WEAPONTYPE_MOLOTOV Molotov 272 molotov VC molotov.png 2
16 WEAPONTYPE_ROCKET Missile 273 missile - 2
17 WEAPONTYPE_PISTOL Colt .45 (Pistol) 274 colt45 VC colt45.png 3
18 WEAPONTYPE_PYTHON Python (.357) 275 python VC python.png 3
19 WEAPONTYPE_SHOTGUN Chrome Shotgun 277 chromegun VC chromegun.png 4
20 WEAPONTYPE_SPAS12_SHOTGUN Spaz Shotgun (S.P.A.S. 12) 278 shotgspa VC shotgspa.png 4
21 WEAPONTYPE_STUBBY_SHOTGUN Stubby Shotgun 279 buddyshot VC buddyshot.png 4
22 WEAPONTYPE_TEC9 Tec-9 281 tec9 VC tec9.png 5
23 WEAPONTYPE_UZI Uzi 9mm (Uz-I) 282 uzi VC uzi.png 5
24 WEAPONTYPE_SILENCED_INGRAM Ingram Mac 10 283 ingramsl VC ingramsl.png 5
25 WEAPONTYPE_MP5 MP5 (MP) 284 mp5lng VC mp5lng.png 5
26 WEAPONTYPE_M4 M4 280 m4 VC m4.png 6
27 WEAPONTYPE_RUGER Ruger (Kruger) 276 ruger VC ruger.png 6
28 WEAPONTYPE_SNIPERRIFLE Sniper Rifle 285 sniper VC sniper.png 8
29 WEAPONTYPE_LASERSCOPE PSG-1 (.308 Sniper) 286 laser VC laser.png 8
30 WEAPONTYPE_ROCKETLAUNCHER Rocket Launcher 287 rocketla VC rocketla.png 7
31 WEAPONTYPE_FLAMETHROWER Flame Thrower 288 flame VC flame.png 7
32 WEAPONTYPE_M60 M60 289 m60 VC m60.png 7
33 WEAPONTYPE_MINIGUN Minigun 290
294
minigun
minigun2
VC minigun.png 7
34 WEAPONTYPE_DETONATOR Detonator 291 bomb VC bomb.png 9
35 WEAPONTYPE_HELICANNON HeliCanon 289 m60 - 7
36 WEAPONTYPE_CAMERA Camera 292 camera VC camera.png 9

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.

Type Name Model
index
Model
name
Icon Slot
0 Unarmed Sa fist.png 1
1 Brass Knuckle 331 brassknuckle Sa brassknukle.png 1
2 Golf Club 333 golfclub Sa golfclub.png 2
3 Night Stick 334 nitestick Sa nitestick.png 2
4 Knife 335 knifecur Sa knifecur.png 2
5 Baseball Bat 336 bat Sa bat.png 2
6 Shovel 337 shovel Sa shovel.png 2
7 Pool Cue 338 poolcue Sa poolcue.png 2
8 Katana 339 katana Sa katana.png 2
9 Chainsaw 341 chnsaw Sa chnsaw.png 2
10 Purple Dildo 321 gun_dildo1 Sa gun dildo1.png 11
11 White Dildo 322 gun_dildo2 Sa gun dildo2.png 11
12 Long White Vibrator 323 gun_vibe1 Sa gun vibe1.png 11
13 Short White Vibrator 324 gun_vibe2 Sa gun vibe2.png 11
14 Flowers 325 flowera Sa flowera.png 11
15 Cane 326 gun_cane Sa gun cane.png 11
16 Grenade 342 grenade Sa grenade.png 9
17 Tear Gas 343 teargas Sa teargas.png 9
18 Molotov Cocktail 344 molotov Sa molotov.png 9
22 Pistol 346 colt45 Sa colt45.png 3
23 Silenced Pistol 347 silenced Sa silenced.png 3
24 Desert Eagle 348 desert_eagle Sa desert eagle.png 3
25 Shotgun 349 chromegun Sa chromegun.png 4
26 Sawnoff Shotgun 350 sawnoff Sa sawnoff.png 4
27 Combat Shotgun 351 shotgspa Sa shotgspa.png 4
28 Micro SMG 352 micro_uzi Sa micro uzi.png 5
29 SMG 353 mp5lng Sa mp5lng.png 5
30 AK47 355 ak47 Sa ak47.png 6
31 M4 356 m4 Sa m4.png 6
32 Tec9 372 tec9 Sa tec9.png 5
33 Rifle 357 cuntgun Sa cuntgun.png 7
34 Sniper Rifle 358 sniper Sa sniper.png 7
35 Rocket Launcher 359 rocketla Sa rocketla.png 8
36 Heat Seeking Rocket Launcher 360 heatseek Sa heatseek.png 8
37 Flame Thrower 361 flame Sa flame.png 8
38 Minigun 362 minigun Sa minigun.png 8
39 Satchel Charges 363 satchel Sa satchel.png 9
40 Detonator 364 bomb Sa bomb.png 13
41 Spray Paint 365 spraycan Sa spraycan.png 10
42 Fire Extinguisher 366 fire_ex Sa fire ex.png 10
43 Camera 367 camera Sa camera.png 10
44 Night-vision Goggles 368 nvgoggles Sa nvgoggles.png 12
45 Thermal Goggles 369 irgoggles Sa irgoggles.png 12
46 Parachute 371 gun_para Sa gun paraIcon.png 12

GTA IV

Main article: List of Weapons (GTA4)

See also

  • GTA III Vice City San Andreas Pickup, general pickup information including weapon pickups
  • GTA III Vice City San Andreas weapon.dat, file containing general weapon data
  • Vice City San Andreas WEAP, an IDE section for weapon definitions
  • San Andreas PICK, an IPL section for weapon pickups

External links