Weapons: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
No edit summary
 
(25 intermediate revisions by 17 users not shown)
Line 1: Line 1:
'''Scripting functions that ask for a weapon ID need an integer that refers to the GTASA weapon ID list. They are listed below.'''
Scripting functions that ask for a weapon ID need an integer that refers to the GTASA weapon ID list. They are listed below.
<br>
{{Note|
*''NOTES:
*Clip size () denotes clip size when the weapon is dual wielded. Weapons without this specification are not dual wield weapons.
**''Clip size () denotes clip size when the weapon is dual wielded. Weapons without this specification are not dual wield weapons.''
*GTASA [[Weapon_skill_levels|weapon stats]] will affect movement, accuracy, damage, and dual wield capability. See [[setPedStat]] to change these stats. The default MTA server package comes with a resource called "defaultStats" that sets GTASA weapon stats to 999. See the weapon stats link for more info.
**''GTASA [[Weapon_skill_levels|weapon stats]] will affect movement, accuracy, damage, and dual wield capability. See [[SetPedStat]] to change these stats. The MTA server comes with a resource called "defaultStats"  
*For death reasons, especially in event handlers for onPlayerWasted or similar, also have a look at the [[Damage Types]].
that sets GTASA weapon stats to 999. See the weapon stats link for more info.''
*'''Name''' is compatible with functions [[getWeaponNameFromID]], [[getWeaponIDFromName]].
**''For death reasons, especially in event handlers for onPlayerWasted or similar, also have a look at the [[Death_Reasons]].
*'''Bullet Sync''' refers to whether they are triggered by the [[OnPlayerWeaponFire]] event.
<br>
}}
{|border="1" cellpadding="1" cellspacing="0" align="center"
{|class="wikitable sortable" style="text-align:center; margin: 1em auto 1em auto; border:1px solid black"
|-
|-
| style="background:#afafaf;"|
! Slot || class="unsortable" | Type || class="unsortable" | Image || Name || ID || class="unsortable" | Model ID || class="unsortable" | Clip || class="unsortable" | Sharing slot ammo || class="unsortable" | Bullet Sync
! scope="col" style="background:#afafaf;"| Weapon
! scope="col" style="background:#afafaf;"| ID
! scope="col" style="background:#afafaf;"| Clip
! scope="col" style="background:#afafaf;"| Model ID
| style="background:#afafaf;"|
! scope="col" style="background:#afafaf;"| Weapon
! scope="col" style="background:#afafaf;"| ID
! scope="col" style="background:#afafaf;"| Clip
! scope="col" style="background:#afafaf;"| Model ID
|-
|-
! scope="row" style="background:#cfcfcf;"| Slot 0: No Weapon
! rowspan="2" | 0
|style="background:#cfcfcf;"|Fist
! rowspan="2" | Hand
|style="background:#cfcfcf;"|0
| [[Image:Fist.png]] || align="left" | Fist || 0 || - || -
|style="background:#cfcfcf;"|
| rowspan="2" | -
|style="background:#cfcfcf;"|
| rowspan="2" | No
! scope="row" style="background:#cfcfcf;"| Slot 6: Rifles
|style="background:#cfcfcf;"|Country Rifle
|style="background:#cfcfcf;"|33
|style="background:#cfcfcf;"|1
|style="background:#cfcfcf;"|357
|-
|-
! scope="row" style="background:#cfcfcf;"|
| [[Image:Knuckle.png]] || align="left" | Brassknuckle || 1 || 331 || -
|style="background:#cfcfcf;"|Brass Knuckles
|style="background:#cfcfcf;"|1
|style="background:#cfcfcf;"|
|style="background:#cfcfcf;"|331
! scope="row" style="background:#cfcfcf;"|
|style="background:#cfcfcf;"|Sniper Rifle
|style="background:#cfcfcf;"|34
|style="background:#cfcfcf;"|1
|style="background:#cfcfcf;"|358
|-
|-
! scope="row" style="background:#efefef;"| Slot 1: Melee
! rowspan="8" | 1
|style="background:#efefef;"|Golf Club
! rowspan="8" | Melee
|style="background:#efefef;"|2
| [[Image:Golfclub.png]] || align="left" | Golfclub || 2 || 333 || -
|style="background:#efefef;"|
| rowspan="8" | -
|style="background:#efefef;"|333
| rowspan="8" | No
! scope="row" style="background:#efefef;"| Slot 7: Heavy Weapons
|style="background:#efefef;"|Rocket Launcher
|style="background:#efefef;"|35
|style="background:#efefef;"|1
|style="background:#efefef;"|359
|-
|-
! scope="row" style="background:#efefef;"|
| [[Image:Nitestik.png]] || align="left" | Nightstick || 3 || 334 || -
|style="background:#efefef;"|Nightstick
|style="background:#efefef;"|3
|style="background:#efefef;"|
|style="background:#efefef;"|334
! scope="row" style="background:#efefef;"|
|style="background:#efefef;"|Heat-Seeking RPG
|style="background:#efefef;"|36
|style="background:#efefef;"|1
|style="background:#efefef;"|360
|-
|-
! scope="row" style="background:#efefef;"|
| [[Image:Knife.png]] || align="left" | Knife || 4 || 335 || -
|style="background:#efefef;"|Knife
|style="background:#efefef;"|4
|style="background:#efefef;"|
|style="background:#efefef;"|335
! scope="row" style="background:#efefef;"|
|style="background:#efefef;"|Flamethrower
|style="background:#efefef;"|37
|style="background:#efefef;"|50
|style="background:#efefef;"|361
|-
|-
! scope="row" style="background:#efefef;"|
| [[Image:Bat.png]] || align="left" | Bat || 5 || 336 || -
|style="background:#efefef;"|Baseball Bat
|style="background:#efefef;"|5
|style="background:#efefef;"|
|style="background:#efefef;"|336
! scope="row" style="background:#efefef;"|
|style="background:#efefef;"|Minigun
|style="background:#efefef;"|38
|style="background:#efefef;"|500
|style="background:#efefef;"|362
|-
|-
! scope="row" style="background:#efefef;"|
| [[Image:Shovel.png]] || align="left" | Shovel || 6 || 337 || -
|style="background:#efefef;"|Shovel  
|style="background:#efefef;"|6
|style="background:#efefef;"|
|style="background:#efefef;"|337
! scope="row" style="background:#cfcfcf;"| Slot 8: Projectiles
|style="background:#cfcfcf;"|Grenade
|style="background:#cfcfcf;"|16
|style="background:#cfcfcf;"|1
|style="background:#cfcfcf;"|342
|-
|-
! scope="row" style="background:#efefef;"|
| [[Image:Poolcue.png]] || align="left" | Poolstick || 7 || 338 || -
|style="background:#efefef;"|Pool Cue
|style="background:#efefef;"|7
|style="background:#efefef;"|
|style="background:#efefef;"|338
! scope="row" style="background:#cfcfcf;"|
|style="background:#cfcfcf;"|Tear Gas
|style="background:#cfcfcf;"|17
|style="background:#cfcfcf;"|1
|style="background:#cfcfcf;"|343
|-
|-
! scope="row" style="background:#efefef;"|
| [[Image:Katana.png]] || align="left" | Katana || 8 || 339 || -
|style="background:#efefef;"|Katana  
|style="background:#efefef;"|8
|style="background:#efefef;"|
|style="background:#efefef;"|339
! scope="row" style="background:#cfcfcf;"|
|style="background:#cfcfcf;"|Molotov Cocktails
|style="background:#cfcfcf;"|18
|style="background:#cfcfcf;"|1
|style="background:#cfcfcf;"|344
|-
|-
! scope="row" style="background:#efefef;"|
| [[Image:Saw.png]] || align="left" | Chainsaw || 9 || 341 || -
|style="background:#efefef;"|Chainsaw  
|style="background:#efefef;"|9
|style="background:#efefef;"|
|style="background:#efefef;"|341
! scope="row" style="background:#cfcfcf;"|
|style="background:#cfcfcf;"|Satchel Charges
|style="background:#cfcfcf;"|39
|style="background:#cfcfcf;"|1
|style="background:#cfcfcf;"|363
|-
|-
! scope="row" style="background:#cfcfcf;"| Slot 2: Handguns
! rowspan="3" | 2
|style="background:#cfcfcf;"|Pistol
! rowspan="3" | Handguns
|style="background:#cfcfcf;"|22
| [[Image:Colt45.png]] || align="left" | Colt 45 || 22 || 346 || 17 (34)
|style="background:#cfcfcf;"|17 (34)
| rowspan="3" | '''No'''<br/>''Replacing handgun resets slot 2 ammo''
|style="background:#cfcfcf;"|346
| rowspan="3" | Yes
! scope="row" style="background:#efefef;"| Slot 9: Special 1
|style="background:#efefef;"|Spraycan
|style="background:#efefef;"|41
|style="background:#efefef;"|500
|style="background:#efefef;"|365
|-
|-
! scope="row" style="background:#cfcfcf;"|
| [[Image:Silenced.png]] || align="left" | Silenced || 23 || 347 || 17
|style="background:#cfcfcf;"|Silenced Pistol
|style="background:#cfcfcf;"|23
|style="background:#cfcfcf;"|17
|style="background:#cfcfcf;"|347
! scope="row" style="background:#efefef;"|
|style="background:#efefef;"|Fire Extinguisher
|style="background:#efefef;"|42
|style="background:#efefef;"|500
|style="background:#efefef;"|366
|-
|-
! scope="row" style="background:#cfcfcf;"|
| [[Image:Deagle.png]] || align="left" | Deagle || 24 || 348 || 7
|style="background:#cfcfcf;"|Desert Eagle
|style="background:#cfcfcf;"|24
|style="background:#cfcfcf;"|7
|style="background:#cfcfcf;"|348
! scope="row" style="background:#efefef;"|
|style="background:#efefef;"|Camera
|style="background:#efefef;"|43
|style="background:#efefef;"|36
|style="background:#efefef;"|367
|-
|-
! scope="row" style="background:#efefef;"| Slot 3: Shotguns
! rowspan="3" | 3
|style="background:#efefef;"|Shotgun
! rowspan="3" | Shotguns
|style="background:#efefef;"|25
| [[Image:Shotgun.png]] || align="left" | Shotgun || 25 || 349 || 1
|style="background:#efefef;"|1
| rowspan="3" | Yes
|style="background:#efefef;"|349
| rowspan="3" | Yes
! scope="row" style="background:#cfcfcf;"| Slot 10: Gifts/Other
|style="background:#cfcfcf;"|Long Purple Dildo
|style="background:#cfcfcf;"|10
|style="background:#cfcfcf;"|
|style="background:#cfcfcf;"|321
|-
|-
! scope="row" style="background:#efefef;"|
| [[Image:Sawnoff.png]] || align="left" | Sawed-off || 26 || 350 || 2 (4)
|style="background:#efefef;"|Sawn-Off Shotgun
|style="background:#efefef;"|26
|style="background:#efefef;"|2 (4)
|style="background:#efefef;"|350
! scope="row" style="background:#cfcfcf;"|
|style="background:#cfcfcf;"|Short tan Dildo
|style="background:#cfcfcf;"|11
|style="background:#cfcfcf;"|
|style="background:#cfcfcf;"|322
|-
|-
! scope="row" style="background:#efefef;"|
| [[Image:Spas12.png]] || align="left" | Combat Shotgun || 27 || 351 || 7
|style="background:#efefef;"|SPAZ-12 Combat Shotgun
|style="background:#efefef;"|27
|style="background:#efefef;"|7
|style="background:#efefef;"|351
! scope="row" style="background:#cfcfcf;"|
|style="background:#cfcfcf;"|Vibrator
|style="background:#cfcfcf;"|12
|style="background:#cfcfcf;"|
|style="background:#cfcfcf;"|323
|-
|-
! scope="row" style="background:#cfcfcf;"| Slot 4: Sub-Machine Guns
! rowspan="3" | 4
|style="background:#cfcfcf;"|Uzi
! rowspan="3" | Sub-Machine Guns
|style="background:#cfcfcf;"|28
| [[Image:Mac10.png]] || align="left" | Uzi || 28 || 352 || 50 (100)
|style="background:#cfcfcf;"|50 (100)
| rowspan="3" | Yes
|style="background:#cfcfcf;"|352
| rowspan="3" | Yes
! scope="row" style="background:#cfcfcf;"|
|style="background:#cfcfcf;"|Flowers
|style="background:#cfcfcf;"|14
|style="background:#cfcfcf;"|
|style="background:#cfcfcf;"|325
|-
|-
! scope="row" style="background:#cfcfcf;"|
| [[Image:Mp5.png]] || align="left" | MP5 || 29 || 353 || 30
|style="background:#cfcfcf;"|MP5
|style="background:#cfcfcf;"|29
|style="background:#cfcfcf;"|30
|style="background:#cfcfcf;"|353
! scope="row" style="background:#cfcfcf;"|
|style="background:#cfcfcf;"|Cane
|style="background:#cfcfcf;"|15
|style="background:#cfcfcf;"|
|style="background:#cfcfcf;"|326
|-
|-
! scope="row" style="background:#cfcfcf;"|
| [[Image:Tec9.png]] || align="left" | Tec-9 || 32 || 372 || 50 (100)
|style="background:#cfcfcf;"|TEC-9
|style="background:#cfcfcf;"|32
|style="background:#cfcfcf;"|50 (100)
|style="background:#cfcfcf;"|372
! scope="row" style="background:#efefef;"| Slot 11: Special 2
|style="background:#efefef;"|Night-Vision Goggles
|style="background:#efefef;"|44
|style="background:#efefef;"|
|style="background:#efefef;"|368
|-
|-
! scope="row" style="background:#efefef;"| Slot 5: Assault Rifles
! rowspan="2" | 5
|style="background:#efefef;"|AK-47
! rowspan="2" | Assault Rifles
|style="background:#efefef;"|30
| [[Image:Ak47.png]] || align="left" | AK-47 || 30 || 355 || 30
|style="background:#efefef;"|30
| rowspan="2" | Yes
|style="background:#efefef;"|355
| rowspan="2" | Yes
! scope="row" style="background:#efefef;"|
|style="background:#efefef;"|Infrared Goggles
|style="background:#efefef;"|45
|style="background:#efefef;"|
|style="background:#efefef;"|369
|-
|-
! scope="row" style="background:#efefef;"|
| [[Image:M4.png]] || align="left" | M4 || 31 || 356 || 50
|style="background:#efefef;"|M4
|style="background:#efefef;"|31
|style="background:#efefef;"|50
|style="background:#efefef;"|356
! scope="row" style="background:#efefef;"|
|style="background:#efefef;"|Parachute
|style="background:#efefef;"|46
|style="background:#efefef;"|
|style="background:#efefef;"|371
|-
|-
! scope="row" colspan="5" style="background:#efefef;"|
! rowspan="2" | 6
! scope="row" style="background:#cfcfcf;"| Slot 12: Satchel Detonator
! rowspan="2" | Rifles
|style="background:#cfcfcf;"|Satchel Detonator
| [[Image:Rifle.png]] || align="left" | Rifle || 33 || 357 || 1
|style="background:#cfcfcf;"|40
| rowspan="2" | '''No'''<br/>''Replacing rifle resets slot 6 ammo''
|style="background:#cfcfcf;"|
| rowspan="2" | Yes
|style="background:#cfcfcf;"|364
|-
| [[Image:Sniper.png]] || align="left" | Sniper || 34 || 358 || 1
|-
! rowspan="4" | 7
! rowspan="4" | Heavy Weapons
| [[Image:Rocketla.png]] || align="left" | Rocket Launcher || 35 || 359 || 1
| rowspan="4" | '''No'''<br/>''Replacing heavy weapon resets slot 7 ammo''
| rowspan="4" | No
|-
| [[Image:Heatseek.png]] || align="left" | Rocket Launcher HS || 36 || 360 || 1
|-
| [[Image:Flame.png]] || align="left" | Flamethrower || 37 || 361 || 50
|-
| [[Image:Minigun.png]] || align="left" | Minigun || 38 || 362 || 500
|-
! rowspan="4" | 8
! rowspan="4" | Projectiles
| [[Image:Grenade.png]] || align="left" | Grenade || 16 || 342 || 1
| rowspan="4" | '''No'''<br/>''Replacing projectile resets slot 8 ammo''
| rowspan="4" | No
|-
| [[Image:Teargas.png]] || align="left" | Teargas || 17 || 343 || 1
|-
| [[Image:Molotov.png]] || align="left" | Molotov || 18 || 344 || 1
|-
| [[Image:Satchel.png]] || align="left" | Satchel || 39 || 363 || 1
|-
! rowspan="3" | 9
! rowspan="3" | Special 1
| [[Image:Spraycan.png]] || align="left" | Spraycan || 41 || 365 || 500
| rowspan="3" | '''No'''<br/>''Replacing slot 9 weapon resets slot 9 ammo''
| rowspan="3" | No
|-
| [[Image:Fire_ex.png]] || align="left" | Fire Extinguisher || 42 || 366 || 500
|-
| [[Image:Camera.png]] || align="left" | Camera || 43 || 367 || 36
|-
! rowspan="5" | 10
! rowspan="5" | Gifts
| [[Image:Dildo1.png]] || align="left" | Dildo || 10 || 321 || -
| rowspan="5" | -
| rowspan="5" | No
|-
| [[Image:Dildo2.png]] || align="left" | Dildo || 11 || 322 || -
|-
| [[Image:Vibe1.png]] || align="left" | Vibrator || 12 || 323 || -
|-
| [[Image:Flowers.png]] || align="left" | Flower || 14 || 325 || -
|-
| [[Image:Cane.png]] || align="left" | Cane || 15 || 326 || -
|-
! rowspan="3" | 11
! rowspan="3" | Special 2
| [[Image:Irgoggle.png]] || align="left" | Nightvision || 44 || 368 || -
| rowspan="3" | -
| rowspan="3" | No
|-
| [[Image:Irgoggle.png]] || align="left" | Infrared || 45 || 369 || -
|-
| [[Image:Paracute.png]] || align="left" | Parachute || 46 || 371 || -
|-
! rowspan="1" | 12
! rowspan="1" | Satchel Detonator
| [[Image:Bomb.png]] || align="left" | Bomb || 40 || 364 || -
| rowspan="1" | -
| rowspan="1" | No
|}
|}
Lua table of all weapon IDs.
<syntaxhighlight lang="lua">
local weaponsID = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 22, 23, 24, 25, 26, 27, 28, 29, 32, 30, 31, 33, 34, 35, 36, 37, 38, 16, 17, 18, 39, 41, 42, 43, 10, 11, 12, 14, 15, 44, 45, 46, 40}
</syntaxhighlight>
Lua table of all weapon IDs grouped by slot.
<syntaxhighlight lang="lua">
local weaponsBySlot = {
[0] = {0, 1}, -- Hand
[1] = {2, 3, 4, 5, 6, 7, 8, 9}, -- Melee
[2] = {22, 23, 24}, -- Handguns
[3] = {25, 26, 27}, -- Shotguns
[4] = {28, 29, 32}, -- Sub-Machine Guns
[5] = {30, 31}, -- Assault Rifles
[6] = {33, 34}, -- Rifles
[7] = {35, 36, 37, 38}, -- Heavy Weapons
[8] = {16, 17, 18, 39}, -- Projectiles
[9] = {41, 42, 43}, -- Special 1
[10] = {10, 11, 12, 14, 15}, -- Gifts
[11] = {44, 45, 46}, -- Special 2
[12] = {40}, -- Satchel Detonator
}
</syntaxhighlight>
==Functions==
{{Weapon functions|server}}== See Also ==
* [[Id|Ids]]


[[Category:ID Lists]]
[[Category:ID Lists]]
[[hu:Weapons]]
[[it:Armi]]
[[ru:Weapons]]
[[de:Waffen]]
[[pl:Weapons]]

Latest revision as of 21:00, 17 November 2024

Scripting functions that ask for a weapon ID need an integer that refers to the GTASA weapon ID list. They are listed below.

[[{{{image}}}|link=|]] Note:
  • Clip size () denotes clip size when the weapon is dual wielded. Weapons without this specification are not dual wield weapons.
  • GTASA weapon stats will affect movement, accuracy, damage, and dual wield capability. See setPedStat to change these stats. The default MTA server package comes with a resource called "defaultStats" that sets GTASA weapon stats to 999. See the weapon stats link for more info.
  • For death reasons, especially in event handlers for onPlayerWasted or similar, also have a look at the Damage Types.
  • Name is compatible with functions getWeaponNameFromID, getWeaponIDFromName.
  • Bullet Sync refers to whether they are triggered by the OnPlayerWeaponFire event.
Slot Type Image Name ID Model ID Clip Sharing slot ammo Bullet Sync
0 Hand Fist.png Fist 0 - - - No
Knuckle.png Brassknuckle 1 331 -
1 Melee Golfclub.png Golfclub 2 333 - - No
Nitestik.png Nightstick 3 334 -
Knife.png Knife 4 335 -
Bat.png Bat 5 336 -
Shovel.png Shovel 6 337 -
Poolcue.png Poolstick 7 338 -
Katana.png Katana 8 339 -
Saw.png Chainsaw 9 341 -
2 Handguns Colt45.png Colt 45 22 346 17 (34) No
Replacing handgun resets slot 2 ammo
Yes
Silenced.png Silenced 23 347 17
Deagle.png Deagle 24 348 7
3 Shotguns Shotgun.png Shotgun 25 349 1 Yes Yes
Sawnoff.png Sawed-off 26 350 2 (4)
Spas12.png Combat Shotgun 27 351 7
4 Sub-Machine Guns Mac10.png Uzi 28 352 50 (100) Yes Yes
Mp5.png MP5 29 353 30
Tec9.png Tec-9 32 372 50 (100)
5 Assault Rifles Ak47.png AK-47 30 355 30 Yes Yes
M4.png M4 31 356 50
6 Rifles Rifle.png Rifle 33 357 1 No
Replacing rifle resets slot 6 ammo
Yes
Sniper.png Sniper 34 358 1
7 Heavy Weapons Rocketla.png Rocket Launcher 35 359 1 No
Replacing heavy weapon resets slot 7 ammo
No
Heatseek.png Rocket Launcher HS 36 360 1
Flame.png Flamethrower 37 361 50
Minigun.png Minigun 38 362 500
8 Projectiles Grenade.png Grenade 16 342 1 No
Replacing projectile resets slot 8 ammo
No
Teargas.png Teargas 17 343 1
Molotov.png Molotov 18 344 1
Satchel.png Satchel 39 363 1
9 Special 1 Spraycan.png Spraycan 41 365 500 No
Replacing slot 9 weapon resets slot 9 ammo
No
Fire ex.png Fire Extinguisher 42 366 500
Camera.png Camera 43 367 36
10 Gifts Dildo1.png Dildo 10 321 - - No
Dildo2.png Dildo 11 322 -
Vibe1.png Vibrator 12 323 -
Flowers.png Flower 14 325 -
Cane.png Cane 15 326 -
11 Special 2 Irgoggle.png Nightvision 44 368 - - No
Irgoggle.png Infrared 45 369 -
Paracute.png Parachute 46 371 -
12 Satchel Detonator Bomb.png Bomb 40 364 - - No

Lua table of all weapon IDs.

local weaponsID = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 22, 23, 24, 25, 26, 27, 28, 29, 32, 30, 31, 33, 34, 35, 36, 37, 38, 16, 17, 18, 39, 41, 42, 43, 10, 11, 12, 14, 15, 44, 45, 46, 40}

Lua table of all weapon IDs grouped by slot.

local weaponsBySlot = {
	[0] = {0, 1}, -- Hand
	[1] = {2, 3, 4, 5, 6, 7, 8, 9},	-- Melee
	[2] = {22, 23, 24}, -- Handguns
	[3] = {25, 26, 27}, -- Shotguns
	[4] = {28, 29, 32}, -- Sub-Machine Guns
	[5] = {30, 31}, -- Assault Rifles
	[6] = {33, 34}, -- Rifles
	[7] = {35, 36, 37, 38}, -- Heavy Weapons
	[8] = {16, 17, 18, 39}, -- Projectiles
	[9] = {41, 42, 43}, -- Special 1
	[10] = {10, 11, 12, 14, 15}, -- Gifts
	[11] = {44, 45, 46}, -- Special 2
	[12] = {40}, -- Satchel Detonator
}

Functions


See Also