hashSethashSetautotoc_md287title: ArmaRAMDb - Hash Set icon: mdi:file-text-outline excerpt: Set a field value in the current client's hash table in RAMDb.ramdb_db_fnc_hashSetDescriptionSets the value of a specified field in the hash table associated with the current client/player. This function automatically determines the appropriate hash ID based on the caller's identity, making it more convenient than hashSetId which requires manually specifying an ID. It allows storing various data types (arrays, strings, numbers, or booleans) in a field of the client-specific hash structure.Syntax[_keyField, _data] call ramdb_db_fnc_hashSet
ParametersParameter Type Description Default _keyFieldString Name of the field in the hash to set "" _dataArray, String, Number, or Boolean The value to store in the hash field [] Return ValueNone. The operation runs synchronously to store the data.ExamplesStore a player's loadout:["loadout", [getUnitLoadout player]] call ramdb_db_fnc_hashSet;
Store player preferences:["settings", [true, 30, "normal"]] call ramdb_db_fnc_hashSet;
Store data from a client:["clientInfo", [name player, getPlayerUID player]] remoteExecCall ["ramdb_db_fnc_hashSet", 2, false];
NotesStores a single field-value pair in the current client's hash tableBoth the field name and data parameters are required and validatedIf the field already exists, its value will be overwrittenSupports various data types: arrays, strings, numbers, and booleansThis function automatically determines which hash table to use based on the caller's identityUse hashSetId when you need to specify a particular hash table by IDComplex data structures should be serialized into arraysThe operation is executed immediately and synchronouslyAll operations are logged for debugging purposesRelated Functionsramdb_db_fnc_hashSetId: Sets a field value in a specific hash table (when you need to specify the ID)ramdb_db_fnc_hashGet: Retrieves a field value from the current client's hash tableramdb_db_fnc_hashGetAll: Retrieves all fields from the current client's hash tableramdb_db_fnc_hashSetBulk: Sets multiple fields in the current client's hash tableramdb_db_fnc_hashDelete: Removes the current client's hash tableLinksHash Delete | Hash Delete ID | Hash Get | Hash Get All | Hash Get All ID | Hash Get ID | Hash Remove | Hash Remove ID | Hash Set | Hash Set Bulk | Hash Set ID | Hash Set ID Bulk