Difference between revisions of "MDE Scripting: GetItemIDFromName"
From Nomad DB
(Created page with "{{Page_MDE}} {| class="wikitable" !Syntax |<syntaxhighlight lang="lua">game.game:GetItemIDFromName(string itemName)</syntaxhighlight> |- !Module |MDE Scripting: Game Library...") |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | |||
{| class="wikitable" | {| class="wikitable" | ||
!Syntax | !Syntax | ||
Line 47: | Line 46: | ||
==Examples== | ==Examples== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
− | local weaponID = game.game:GetItemIDFromName("smg_trench_a_v1") -- | + | local weaponID = game.game:GetItemIDFromName("smg_trench_a_v1") -- returns 84 |
</syntaxhighlight> | </syntaxhighlight> | ||
+ | |||
+ | ==Related Pages== | ||
+ | [[MDE Scripting: GetWeaponNameFromID|GetWeaponNameFromID]] | ||
+ | {{Page_MDE}} | ||
__NOTOC__ | __NOTOC__ | ||
+ | |||
[[Category:MDE]] | [[Category:MDE]] |
Latest revision as of 19:20, 10 November 2020
Syntax | game.game:GetItemIDFromName(string itemName)
|
---|---|
Module | Game |
Library | Game |
Game | Mafia: Definitive Edition |
Description
Returns the item ID.
For weapon item, see Weapons to know weapons name.
Parameters
Name | Type | Description |
---|---|---|
itemName | string |
Returns
# | Type | Description |
---|---|---|
1 | number | Item ID |
Examples
local weaponID = game.game:GetItemIDFromName("smg_trench_a_v1") -- returns 84