Weapons: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 149: | Line 149: | ||
| rowspan="1" | No | | rowspan="1" | No | ||
|} | |} | ||
Lua | Lua tables with weapons: | ||
<syntaxhighlight lang="lua"> | <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} | 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} | ||
local weaponsBySlot = { | local weaponsBySlot = { | ||
[0] = {0, 1}, -- | [0] = {0, 1}, -- hand | ||
[1] = {2, 3, 4, 5, 6, 7, 8, 9}, -- | [1] = {2, 3, 4, 5, 6, 7, 8, 9}, -- melee | ||
[2] = {22, 23, 24}, -- | [2] = {22, 23, 24}, -- handguns | ||
[3] = {25, 26, 27}, -- | [3] = {25, 26, 27}, -- shotguns | ||
[4] = {28, 29, 32}, -- | [4] = {28, 29, 32}, -- sub-machine guns | ||
[5] = {30, 31}, -- | [5] = {30, 31}, -- assault rifles | ||
[6] = {33, 34}, -- | [6] = {33, 34}, -- rifles | ||
[7] = {35, 36, 37, 38}, -- | [7] = {35, 36, 37, 38}, -- heavy weapons | ||
[8] = {16, 17, 18, 39}, -- | [8] = {16, 17, 18, 39}, -- projectiles | ||
[9] = {41, 42, 43}, -- | [9] = {41, 42, 43}, -- special 1 | ||
[10] = {10, 11, 12, 14, 15}, -- | [10] = {10, 11, 12, 14, 15}, -- gifts | ||
[11] = {44, 45, 46}, -- | [11] = {44, 45, 46}, -- special 2 | ||
[12] = {40}, -- | [12] = {40}, -- satchel detonator | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 19:51, 11 May 2025
Scripting functions that ask for a weapon ID need an integer that refers to the GTASA weapon ID list. They are listed below.
Lua tables with weapons:
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}
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
- giveWeapon
- takeAllWeapons
- takeWeapon
- Shared
- getWeaponProperty
- getPickupWeapon
- getOriginalWeaponProperty
- getSlotFromWeapon
- getWeaponIDFromName
- getWeaponNameFromID
- setWeaponAmmo
- setWeaponProperty