Difference between revisions of "MDE Scripting: ToHashName"
From Nomad DB
Line 1: | Line 1: | ||
{| class="wikitable" | {| class="wikitable" | ||
!Syntax | !Syntax | ||
− | |<syntaxhighlight lang="lua">game.game:ToHashName(string | + | |<syntaxhighlight lang="lua">game.game:ToHashName(string name)</syntaxhighlight> |
|- | |- | ||
!Module | !Module | ||
Line 15: | Line 15: | ||
==Description== | ==Description== | ||
− | + | Convert a name in hash. | |
Line 25: | Line 25: | ||
!Description | !Description | ||
|- | |- | ||
− | | | + | |name |
|string | |string | ||
− | |The | + | |The name you want to convert in hash. |
|} | |} | ||
Line 39: | Line 39: | ||
| style="font-weight: bold; text-align:center;" | 1 | | style="font-weight: bold; text-align:center;" | 1 | ||
|[[MDE Scripting: C_HashName|C_HashName]] | |[[MDE Scripting: C_HashName|C_HashName]] | ||
− | |The | + | |The name converted in hash. You can use the value directly or manipulate [[MDE Scripting: C_HashName|C_HashName]]. |
|} | |} | ||
Line 45: | Line 45: | ||
==Examples== | ==Examples== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
− | local | + | local hash = game.game:ToHashName("district_01_chinatown") -- returns the hash of "district_01_chinatown" (15590509413988131779) |
</syntaxhighlight> | </syntaxhighlight> | ||
Line 51: | Line 51: | ||
==Aliases== | ==Aliases== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
− | local | + | local hash = tohashname("district_01_chinatown") -- returns the hash of "district_01_chinatown" (15590509413988131779) |
</syntaxhighlight> | </syntaxhighlight> | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
− | local | + | local hash = string.tohash("district_01_chinatown") -- returns the hash of "district_01_chinatown" (15590509413988131779) |
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 01:46, 21 October 2020
Syntax | game.game:ToHashName(string name)
|
---|---|
Module | Game |
Library | Game |
Game | Mafia: Definitive Edition |
Description
Convert a name in hash.
Parameters
Name | Type | Description |
---|---|---|
name | string | The name you want to convert in hash. |
Returns
# | Type | Description |
---|---|---|
1 | C_HashName | The name converted in hash. You can use the value directly or manipulate C_HashName. |
Examples
local hash = game.game:ToHashName("district_01_chinatown") -- returns the hash of "district_01_chinatown" (15590509413988131779)
Aliases
local hash = tohashname("district_01_chinatown") -- returns the hash of "district_01_chinatown" (15590509413988131779)
local hash = string.tohash("district_01_chinatown") -- returns the hash of "district_01_chinatown" (15590509413988131779)