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 stringValue)</syntaxhighlight>
+
|<syntaxhighlight lang="lua">game.game:ToHashName(string name)</syntaxhighlight>
 
|-
 
|-
 
!Module
 
!Module
Line 15: Line 15:
  
 
==Description==
 
==Description==
Returns the hash name of a string.
+
Convert a name in hash.
  
  
Line 25: Line 25:
 
!Description
 
!Description
 
|-
 
|-
|stringValue
+
|name
 
|string
 
|string
|The string you want to convert to a hash name.
+
|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 hash name converted. You can use the value directly or manipulate [[MDE Scripting: C_HashName|C_HashName]].
+
|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 hashName = game.game:ToHashName("district_01_chinatown") -- hashName returns the hash name of "district_01_chinatown"
+
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 hashName = tohashname("district_01_chinatown") -- hashName returns the hash name of "district_01_chinatown"
+
local hash = tohashname("district_01_chinatown") -- returns the hash of "district_01_chinatown" (15590509413988131779)
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
<syntaxhighlight lang="lua">
 
<syntaxhighlight lang="lua">
local hashName = string.tohash("district_01_chinatown") -- hashName returns the hash name of "district_01_chinatown"
+
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)