Difference between revisions of "MDE Scripting: ToHashName"
From Nomad DB
(Created page with "{| class="wikitable" !Syntax |<syntaxhighlight lang="lua">game.game:ToHashName(string stringValue)</syntaxhighlight> |- !Module |Game |- !...") |
|||
(2 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
+ | {{Page_MDE}} | ||
{| 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 16: | ||
==Description== | ==Description== | ||
− | + | Convert a name in hash. | |
Line 25: | Line 26: | ||
!Description | !Description | ||
|- | |- | ||
− | | | + | |name |
|string | |string | ||
− | |The | + | |The name you want to convert in hash. |
|} | |} | ||
Line 37: | Line 38: | ||
!Description | !Description | ||
|- | |- | ||
− | |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 46: | ||
==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 52: | ||
==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> | ||
Latest revision as of 20:25, 27 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)