ramdb/docs/hash/hashGetId.md
Jacob Schmidt 8c0e8144e5 docs: Update documentation links and function references
This commit updates the documentation to reflect the current function names and link structure. Specifically, it addresses the following:

*   Corrected internal links within the documentation to point to the correct markdown files (e.g., `hashDelete.md` instead of `hashDelete`).
*   Updated related function references to reflect the current function names and include missing functions.
*   Removed outdated function references.
*   Added `ramdb_db_fnc_scheduler` to related functions where appropriate.
*   Updated the links section to use the correct markdown file names.
2025-03-22 16:53:30 -05:00

76 lines
3.3 KiB
Markdown

---
title: ArmaRAMDb - Hash Get ID
icon: mdi:file-text-outline
excerpt: Get the value associated with field in hash stored at key from RAMDb.
---
# ramdb_db_fnc_hashGetId
## Description
Retrieves the value of a specific field from a hash table identified by its key. This function allows targeted access to individual fields within a specific hash table, making it ideal for accessing particular attributes of player or entity data. The retrieved data is returned through a callback function.
## Syntax
```sqf
[_key, _keyField, _function, _call, _netId] call ramdb_db_fnc_hashGetId
```
## Parameters
| Parameter | Type | Description | Default |
|-------------|---------|------------------------------------------------------------|---------|
| `_key` | String | Identifier of the hash table | "" |
| `_keyField` | String | Name of the field in the hash to retrieve | "" |
| `_function` | String | Name of the function to receive the retrieved data | "" |
| `_call` | Boolean | Whether to call the function directly (true) or spawn (false) | false |
| `_netId` | String | (Optional) NetID of the player to receive the data | "" |
## Return Value
None. The retrieved data is passed to the specified callback function asynchronously.
## Examples
### Retrieve a player's loadout field:
```sqf
[getPlayerUID player, "loadout", "ramdb_db_fnc_test"] call ramdb_db_fnc_hashGetId;
```
### Retrieve a specific vehicle property with synchronous callback:
```sqf
["vehicle_123", "fuel", "ramdb_db_fnc_processFuelData", true] call ramdb_db_fnc_hashGetId;
```
### Retrieve data and send it to a specific client:
```sqf
[getPlayerUID player, "stats", "ramdb_db_fnc_test", false, netId player] remoteExecCall ["ramdb_db_fnc_hashGetId", 2, false];
```
## Notes
- Retrieves a single field value from a specific hash table
- All three primary parameters (key, keyField, and function) are required and validated
- 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)
- This function targets both a specific hash table (`_key`) and a specific field (`_keyField`)
- More efficient than retrieving all hash fields when only one is needed
- Player UIDs are commonly used as keys to store player-specific data
- All operations are logged for debugging purposes
## Related Functions
- `ramdb_db_fnc_hashGet`: Retrieves a field value from the global hash table
- `ramdb_db_fnc_hashGetAllId`: Retrieves all fields from a specific hash table
- `ramdb_db_fnc_hashGetAll`: Retrieves all fields from the global hash table
- `ramdb_db_fnc_hashSetId`: Sets a field value in a specific hash table
- `ramdb_db_fnc_scheduler`: Processes the callback from the database extension
## Links
[Hash Delete](hashDelete.md) |
[Hash Delete ID](hashDeleteId.md) |
[Hash Get](hashGet.md) |
[Hash Get All](hashGetAll.md) |
[Hash Get All ID](hashGetAllId.md) |
[Hash Get ID](hashGetId.md) |
[Hash Remove](hashRemove.md) |
[Hash Remove ID](hashRemoveId.md) |
[Hash Set](hashSet.md) |
[Hash Set Bulk](hashSetBulk.md) |
[Hash Set ID](hashSetId.md) |
[Hash Set ID Bulk](hashSetIdBulk.md)