Hash Set ID
Description
Sets the value of a specified field in a specific hash table identified by its key. This function allows storing various data types (arrays, strings, numbers, or booleans) in a targeted hash table, making it ideal for player-specific or entity-specific data storage. It provides a way to organize related data under a common identifier.
Syntax
[_key, _keyField, _data] call dragonfly_db_fnc_hashSetId
Parameters
Parameter | Type | Description | Default |
---|---|---|---|
_key | String | Identifier of the hash table | "" |
_keyField | String | Name of the field in the hash to set | "" |
_data | Array, String, Number, or Boolean | The value to store in the hash field |
Return Value
None. The operation runs synchronously to store the data.
Examples
Store a player's loadout under their UID:
[getPlayerUID player, "loadout", [getUnitLoadout player]] call dragonfly_db_fnc_hashSetId;
Store vehicle data:
["vehicle_123", "status", [true, 100, 75, "active"]] call dragonfly_db_fnc_hashSetId;
Store player data from a client:
[getPlayerUID player, "stats", [rank player, score player, name player]] remoteExecCall ["dragonfly_db_fnc_hashSetId", 2, false];
Notes
- Stores a single field-value pair in a specific hash table identified by
_key
- All three parameters (
_key
,_keyField
, and_data
) are required and validated - If the hash table doesn't exist, it will be created automatically
- If the field already exists in the hash table, its value will be overwritten
- Supports various data types: arrays, strings, numbers, and booleans
- Player UIDs are commonly used as keys to store player-specific data
- Complex data structures should be serialized into arrays
- The operation is executed immediately and synchronously
- All operations are logged for debugging purposes
Links
Hash Get | Hash Get ID | Hash Get All | Hash Get All ID | Hash Set | Hash Set ID | Hash Set Bulk | Hash Set Bulk ID