ArmaDragonflyClient - Set Key

Set Key

Description

Stores 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 dragonfly_db_fnc_set

Parameters

ParameterTypeDescriptionDefault
_keyStringName of the key to store the data under""
_dataArray, String, Number, or BooleanThe value to store in the database

Return Value

None. The operation runs asynchronously.

Examples

Store a simple array:

["playerInventory", ["item1", "item2", "item3"]] call dragonfly_db_fnc_set;

Store player data under their UID:

[getPlayerUID player, [name player, getPos player, getAllGear player]] call dragonfly_db_fnc_set;

Call the set function remotely from a client:

["serverSetting", [true, 30, "normal"]] remoteExecCall ["dragonfly_db_fnc_set", 2, false];

Notes

  • The function validates both the key and data before attempting to store
  • If the key already exists, its value will be overwritten
  • Complex data structures should be serialized into arrays
  • There are no size limits for data, but extremely large values might impact performance
  • For structured data, consider using hash tables instead of key-value pairs

Delete Key | Get Key | Set Key