Weapons: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
No edit summary |
||
Line 137: | Line 137: | ||
Lua table of all weapon IDs | Lua table of all weapon IDs | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
local weapons = { 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} | local weapons = {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> | </syntaxhighlight> | ||
Lua table of all weapon IDs grouped by slot | Lua table of all weapon IDs grouped by slot |
Revision as of 03:45, 3 August 2023
Scripting functions that ask for a weapon ID need an integer that refers to the GTASA weapon ID list. They are listed below.
Lua table of all weapon IDs
local weapons = {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 weapons = { [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
- getWeaponProperty
- getPickupWeapon
- getOriginalWeaponProperty
- getSlotFromWeapon
- getWeaponIDFromName
- getWeaponNameFromID
- setWeaponAmmo
- setWeaponProperty