natives.getHashKey
Jump to navigation
Jump to search
Function Client Only ![]()
Online and Offline
Available since Client 1.0.0
int natives.getHashKey(string name)
The natives.getHashKey function is used to Returns the hash key of a given string, typically used for models, animations, or other resources.
Parameters
| 1) | string | name | The model or resource name to convert into a hash key ("M_Y_COP"). |
Return
| int | The hash key corresponding to the given string. |
Notes
- - Commonly used before natives.requestModel to obtain the model hash- Works with ped names, vehicle names, and other resource identifiers.
Examples
Example 1 - JavaScript:
const hash = natives.getHashKey("M_Y_COP"); natives.requestModel(hash); if (natives.hasModelLoaded(hash)) {
const ped = natives.createChar(1, hash, localPlayer.position, true);
}
Compatibility
There isn't any compatibility information for this function.
Related
Client Related
bindKey
isKeyDown
isScancodePressed
unbindAllKeys
unbindKey