setsetautotoc_md67title: ArmaRAMDb - Set Key icon: mdi:file-text-outline excerpt: Set the value of stored key from RAMDb.ramdb_db_fnc_setDescriptionStores a value in the database with the specified key. This function allows saving various data types (arrays, strings, numbers, or booleans) that can be retrieved later using the key.Syntax[_key, _data] call ramdb_db_fnc_set
ParametersParameter Type Description Default _keyString Name of the key to store the data under "" _dataArray, String, Number, or Boolean The value to store in the database [] Return ValueNone. The operation runs asynchronously.ExamplesStore a simple array:["playerInventory", ["item1", "item2", "item3"]] call ramdb_db_fnc_set;
Store player data under their UID:[getPlayerUID player, [name player, getPos player, getAllGear player]] call ramdb_db_fnc_set;
Call the set function remotely from a client:["serverSetting", [true, 30, "normal"]] remoteExecCall ["ramdb_db_fnc_set", 2, false];
NotesThe function validates both the key and data before attempting to storeIf the key already exists, its value will be overwrittenComplex data structures should be serialized into arraysThere are no size limits for data, but extremely large values might impact performanceFor structured data, consider using hash tables instead of key-value pairsRelated Functionsramdb_db_fnc_get: Retrieves a value by keyramdb_db_fnc_delete: Removes a value by keyramdb_db_fnc_scheduler: Processes the callback responseLinksDelete Key | Get Key | Set Key