ArmaDragonflyClient - List Get

List Get

Description

Retrieves a specific element from a list stored in the database by its index. This function accesses a single item from a list using its position number and returns the data through a callback function. It's useful for accessing individual pieces of data from a sequence without retrieving the entire list.

Syntax

[_key, _index, _function, _call, _netId] call dragonfly_db_fnc_listGet

Parameters

ParameterTypeDescriptionDefault
_keyStringName of the list""
_indexNumberIndex position of the element to retrieve (0-based)-1
_functionStringName of the function to receive the retrieved data""
_callBooleanWhether to call the function directly (true) or spawn (false)false
_netIdString(Optional) NetID of the player to receive the datanil

Return Value

None. The retrieved data is passed to the specified callback function asynchronously.

Examples

Retrieve a specific event log entry:

["events", 0, "dragonfly_db_fnc_test"] call dragonfly_db_fnc_listGet;

Retrieve data with synchronous callback:

["messages", 5, "dragonfly_db_fnc_processMessage", true] call dragonfly_db_fnc_listGet;

Retrieve data and send it to a specific client:

["notifications", 0, "dragonfly_db_fnc_displayNotification", false, netId player] remoteExecCall ["dragonfly_db_fnc_listGet", 2, false];

Notes

  • Retrieves a single element from a list by its index position
  • The _key, _index, and _function parameters are required and validated
  • Index is zero-based (the first element is at index 0)
  • If the index is out of bounds or the list doesn't exist, no data will be returned
  • The data is retrieved asynchronously through the extension's callback system
  • When a netId is provided, the data is sent to that specific client
  • The _call parameter determines whether the function is called directly (synchronous) or spawned (asynchronous)
  • For retrieving multiple elements, use listLoad instead
  • All operations are logged for debugging purposes

List Add | List Get | List Load | List Remove | List Set