<?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_set_id" xml:lang="en-US">
<title>hashSetId</title>
<indexterm><primary>hashSetId</primary></indexterm>
<section xml:id="_md_docs_2hash_2hash_set_id_1autotoc_md315">
<title>autotoc_md315</title>
<para>title: ArmaRAMDb - Hash Set ID icon: mdi:file-text-outline </para>
</section>
<section xml:id="_md_docs_2hash_2hash_set_id_1autotoc_md316">
<title>excerpt: Set the specified field to the respective value in the hash stored at key from RAMDb.</title></section>
<section xml:id="_md_docs_2hash_2hash_set_id_1autotoc_md317">
<title>ramdb_db_fnc_hashSetId</title><section xml:id="_md_docs_2hash_2hash_set_id_1autotoc_md318">
<title>Description</title>
<para>Sets the value of a specified field in a specific hash table identified by its key. This function allows storing various data types (arrays, strings, numbers, or booleans) in a targeted hash table, making it ideal for player-specific or entity-specific data storage. It provides a way to organize related data under a common identifier.</para>
</section>
<section xml:id="_md_docs_2hash_2hash_set_id_1autotoc_md319">
<title>Syntax</title>
<para><literallayout><computeroutput>[_key,&#32;_keyField,&#32;_data]&#32;call&#32;ramdb_db_fnc_hashSetId
</computeroutput></literallayout></para>
</section>
<section xml:id="_md_docs_2hash_2hash_set_id_1autotoc_md320">
<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 set   </para>
</entry><entry>
<para>&quot;&quot;    </para>
</entry></row>
      <row  class='markdownTableRowOdd'>
<entry>
<para><computeroutput>_data</computeroutput>   </para>
</entry><entry>
<para>Array, String, Number, or Boolean   </para>
</entry><entry>
<para>The value to store in the hash field   </para>
</entry><entry>
<para>[]   </para>
</entry></row>
    </tbody>
    </tgroup>
</informaltable>
</para>
</section>
<section xml:id="_md_docs_2hash_2hash_set_id_1autotoc_md321">
<title>Return Value</title>
<para>None. The operation runs synchronously to store the data.</para>
</section>
<section xml:id="_md_docs_2hash_2hash_set_id_1autotoc_md322">
<title>Examples</title><section xml:id="_md_docs_2hash_2hash_set_id_1autotoc_md323">
<title>Store a player&apos;s loadout under their UID:</title>
<para><literallayout><computeroutput>[getPlayerUID&#32;player,&#32;&quot;loadout&quot;,&#32;[getUnitLoadout&#32;player]]&#32;call&#32;ramdb_db_fnc_hashSetId;
</computeroutput></literallayout></para>
</section>
<section xml:id="_md_docs_2hash_2hash_set_id_1autotoc_md324">
<title>Store vehicle data:</title>
<para><literallayout><computeroutput>[&quot;vehicle_123&quot;,&#32;&quot;status&quot;,&#32;[true,&#32;100,&#32;75,&#32;&quot;active&quot;]]&#32;call&#32;ramdb_db_fnc_hashSetId;
</computeroutput></literallayout></para>
</section>
<section xml:id="_md_docs_2hash_2hash_set_id_1autotoc_md325">
<title>Store player data from a client:</title>
<para><literallayout><computeroutput>[getPlayerUID&#32;player,&#32;&quot;stats&quot;,&#32;[rank&#32;player,&#32;score&#32;player,&#32;name&#32;player]]&#32;remoteExecCall&#32;[&quot;ramdb_db_fnc_hashSetId&quot;,&#32;2,&#32;false];
</computeroutput></literallayout></para>
</section>
</section>
<section xml:id="_md_docs_2hash_2hash_set_id_1autotoc_md326">
<title>Notes</title>
<para><itemizedlist>
<listitem>
<para>Stores a single field-value pair in a specific hash table identified by <computeroutput>_key</computeroutput></para>
</listitem><listitem>
<para>All three parameters (key, keyField, and data) are required and validated</para>
</listitem><listitem>
<para>If the hash table doesn&apos;t exist, it will be created automatically</para>
</listitem><listitem>
<para>If the field already exists in the hash table, its value will be overwritten</para>
</listitem><listitem>
<para>Supports various data types: arrays, strings, numbers, and booleans</para>
</listitem><listitem>
<para>Player UIDs are commonly used as keys to store player-specific data</para>
</listitem><listitem>
<para>Complex data structures should be serialized into arrays</para>
</listitem><listitem>
<para>The operation is executed immediately and synchronously</para>
</listitem><listitem>
<para>All operations are logged for debugging purposes</para>
</listitem></itemizedlist>
</para>
</section>
<section xml:id="_md_docs_2hash_2hash_set_id_1autotoc_md327">
<title>Related Functions</title>
<para><itemizedlist>
<listitem>
<para><computeroutput>ramdb_db_fnc_hashSet</computeroutput>: Sets a field value in the global hash table</para>
</listitem><listitem>
<para><computeroutput>ramdb_db_fnc_hashGetId</computeroutput>: Retrieves a field value from a specific 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_hashSetIdBulk</computeroutput>: Sets multiple field-value pairs in multiple hash tables</para>
</listitem><listitem>
<para><computeroutput>ramdb_db_fnc_hashDeleteId</computeroutput>: Removes a specific hash table</para>
</listitem></itemizedlist>
</para>
</section>
<section xml:id="_md_docs_2hash_2hash_set_id_1autotoc_md328">
<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>
