Weapons: Difference between revisions
Jump to navigation
Jump to search
(Added Fist.png) |
No edit summary |
||
(12 intermediate revisions by 9 users not shown) | |||
Line 3: | Line 3: | ||
*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 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 [[ | *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]]. | *'''Name''' is compatible with functions [[getWeaponNameFromID]], [[getWeaponIDFromName]]. | ||
}} | }} | ||
Line 12: | Line 12: | ||
! rowspan="2" | 0 | ! rowspan="2" | 0 | ||
! rowspan="2" | Hand | ! rowspan="2" | Hand | ||
| [[Image:Fist.png]] || align="left" | Fist || 0 || || | | [[Image:Fist.png]] || align="left" | Fist || 0 || - || - | ||
| rowspan="2" | | | rowspan="2" | - | ||
|- | |- | ||
| [[Image:Knuckle.png]] || align="left" | Brassknuckle || 1 || 331 || | | [[Image:Knuckle.png]] || align="left" | Brassknuckle || 1 || 331 || - | ||
|- | |- | ||
! rowspan="8" | 1 | ! rowspan="8" | 1 | ||
! rowspan="8" | Melee | ! rowspan="8" | Melee | ||
| [[Image:Golfclub.png]] || align="left" | Golfclub || 2 || 333 || | | [[Image:Golfclub.png]] || align="left" | Golfclub || 2 || 333 || - | ||
| rowspan="8" | | | rowspan="8" | - | ||
|- | |- | ||
| [[Image:Nitestik.png]] || align="left" | Nightstick || 3 || 334 || | | [[Image:Nitestik.png]] || align="left" | Nightstick || 3 || 334 || - | ||
|- | |- | ||
| [[Image:Knife.png]] || align="left" | Knife || 4 || 335 || | | [[Image:Knife.png]] || align="left" | Knife || 4 || 335 || - | ||
|- | |- | ||
| [[Image:Bat.png]] || align="left" | Bat || 5 || 336 || | | [[Image:Bat.png]] || align="left" | Bat || 5 || 336 || - | ||
|- | |- | ||
| [[Image:Shovel.png]] || align="left" | Shovel || 6 || 337 || | | [[Image:Shovel.png]] || align="left" | Shovel || 6 || 337 || - | ||
|- | |- | ||
| [[Image:Poolcue.png]] || align="left" | Poolstick || 7 || 338 || | | [[Image:Poolcue.png]] || align="left" | Poolstick || 7 || 338 || - | ||
|- | |- | ||
| [[Image:Katana.png]] || align="left" | Katana || 8 || 339 || | | [[Image:Katana.png]] || align="left" | Katana || 8 || 339 || - | ||
|- | |- | ||
| [[Image:Saw.png]] || align="left" | Chainsaw || 9 || 341 || | | [[Image:Saw.png]] || align="left" | Chainsaw || 9 || 341 || - | ||
|- | |- | ||
! rowspan="3" | 2 | ! rowspan="3" | 2 | ||
Line 110: | Line 110: | ||
! rowspan="5" | 10 | ! rowspan="5" | 10 | ||
! rowspan="5" | Gifts | ! rowspan="5" | Gifts | ||
| [[Image:Dildo1.png]] || align="left" | Dildo || 10 || 321 || | | [[Image:Dildo1.png]] || align="left" | Dildo || 10 || 321 || - | ||
| rowspan="5" | | | rowspan="5" | - | ||
|- | |- | ||
| [[Image:Dildo2.png]] || align="left" | Dildo || 11 || 322 || | | [[Image:Dildo2.png]] || align="left" | Dildo || 11 || 322 || - | ||
|- | |- | ||
| [[Image:Vibe1.png]] || align="left" | Vibrator || 12 || 323 || | | [[Image:Vibe1.png]] || align="left" | Vibrator || 12 || 323 || - | ||
|- | |- | ||
| [[Image:Flowers.png]] || align="left" | Flower || 14 || 325 || | | [[Image:Flowers.png]] || align="left" | Flower || 14 || 325 || - | ||
|- | |- | ||
| [[Image:Cane.png]] || align="left" | Cane || 15 || 326 || | | [[Image:Cane.png]] || align="left" | Cane || 15 || 326 || - | ||
|- | |- | ||
! rowspan="3" | 11 | ! rowspan="3" | 11 | ||
! rowspan="3" | Special 2 | ! rowspan="3" | Special 2 | ||
| [[Image:Irgoggle.png]] || align="left" | Nightvision || 44 || 368 || | | [[Image:Irgoggle.png]] || align="left" | Nightvision || 44 || 368 || - | ||
| rowspan="3" | | | rowspan="3" | - | ||
|- | |- | ||
| [[Image:Irgoggle.png]] || align="left" | Infrared || 45 || 369 || | | [[Image:Irgoggle.png]] || align="left" | Infrared || 45 || 369 || - | ||
|- | |- | ||
| [[Image:Paracute.png]] || align="left" | Parachute || 46 || 371 || | | [[Image:Paracute.png]] || align="left" | Parachute || 46 || 371 || - | ||
|- | |- | ||
! rowspan="1" | 12 | ! rowspan="1" | 12 | ||
! rowspan="1" | Satchel Detonator | ! rowspan="1" | Satchel Detonator | ||
| [[Image:Bomb.png]] || align="left" | Bomb || 40 || 364 || | | [[Image:Bomb.png]] || align="left" | Bomb || 40 || 364 || - | ||
| rowspan="1" | | | rowspan="1" | - | ||
|} | |} | ||
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> | |||
==Client Functions== | ==Client Functions== | ||
{{Client_weapon_functions}} | {{Client_weapon_functions}}==Server Function== | ||
==Server Function== | {{Weapon functions}}== See Also == | ||
{{Weapon functions}} | * [[Id|Ids]] | ||
[[Category:ID Lists]] | [[Category:ID Lists]] | ||
[[hu:Weapons]] | |||
[[it:Armi]] | [[it:Armi]] | ||
[[ru:Weapons]] | [[ru:Weapons]] | ||
[[de:Waffen]] | [[de:Waffen]] | ||
[[pl:Weapons]] | [[pl:Weapons]] |
Latest revision as of 11:07, 1 February 2024
Scripting functions that ask for a weapon ID need an integer that refers to the GTASA weapon ID list. They are listed below.
Note:
|
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 }
Client Functions
Shared
- getWeaponProperty
- getPickupWeapon
- getOriginalWeaponProperty
- getSlotFromWeapon
- getWeaponIDFromName
- getWeaponNameFromID
- setWeaponAmmo
- setWeaponProperty
Server Function
Shared
- getWeaponProperty
- getPickupWeapon
- getOriginalWeaponProperty
- getSlotFromWeapon
- getWeaponIDFromName
- getWeaponNameFromID
- setWeaponAmmo
- setWeaponProperty