<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<section xmlns="http://docbook.org/ns/docbook" version="5.0" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="_md_docs_2hash_2hash_get_id" xml:lang="en-US">
<title>hashGetId</title>
<indexterm><primary>hashGetId</primary></indexterm>
<section xml:id="_md_docs_2hash_2hash_get_id_1autotoc_md246">
<title>autotoc_md246</title>
<para>title: ArmaRAMDb - Hash Get ID icon: mdi:file-text-outline </para>
</section>
<section xml:id="_md_docs_2hash_2hash_get_id_1autotoc_md247">
<title>excerpt: Get the value associated with field in hash stored at key from RAMDb.</title></section>
<section xml:id="_md_docs_2hash_2hash_get_id_1autotoc_md248">
<title>ramdb_db_fnc_hashGetId</title><section xml:id="_md_docs_2hash_2hash_get_id_1autotoc_md249">
<title>Description</title>
<para>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.</para>
</section>
<section xml:id="_md_docs_2hash_2hash_get_id_1autotoc_md250">
<title>Syntax</title>
<para><literallayout><computeroutput>[_key,&#32;_keyField,&#32;_function,&#32;_call,&#32;_netId]&#32;call&#32;ramdb_db_fnc_hashGetId
</computeroutput></literallayout></para>
</section>
<section xml:id="_md_docs_2hash_2hash_get_id_1autotoc_md251">
<title>Parameters</title>
<para><informaltable frame="all">
    <tgroup cols="4" align="left" colsep="1" rowsep="1">
      <colspec colname='c1'/>
      <colspec colname='c2'/>
      <colspec colname='c3'/>
      <colspec colname='c4'/>
<thead>
      <row  class='markdownTableHead'>
<entry>
<para>Parameter   </para>
</entry><entry>
<para>Type   </para>
</entry><entry>
<para>Description   </para>
</entry><entry>
<para>Default    </para>
</entry></row>
</thead><tbody>
      <row  class='markdownTableRowOdd'>
<entry>
<para><computeroutput>_key</computeroutput>   </para>
</entry><entry>
<para>String   </para>
</entry><entry>
<para>Identifier of the hash table   </para>
</entry><entry>
<para>&quot;&quot;    </para>
</entry></row>
      <row  class='markdownTableRowEven'>
<entry>
<para><computeroutput>_keyField</computeroutput>   </para>
</entry><entry>
<para>String   </para>
</entry><entry>
<para>Name of the field in the hash to retrieve   </para>
</entry><entry>
<para>&quot;&quot;    </para>
</entry></row>
      <row  class='markdownTableRowOdd'>
<entry>
<para><computeroutput>_function</computeroutput>   </para>
</entry><entry>
<para>String   </para>
</entry><entry>
<para>Name of the function to receive the retrieved data   </para>
</entry><entry>
<para>&quot;&quot;    </para>
</entry></row>
      <row  class='markdownTableRowEven'>
<entry>
<para><computeroutput>_call</computeroutput>   </para>
</entry><entry>
<para>Boolean   </para>
</entry><entry>
<para>Whether to call the function directly (true) or spawn (false)   </para>
</entry><entry>
<para>false    </para>
</entry></row>
      <row  class='markdownTableRowOdd'>
<entry>
<para><computeroutput>_netId</computeroutput>   </para>
</entry><entry>
<para>String   </para>
</entry><entry>
<para>(Optional) NetID of the player to receive the data   </para>
</entry><entry>
<para>&quot;&quot;   </para>
</entry></row>
    </tbody>
    </tgroup>
</informaltable>
</para>
</section>
<section xml:id="_md_docs_2hash_2hash_get_id_1autotoc_md252">
<title>Return Value</title>
<para>None. The retrieved data is passed to the specified callback function asynchronously.</para>
</section>
<section xml:id="_md_docs_2hash_2hash_get_id_1autotoc_md253">
<title>Examples</title><section xml:id="_md_docs_2hash_2hash_get_id_1autotoc_md254">
<title>Retrieve a player&apos;s loadout field:</title>
<para><literallayout><computeroutput>[getPlayerUID&#32;player,&#32;&quot;loadout&quot;,&#32;&quot;ramdb_db_fnc_test&quot;]&#32;call&#32;ramdb_db_fnc_hashGetId;
</computeroutput></literallayout></para>
</section>
<section xml:id="_md_docs_2hash_2hash_get_id_1autotoc_md255">
<title>Retrieve a specific vehicle property with synchronous callback:</title>
<para><literallayout><computeroutput>[&quot;vehicle_123&quot;,&#32;&quot;fuel&quot;,&#32;&quot;ramdb_db_fnc_processFuelData&quot;,&#32;true]&#32;call&#32;ramdb_db_fnc_hashGetId;
</computeroutput></literallayout></para>
</section>
<section xml:id="_md_docs_2hash_2hash_get_id_1autotoc_md256">
<title>Retrieve data and send it to a specific client:</title>
<para><literallayout><computeroutput>[getPlayerUID&#32;player,&#32;&quot;stats&quot;,&#32;&quot;ramdb_db_fnc_test&quot;,&#32;false,&#32;netId&#32;player]&#32;remoteExecCall&#32;[&quot;ramdb_db_fnc_hashGetId&quot;,&#32;2,&#32;false];
</computeroutput></literallayout></para>
</section>
</section>
<section xml:id="_md_docs_2hash_2hash_get_id_1autotoc_md257">
<title>Notes</title>
<para><itemizedlist>
<listitem>
<para>Retrieves a single field value from a specific hash table</para>
</listitem><listitem>
<para>All three primary parameters (key, keyField, and function) are required and validated</para>
</listitem><listitem>
<para>The data is retrieved asynchronously through the extension&apos;s callback system</para>
</listitem><listitem>
<para>When a netId is provided, the data is sent to that specific client</para>
</listitem><listitem>
<para>The <computeroutput>_call</computeroutput> parameter determines whether the function is called directly (synchronous) or spawned (asynchronous)</para>
</listitem><listitem>
<para>This function targets both a specific hash table (<computeroutput>_key</computeroutput>) and a specific field (<computeroutput>_keyField</computeroutput>)</para>
</listitem><listitem>
<para>More efficient than retrieving all hash fields when only one is needed</para>
</listitem><listitem>
<para>Player UIDs are commonly used as keys to store player-specific data</para>
</listitem><listitem>
<para>All operations are logged for debugging purposes</para>
</listitem></itemizedlist>
</para>
</section>
<section xml:id="_md_docs_2hash_2hash_get_id_1autotoc_md258">
<title>Related Functions</title>
<para><itemizedlist>
<listitem>
<para><computeroutput>ramdb_db_fnc_hashGet</computeroutput>: Retrieves a field value from the global hash table</para>
</listitem><listitem>
<para><computeroutput>ramdb_db_fnc_hashGetAllId</computeroutput>: Retrieves all fields from a specific hash table</para>
</listitem><listitem>
<para><computeroutput>ramdb_db_fnc_hashGetAll</computeroutput>: Retrieves all fields from the global hash table</para>
</listitem><listitem>
<para><computeroutput>ramdb_db_fnc_hashSetId</computeroutput>: Sets a field value in a specific hash table</para>
</listitem><listitem>
<para><computeroutput>ramdb_db_fnc_scheduler</computeroutput>: Processes the callback from the database extension</para>
</listitem></itemizedlist>
</para>
</section>
<section xml:id="_md_docs_2hash_2hash_get_id_1autotoc_md259">
<title>Links</title>
<para><link linkend="_md_docs_2hash_2hash_delete">Hash Delete</link> | <link linkend="_md_docs_2hash_2hash_delete_id">Hash Delete ID</link> | <link linkend="_md_docs_2hash_2hash_get">Hash Get</link> | <link linkend="_md_docs_2hash_2hash_get_all">Hash Get All</link> | <link linkend="_md_docs_2hash_2hash_get_all_id">Hash Get All ID</link> | <link linkend="_md_docs_2hash_2hash_get_id">Hash Get ID</link> | <link linkend="_md_docs_2hash_2hash_remove">Hash Remove</link> | <link linkend="_md_docs_2hash_2hash_remove_id">Hash Remove ID</link> | <link linkend="_md_docs_2hash_2hash_set">Hash Set</link> | <link linkend="_md_docs_2hash_2hash_set_bulk">Hash Set Bulk</link> | <link linkend="_md_docs_2hash_2hash_set_id">Hash Set ID</link> | <link linkend="_md_docs_2hash_2hash_set_id_bulk">Hash Set ID Bulk</link> </para>
</section>
</section>
</section>
