### TFAR_fnc_currentUnit Source: https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Functions Gets the current unit the player is controlling. ```APIDOC ## GET /TFAR_fnc_currentUnit ### Description Gets the unit that the local player is currently controlling. ### Method GET ### Endpoint /TFAR_fnc_currentUnit ### Parameters None ### Response #### Success Response (200) - **unit** (Object) - The current unit object. #### Response Example ```json { "unit": "player" } ``` ``` -------------------------------- ### Get Additional SW Channel - ArmaScript Source: https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Functions Gets the additional channel for a given SW radio. It requires the radio class name as input and returns the channel number. ```ArmaScript _channel = TFAR_fnc_getAdditionalSwChannel("some_radio_class"); ``` -------------------------------- ### Get Additional SW Radio Stereo Setting Source: https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Functions Gets the stereo setting of the additional channel for a given radio. The function takes a radio class name as input and returns a number representing the stereo configuration (0 for both, 1 for left, 2 for right). ```arma_script _stereo = (call TFAR_fnc_ActiveSwRadio) call TFAR_fnc_getAdditionalSwStereo; ``` -------------------------------- ### TFAR_fnc_getDefaultRadioClasses Source: https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Functions Gets a list of default radio classes available in the mod. ```APIDOC ## GET /TFAR_fnc_getDefaultRadioClasses ### Description Retrieves a list of the default class names for radios provided by the Task Force Arma 3 Radio mod. ### Method GET ### Endpoint /TFAR_fnc_getDefaultRadioClasses ### Parameters None ### Response #### Success Response (200) - **classes** (Array) - An array of strings, where each string is a default radio class name. #### Response Example ```json { "classes": [ "TF_lr_radio", "TF_sw_radio", "TF_dd_radio" ] } ``` ``` -------------------------------- ### TFAR_fnc_getConfigProperty Source: https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Functions Gets a config property (getNumber / getText) from CfgVehicles. ```APIDOC ## GET /TFAR_fnc_getConfigProperty ### Description Gets a config property (getNumber / getText) from CfgVehicles. Only works for CfgVehicles. ### Method GET ### Endpoint /TFAR_fnc_getConfigProperty ### Parameters #### Query Parameters - **itemClassName** (STRING) - Required - The class name of the item. - **property** (STRING) - Required - The name of the property to retrieve. - **defaultValue** (ANY) - Optional - The default value to return if the property is not found. ### Request Example ``` [_LRradio, "tf_hasLrRadio", 0] call TFAR_fnc_getConfigProperty; ``` ### Response #### Success Response (200) - **result** (NUMBER/TEXT) - The value of the config property. #### Response Example ```json { "result": 1 } ``` ``` -------------------------------- ### Get Additional LR Stereo - ArmaScript Source: https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Functions Gets the stereo setting of the additional channel for a given LR radio. It requires an array containing the radio object and its ID as input and returns the stereo setting (0 for both, 1 for left, 2 for right). ```ArmaScript _stereo = (call TFAR_fnc_ActiveLrRadio) call TFAR_fnc_getAdditionalLrStereo; ``` -------------------------------- ### Get Radio Settings Copy Menu Source: https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Functions Returns a submenu for copying radio settings. This function is typically called internally by the CBA UI and takes no parameters, returning a CBA UI menu array. ```armascript Called internally by CBA UI ``` -------------------------------- ### Get Current LR Radio Stereo Setting Source: https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Functions Gets the stereo setting of the current channel for a given LR radio. The function expects an array containing the radio object and its ID. It returns a number indicating the stereo configuration (0 for both, 1 for left, 2 for right). ```arma_script _stereo = (call TFAR_fnc_ActiveLrRadio) call TFAR_fnc_getCurrentLrStereo; ``` -------------------------------- ### Get Config Property Source: https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Functions Retrieves a configuration property from CfgVehicles. It takes the item class name, the property name, and an optional default value. The function can return a number or text. ```arma_script _LRradio = objNull; // Placeholder for actual radio object _hasLrRadio = [_LRradio, "tf_hasLrRadio", 0] call TFAR_fnc_getConfigProperty; ``` -------------------------------- ### TFAR_fnc_getCurrentSwStereo Source: https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Functions Gets the stereo setting of the current channel for the passed SW radio. ```APIDOC ## GET /TFAR_fnc_getCurrentSwStereo ### Description Gets the stereo setting of the current channel for the passed SW radio. ### Method GET ### Endpoint /TFAR_fnc_getCurrentSwStereo ### Parameters None ### Request Example ``` _stereo = (call TFAR_fnc_ActiveSwRadio) call TFAR_fnc_getCurrentSwStereo; ``` ### Response #### Success Response (200) - **stereo_setting** (NUMBER) - Stereo settings: 0 for both, 1 for left, 2 for right. #### Response Example ```json { "stereo_setting": 2 } ``` ``` -------------------------------- ### Get Current SW Radio Stereo Setting (SQF) Source: https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Functions Retrieves the stereo setting for the currently active SW radio. This function handles special logic for additional settings. It takes the radio class name as a string parameter and returns a number representing the stereo setting (0 for both, 1 for left, 2 for right). ```sqf _stereo = (call TFAR_fnc_ActiveSwRadio) call TFAR_fnc_getCurrentSwStereo; ``` -------------------------------- ### Get Default Radio Classes (SQF) Source: https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Functions Returns an array containing the default radio class names for a player. This function does not require any parameters. The returned array includes default classes for long-range, personal, rifleman, and airborne radios. ```sqf _classes = call TFAR_fnc_getDefaultRadioClasses; ``` -------------------------------- ### TFAR_fnc_getCurrentSwStereo Source: https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Functions Gets the stereo setting for the current channel of a Short Range radio. ```APIDOC ## GET /TFAR_fnc_getCurrentSwStereo ### Description Retrieves the stereo setting (true/false) for the currently active channel of a Short Range radio. ### Method GET ### Endpoint /TFAR_fnc_getCurrentSwStereo ### Parameters #### Query Parameters - **radio** (Object) - Required - The Short Range radio object. ### Response #### Success Response (200) - **stereo** (Boolean) - True if stereo is enabled for the current channel, false otherwise. #### Response Example ```json { "stereo": true } ``` ``` -------------------------------- ### Get Backpack Radio (ArmaScript) Source: https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Functions Retrieves the backpack radio associated with a given unit, if one exists. It takes a unit object as input and returns an array containing the backpack radio or an empty array if none is found. This function is useful for managing inventory and radio equipment. ```ArmaScript _radio = player call TFAR_fnc_backpackLR; ``` -------------------------------- ### TFAR_fnc_getAdditionalSwStereo Source: https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Functions Gets the stereo setting of the additional channel of the passed radio. ```APIDOC ## GET /TFAR_fnc_getAdditionalSwStereo ### Description Gets the stereo setting of the additional channel of the passed radio. ### Method GET ### Endpoint /TFAR_fnc_getAdditionalSwStereo ### Parameters #### Path Parameters - **radio** (ARRAY) - Required - Radio class name. ### Request Example ``` _stereo = (call TFAR_fnc_ActiveSwRadio) call TFAR_fnc_getAdditionalSwStereo; ``` ### Response #### Success Response (200) - **stereo_setting** (NUMBER) - Stereo settings: 0 for both, 1 for left, 2 for right. #### Response Example ```json { "stereo_setting": 0 } ``` ``` -------------------------------- ### TFAR_fnc_getAdditionalSwStereo Source: https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Functions Gets the stereo setting for the additional channel of a Short Range radio. ```APIDOC ## GET /TFAR_fnc_getAdditionalSwStereo ### Description Retrieves the stereo setting (true/false) for the additional channel of a Short Range radio. ### Method GET ### Endpoint /TFAR_fnc_getAdditionalSwStereo ### Parameters #### Query Parameters - **radio** (Object) - Required - The Short Range radio object. ### Response #### Success Response (200) - **stereo** (Boolean) - True if stereo is enabled for the additional channel, false otherwise. #### Response Example ```json { "stereo": false } ``` ``` -------------------------------- ### Get Channel Frequency Source: https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Functions Returns the frequency for a specified channel and radio. It accepts either a radio object or its class name, and a channel number. The output is a string representing the frequency. ```arma_script // LR radio - channel 1 [(call TFAR_fnc_activeLrRadio), 1] call TFAR_fnc_GetChannelFrequency; // SW radio - channel 1 [(call TFAR_fnc_activeSwRadio), 1] call TFAR_fnc_GetChannelFrequency; ``` -------------------------------- ### TFAR_fnc_getCurrentLrStereo Source: https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Functions Gets the stereo setting of the current channel for the passed LR radio. ```APIDOC ## GET /TFAR_fnc_getCurrentLrStereo ### Description Gets the stereo setting of the current channel (special logic for additional) of the passed LR radio. ### Method GET ### Endpoint /TFAR_fnc_getCurrentLrStereo ### Parameters #### Path Parameters - **radio** (ARRAY) - Required - An array containing the radio object and radio ID. - **radio.0** (OBJECT) - The radio object. - **radio.1** (STRING) - The radio ID. ### Request Example ``` _stereo = (call TFAR_fnc_ActiveLrRadio) call TFAR_fnc_getCurrentLrStereo; ``` ### Response #### Success Response (200) - **stereo_setting** (NUMBER) - Stereo settings: 0 for both, 1 for left, 2 for right. #### Response Example ```json { "stereo_setting": 1 } ``` ``` -------------------------------- ### Get/Set SW Volume - Arma 3 Scripting Source: https://context7.com/michail-nikolaev/task-force-arma-3-radio/llms.txt Enables getting and setting the volume for a short-wave radio. The volume level is an integer between 0 and 10. Requires the active SW radio object and the target volume. ```sqf // Get SW volume _volume = (call TFAR_fnc_activeSwRadio) call TFAR_fnc_getSwVolume; // Set SW volume to 5 [(call TFAR_fnc_activeSwRadio), 5] call TFAR_fnc_setSwVolume; ``` -------------------------------- ### TFAR_fnc_getCurrentLrStereo Source: https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Functions Gets the stereo setting for the current channel of a Long Range radio. ```APIDOC ## GET /TFAR_fnc_getCurrentLrStereo ### Description Retrieves the stereo setting (true/false) for the currently active channel of a Long Range radio. ### Method GET ### Endpoint /TFAR_fnc_getCurrentLrStereo ### Parameters #### Query Parameters - **radio** (Object) - Required - The Long Range radio object. ### Response #### Success Response (200) - **stereo** (Boolean) - True if stereo is enabled for the current channel, false otherwise. #### Response Example ```json { "stereo": false } ``` ``` -------------------------------- ### Get Current Facing Direction Source: https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Functions Returns the current facing direction (azimuth) of the player. This function requires no parameters and returns a number representing the head direction. ```armascript call TFAR_fnc_currentDirection; ``` -------------------------------- ### Get Current Player Unit Source: https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Functions Retrieves the current unit controlled by the player, whether directly or via Zeus. This function takes no parameters and returns the unit object. ```armascript call TFAR_fnc_currentUnit; ``` -------------------------------- ### TFAR_fnc_getAdditionalLrStereo Source: https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Functions Gets the stereo setting for the additional channel of a Long Range radio. ```APIDOC ## GET /TFAR_fnc_getAdditionalLrStereo ### Description Retrieves the stereo setting (true/false) for the additional channel of a Long Range radio. ### Method GET ### Endpoint /TFAR_fnc_getAdditionalLrStereo ### Parameters #### Query Parameters - **radio** (Object) - Required - The Long Range radio object. ### Response #### Success Response (200) - **stereo** (Boolean) - True if stereo is enabled for the additional channel, false otherwise. #### Response Example ```json { "stereo": true } ``` ``` -------------------------------- ### Get/Set SW Stereo Output - Arma 3 Scripting Source: https://context7.com/michail-nikolaev/task-force-arma-3-radio/llms.txt Allows getting and setting the stereo output configuration for a short-wave radio. Values include 0 (both ears), 1 (left ear only), and 2 (right ear only). Requires the active SW radio and the stereo setting. ```sqf // Get current SW stereo _stereo = (call TFAR_fnc_activeSwRadio) call TFAR_fnc_getSwStereo; // Set SW to right ear only [(call TFAR_fnc_activeSwRadio), 2] call TFAR_fnc_setSwStereo; ``` -------------------------------- ### Manage Additional LR Channel - Arma 3 Scripting Source: https://context7.com/michail-nikolaev/task-force-arma-3-radio/llms.txt Handles the setup and retrieval of an additional monitoring channel for long-range radios, enabling simultaneous listening to two channels. Requires the radio object and the channel number to set, or just the radio object to retrieve. ```sqf // Get additional LR channel _radio = call TFAR_fnc_activeLrRadio; _additionalCh = _radio call TFAR_fnc_getAdditionalLrChannel; // Set channel 4 as additional monitoring channel _radio = call TFAR_fnc_activeLrRadio; [_radio select 0, _radio select 1, 4] call TFAR_fnc_setAdditionalLrChannel; // Disable additional channel (pass current additional channel) [_radio select 0, _radio select 1, _additionalCh] call TFAR_fnc_setAdditionalLrChannel; ``` -------------------------------- ### Get/Set Channel Frequency - Arma 3 Scripting Source: https://context7.com/michail-nikolaev/task-force-arma-3-radio/llms.txt Enables getting and setting the frequency for a specific channel on any radio type (LR or SW). Requires the radio object and the channel number as input. Frequencies are provided as strings. ```sqf // Get frequency for LR channel 1 _radio = call TFAR_fnc_activeLrRadio; _freq = [_radio, 1] call TFAR_fnc_getChannelFrequency; // Get frequency for SW channel 3 _swRadio = call TFAR_fnc_activeSwRadio; _freq = [_swRadio, 3] call TFAR_fnc_getChannelFrequency; // Set LR channel 1 to 56.2 MHz [(call TFAR_fnc_activeLrRadio), 1, "56.2"] call TFAR_fnc_setChannelFrequency; // Set SW channel 2 to 84.3 MHz [(call TFAR_fnc_activeSwRadio), 2, "84.3"] call TFAR_fnc_setChannelFrequency; ``` -------------------------------- ### Prepare Default Position Coordinates Source: https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Functions Prepares the position coordinates for a given unit, considering if it's near the player. It takes the unit object and a boolean indicating proximity to the player as input. ```armascript // Example usage would follow here if provided in the source. ``` -------------------------------- ### Get Additional LR Channel - ArmaScript Source: https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Functions Gets the additional channel for a given LR radio. It requires an array containing the radio object and its ID as input and returns the channel number. ```ArmaScript _channel = (call TFAR_fnc_ActiveLrRadio) call TFAR_fnc_getAdditionalLrChannel; ``` -------------------------------- ### TFAR_fnc_copyRadioSettingMenu Source: https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Functions Returns a submenu for radio settings copying. ```APIDOC ## TFAR_fnc_copyRadioSettingMenu ### Description Returns a submenu for radio settings copying. ### Method CALL ### Endpoint TFAR_fnc_copyRadioSettingMenu ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - Nothing ### Request Example ``` Called internally by CBA UI ``` ### Response #### Success Response (200) - **ARRAY** (ARRAY) - CBA UI menu. #### Response Example ```json { "example": "[control, "Copy Settings", "", "copyRadioSettings"]" } ``` ``` -------------------------------- ### Generate SW Radio Settings - ArmaScript Source: https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Functions Generates settings for the SW radio. It takes an optional boolean parameter to control frequency generation and returns an array of settings including active channel, volume, frequencies, stereo setting, encryption code, additional active channels, owner, and speaker mode. ```ArmaScript _settings = call TFAR_fnc_generateSwSettings; ``` -------------------------------- ### TFAR_fnc_getChannelFrequency Source: https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Functions Gets the frequency of a specific channel on a radio. ```APIDOC ## GET /TFAR_fnc_getChannelFrequency ### Description Retrieves the frequency assigned to a specific channel on a given radio. ### Method GET ### Endpoint /TFAR_fnc_getChannelFrequency ### Parameters #### Query Parameters - **radio** (Object) - Required - The radio object. - **channel** (Number) - Required - The channel number. ### Response #### Success Response (200) - **frequency** (Number) - The frequency in Hz for the specified channel. #### Response Example ```json { "frequency": 46500000 } ``` ``` -------------------------------- ### TFAR_fnc_defaultPositionCoordinates Source: https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Functions Gets the default position coordinates for a radio. ```APIDOC ## GET /TFAR_fnc_defaultPositionCoordinates ### Description Retrieves the default position coordinates associated with a specific radio object. ### Method GET ### Endpoint /TFAR_fnc_defaultPositionCoordinates ### Parameters #### Query Parameters - **radio** (Object) - Required - The radio object. ### Response #### Success Response (200) - **position** (Array) - The default position [x, y, z]. #### Response Example ```json { "position": [123.4, 567.8, 90.0] } ``` ``` -------------------------------- ### TFAR_fnc_copyRadioSettingMenu Source: https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Functions Copies radio settings from one radio to another via a menu interface. ```APIDOC ## POST /TFAR_fnc_copyRadioSettingMenu ### Description Initiates a menu allowing a player to copy radio settings from one radio to another. ### Method POST ### Endpoint /TFAR_fnc_copyRadioSettingMenu ### Parameters #### Request Body - **sourceRadio** (Object) - Required - The radio to copy settings from. - **targetRadio** (Object) - Required - The radio to copy settings to. ### Request Example ```json { "sourceRadio": "radio1", "targetRadio": "radio2" } ``` ### Response #### Success Response (200) - **message** (String) - Confirmation message. #### Response Example ```json { "message": "Copy settings menu initiated." } ``` ``` -------------------------------- ### TFAR_fnc_generateSwSettings Source: https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Functions Generates settings for the SW radio. Optionally, frequencies can be excluded from generation. ```APIDOC ## TFAR_fnc_generateSwSettings ### Description Generates settings for the SW radio. Optionally, frequencies can be excluded from generation. ### Method CALL ### Endpoint TFAR_fnc_generateSwSettings ### Parameters #### Query Parameters - **generateFrequencies** (BOOLEAN) - Optional. `false` to generate settings without generating frequencies. Defaults to `true`. ### Request Example ``` _settings = call TFAR_fnc_generateSwSettings; _settings_no_freq = call TFAR_fnc_generateSwSettings(false); ``` ### Response #### Success Response (200) - **settings** (ARRAY) - An array containing various SW radio settings: - 0. **active CH** (NUMBER) - The active channel. - 1. **volume** (NUMBER) - The volume level. - 2. **CH freqs** (ARRAY) - An array of channel frequencies. - 3. **stereo (S)** (NUMBER) - The stereo setting. - 4. **encryption code** (STRING) - The encryption code. - 5. **ADDL active CH** (NUMBER) - The additional active channel. - 6. **ADDL active CH (S)** (NUMBER) - The additional active channel stereo setting. - 7. **owner** (OBJECT) - The owner of the radio. - 8. **speaker mode** (NUMBER) - The speaker mode. #### Response Example ```json { "settings": [ 1, 50, [1000, 2000], 0, "ABCDEF", 2, 1, _ownerObject, 0 ] } ``` ``` -------------------------------- ### TFAR_fnc_generateSwSettings Source: https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Functions Generates default settings for a Short Range radio. ```APIDOC ## GET /TFAR_fnc_generateSwSettings ### Description Generates a set of default configuration settings for a Short Range radio, including frequencies and channel configurations. ### Method GET ### Endpoint /TFAR_fnc_generateSwSettings ### Parameters None ### Response #### Success Response (200) - **settings** (Object) - An object containing default SW radio settings. #### Response Example ```json { "settings": { "channels": 2, "frequencies": [30000000, 31000000] } } ``` ``` -------------------------------- ### TFAR_fnc_currentDirection Source: https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Functions Gets the current direction the unit is facing. ```APIDOC ## GET /TFAR_fnc_currentDirection ### Description Gets the current direction (heading) the specified unit is facing. ### Method GET ### Endpoint /TFAR_fnc_currentDirection ### Parameters #### Query Parameters - **unit** (Object) - Required - The unit to get the direction of. ### Response #### Success Response (200) - **direction** (Number) - The direction in degrees (0-360). #### Response Example ```json { "direction": 90.5 } ``` ``` -------------------------------- ### TFAR_fnc_CopySettings Source: https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Functions Directly copies radio settings from one radio to another. ```APIDOC ## POST /TFAR_fnc_CopySettings ### Description Directly copies all relevant radio settings from a source radio to a target radio. ### Method POST ### Endpoint /TFAR_fnc_CopySettings ### Parameters #### Request Body - **sourceRadio** (Object) - Required - The radio to copy settings from. - **targetRadio** (Object) - Required - The radio to copy settings to. ### Request Example ```json { "sourceRadio": "radioA", "targetRadio": "radioB" } ``` ### Response #### Success Response (200) - **success** (Boolean) - True if settings were copied successfully, false otherwise. #### Response Example ```json { "success": true } ``` ``` -------------------------------- ### Check SW Radio Usability with Depth Source: https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Functions Determines if the SW radio can be used at a specified depth. It takes the unit, isolation status, speaking ability, and depth as parameters and returns a boolean indicating usability. ```armascript _canUseSW = [player, false, false, 10] call TFAR_fnc_canUseSwRadio; ``` -------------------------------- ### TFAR_fnc_getLrFrequency Source: https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Functions Gets the frequency of the current channel for a Long Range radio. ```APIDOC ## GET /TFAR_fnc_getLrFrequency ### Description Retrieves the frequency of the currently active channel on a Long Range radio. ### Method GET ### Endpoint /TFAR_fnc_getLrFrequency ### Parameters #### Query Parameters - **radio** (Object) - Required - The Long Range radio object. ### Response #### Success Response ``` -------------------------------- ### TFAR_fnc_getAdditionalSwChannel Source: https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Functions Gets the additional channel number for a Short Range radio. ```APIDOC ## GET /TFAR_fnc_getAdditionalSwChannel ### Description Retrieves the number of the additional channel configured for a Short Range radio. ### Method GET ### Endpoint /TFAR_fnc_getAdditionalSwChannel ### Parameters #### Query Parameters - **radio** (Object) - Required - The Short Range radio object. ### Response #### Success Response (200) - **channel** (Number) - The additional channel number. #### Response Example ```json { "channel": 1 } ``` ``` -------------------------------- ### TFAR_fnc_getAdditionalLrChannel Source: https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Functions Gets the additional channel number for a Long Range radio. ```APIDOC ## GET /TFAR_fnc_getAdditionalLrChannel ### Description Retrieves the number of the additional channel configured for a Long Range radio. ### Method GET ### Endpoint /TFAR_fnc_getAdditionalLrChannel ### Parameters #### Query Parameters - **radio** (Object) - Required - The Long Range radio object. ### Response #### Success Response (200) - **channel** (Number) - The additional channel number. #### Response Example ```json { "channel": 2 } ``` ``` -------------------------------- ### Generate LR Radio Settings - ArmaScript Source: https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Functions Generates settings for the LR radio. It takes optional parameters for encryption code, active channels, speaker mode, and returns an array of settings including active channel, volume, frequencies, stereo setting, encryption code, additional active channels, and owner. ```ArmaScript _settings = call TFAR_fnc_generateLrSettings; ``` -------------------------------- ### TFAR_fnc_getLrChannel Source: https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Functions Gets the currently active channel number for a Long Range radio. ```APIDOC ## GET /TFAR_fnc_getLrChannel ### Description Retrieves the number of the currently active channel on a Long Range radio. ### Method GET ### Endpoint /TFAR_fnc_getLrChannel ### Parameters #### Query Parameters - **radio** (Object) - Required - The Long Range radio object. ### Response #### Success Response (200) - **channel** (Number) - The active channel number. #### Response Example ```json { "channel": 1 } ``` ``` -------------------------------- ### TFAR_fnc_generateLrSettings Source: https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Functions Generates settings for the LR radio. This function does not take any parameters. ```APIDOC ## TFAR_fnc_generateLrSettings ### Description Generates settings for the LR radio. ### Method CALL ### Endpoint TFAR_fnc_generateLrSettings ### Parameters None ### Request Example ``` _settings = call TFAR_fnc_generateLrSettings; ``` ### Response #### Success Response (200) - **settings** (ARRAY) - An array containing various LR radio settings: - 0. **active CH** (NUMBER) - The active channel. - 1. **volume** (NUMBER) - The volume level. - 2. **CH freqs** (ARRAY) - An array of channel frequencies. - 3. **stereo (S)** (NUMBER) - The stereo setting. - 4. **encryption code** (STRING) - The encryption code. - 5. **ADDL active CH** (NUMBER) - The additional active channel. - 6. **ADDL active CH (S)** (NUMBER) - The additional active channel stereo setting. - 7. **speaker mode** (NUMBER) - The speaker mode. #### Response Example ```json { "settings": [ 1, 50, [1000, 2000], 0, "ABCDEF", 2, 1, 0 ] } ``` ``` -------------------------------- ### Add Event Handler Source: https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Functions Adds a custom event handler to a unit or globally. It takes a handler ID, event ID, code to execute, and an optional unit object. If the unit is null, the handler is global. ```ArmaScript ["MyID", "OnSpeak", { _unit = _this select 0; _volume = _this select 1; hint format ["%1 is speaking %2", name _unit, _volume]; }, player] call TFAR_fnc_addEventHandler; ``` -------------------------------- ### Available Events Source: https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Events A list of all available events that can be listened to and their corresponding parameters. ```APIDOC ## Available Events ### Description This section details the various events that can be monitored using `TFAR_fnc_addEventHandler` and the parameters they provide. ### Events #### OnSpeak **Description:** Whenever the local player is detected as speaking by TFAR. **Parameters:** - `OBJECT` (Object) – The unit speaking. - `BOOLEAN` – Indicates if the unit is currently speaking. #### OnTangent **Description:** When the local player uses a radio. **Parameters:** - `OBJECT` (Object) – The unit using the radio. - `STRING` / `ARRAY` – Radio class (String for SW, Array for LR). - `NUMBER` – Radio type (0 for SW, 1 for LR, 2 for underwater transceiver). - `BOOLEAN` – Indicates if the additional channel key is pressed. - `BOOLEAN` – Indicates if the button is down. #### OnBeforeTangent **Description:** Before the local player uses a radio. **Parameters:** - `OBJECT` (Object) – The unit using the radio. - `STRING` / `ARRAY` – Radio class (String for SW, Array for LR). - `NUMBER` – Radio type (0 for SW, 1 for LR, 2 for underwater transceiver). - `BOOLEAN` – Indicates if the additional channel key is pressed. - `BOOLEAN` – Indicates if the button is down. #### OnSpeakVolume **Description:** When the local player changes their speaking volume. **Parameters:** - `OBJECT` (Object) – The unit. - `NUMBER` – Speaking distance in meters. #### OnRadiosReceived **Description:** When the local player receives new radios. **Parameters:** - `OBJECT` (Object) – The unit. - `ARRAY` – All radios received by this unit. #### OnRadioOwnerSet **Description:** When the local player gets assigned as SW radio owner. **Parameters:** - `OBJECT` (Object) – The unit. - `STRING` – ID of the SW radio. #### OnLRChange **Description:** When the local player switches their LR radio. **Parameters:** - `OBJECT` (Object) – The unit. ``` -------------------------------- ### Get/Set Short-Wave Radio Channel (TFAR) Source: https://context7.com/michail-nikolaev/task-force-arma-3-radio/llms.txt Enables getting and setting the active channel on a short-wave radio. Channels are indexed from 0 upwards. Requires the radio class name and channel index for setting, and just the radio class name for getting. Input for setting is [radioClassName, channelIndex]. ```sqf // Get current SW channel _swRadio = call TFAR_fnc_activeSwRadio; _channel = _swRadio call TFAR_fnc_getSwChannel; hint format ["SW Radio on channel %1", _channel + 1]; // Set SW radio to channel 3 (index 2) [(call TFAR_fnc_activeSwRadio), 2] call TFAR_fnc_setSwChannel; ``` -------------------------------- ### Get Active LR Radio Source: https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Functions Retrieves the currently active Long Range (LR) radio for the player. This function does not require any parameters. ```ArmaScript _radio = call TFAR_fnc_activeLRRadio; ``` -------------------------------- ### TFAR_fnc_generateLrSettings Source: https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Functions Generates default settings for a Long Range radio. ```APIDOC ## GET /TFAR_fnc_generateLrSettings ### Description Generates a set of default configuration settings for a Long Range radio, including frequencies and channel configurations. ### Method GET ### Endpoint /TFAR_fnc_generateLrSettings ### Parameters None ### Response #### Success Response (200) - **settings** (Object) - An object containing default LR radio settings. #### Response Example ```json { "settings": { "channels": 3, "frequencies": [45000000, 46000000, 47000000] } } ``` ``` -------------------------------- ### TFAR_fnc_getConfigProperty Source: https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Functions Retrieves a specific configuration property from the TFAR settings. ```APIDOC ## GET /TFAR_fnc_getConfigProperty ### Description Retrieves the value of a specific configuration property from the Task Force Arma 3 Radio mod settings. ### Method GET ### Endpoint /TFAR_fnc_getConfigProperty ### Parameters #### Query Parameters - **property** (String) - Required - The name of the configuration property (e.g., "RadioChatEnabled"). ### Response #### Success Response (200) - **value** (Any) - The value of the requested configuration property. #### Response Example ```json { "value": true } ``` ``` -------------------------------- ### TFAR_fnc_getSwChannel / TFAR_fnc_setSwChannel Source: https://context7.com/michail-nikolaev/task-force-arma-3-radio/llms.txt Gets or sets the active channel on a short-wave radio. ```APIDOC ## TFAR_fnc_getSwChannel / TFAR_fnc_setSwChannel ### Description Gets or sets the active channel on a short-wave radio. ### Method CALL ### Endpoint TFAR_fnc_getSwChannel TFAR_fnc_setSwChannel ### Parameters #### `TFAR_fnc_getSwChannel` Parameters - **swRadioClassName** (String) - The class name of the active SW radio (from `TFAR_fnc_activeSwRadio`). #### `TFAR_fnc_setSwChannel` Parameters - **swRadioClassName** (String) - The class name of the active SW radio (from `TFAR_fnc_activeSwRadio`). - **channelIndex** (Number) - The desired channel index (0-8). ### Request Example (Get) ```sqf // Get current SW channel _swRadio = call TFAR_fnc_activeSwRadio; _channel = _swRadio call TFAR_fnc_getSwChannel; hint format ["SW Radio on channel %1", _channel + 1]; ``` ### Request Example (Set) ```sqf // Set SW radio to channel 3 (index 2) [(call TFAR_fnc_activeSwRadio), 2] call TFAR_fnc_setSwChannel; ``` ### Response #### Success Response (200) - **`TFAR_fnc_getSwChannel`**: Returns the current channel index (Number, 0-8). - **`TFAR_fnc_setSwChannel`**: No direct return value. Success is indicated by the channel being changed. #### Response Example ```sqf // Example output for get: // 2 ``` ``` -------------------------------- ### Copy Radio Settings Between Radios Source: https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Functions Copies settings from one radio to another. It accepts source and target radio identifiers (SW or LR) and does not return any value. This function is useful for synchronizing radio configurations. ```armascript // LR - LR [(call TFAR_fnc_activeLrRadio),[(vehicle player), "driver"]] call TFAR_fnc_CopySettings; // SW - SW [(call TFAR_fnc_activeSwRadio),"tf_anprc148jem_20"] call TFAR_fnc_CopySettings; ``` -------------------------------- ### TFAR_fnc_getLrChannel / TFAR_fnc_setLrChannel Source: https://context7.com/michail-nikolaev/task-force-arma-3-radio/llms.txt Gets or sets the active channel on a long-range radio. Channels range from 0-8. ```APIDOC ## TFAR_fnc_getLrChannel / TFAR_fnc_setLrChannel ### Description Gets or sets the active channel on a long-range radio. Channels range from 0-8. ### Method CALL ### Endpoint TFAR_fnc_getLrChannel TFAR_fnc_setLrChannel ### Parameters #### `TFAR_fnc_getLrChannel` Parameters - **radioObject** (Object) - The LR radio object (first element from `TFAR_fnc_activeLrRadio`). - **radioQualifier** (String) - The radio identifier (second element from `TFAR_fnc_activeLrRadio`). #### `TFAR_fnc_setLrChannel` Parameters - **radioObject** (Object) - The LR radio object (first element from `TFAR_fnc_activeLrRadio`). - **radioQualifier** (String) - The radio identifier (second element from `TFAR_fnc_activeLrRadio`). - **channelIndex** (Number) - The desired channel index (0-8). ### Request Example (Get) ```sqf // Get current LR channel _radio = call TFAR_fnc_activeLrRadio; _currentChannel = _radio call TFAR_fnc_getLrChannel; hint format ["Current LR channel: %1", _currentChannel + 1]; // Display 1-9 ``` ### Request Example (Set) ```sqf // Set LR radio to channel 5 (index 4) _radio = call TFAR_fnc_activeLrRadio; [_radio select 0, _radio select 1, 4] call TFAR_fnc_setLrChannel; ``` ### Response #### Success Response (200) - **`TFAR_fnc_getLrChannel`**: Returns the current channel index (Number, 0-8). - **`TFAR_fnc_setLrChannel`**: No direct return value. Success is indicated by the channel being changed. #### Response Example ```sqf // Example output for get: // 4 ``` ``` -------------------------------- ### Get Additional SW Radio Channel Source: https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Functions Retrieves the additional SW channel for the active SW radio. This function is part of the TFAR_fnc_ActiveSwRadio system and returns a channel identifier. ```arma_script _channel = (call TFAR_fnc_ActiveSwRadio) call TFAR_fnc_getAdditionalSwChannel; ``` -------------------------------- ### Configure TeamSpeak Channel for Serious Mode (SQF) Source: https://context7.com/michail-nikolaev/task-force-arma-3-radio/llms.txt Sets the TeamSpeak channel name and password for 'serious mode' auto-joining. This ensures players connect to the correct channel for organized gameplay. ```sqf // Channel name for serious mode auto-join tf_radio_channel_name = "TaskForceRadio"; // Channel password tf_radio_channel_password = "123"; ``` -------------------------------- ### Manage Additional SW Channel - Arma 3 Scripting Source: https://context7.com/michail-nikolaev/task-force-arma-3-radio/llms.txt Enables managing an additional monitoring channel for short-wave radios. This function allows setting a secondary channel for monitoring. Requires the active SW radio and the channel number. ```sqf // Get additional SW channel _additionalCh = (call TFAR_fnc_activeSwRadio) call TFAR_fnc_getAdditionalSwChannel; // Set channel 2 as additional [(call TFAR_fnc_activeSwRadio), 2] call TFAR_fnc_setAdditionalSwChannel; ``` -------------------------------- ### TFAR_fnc_getLrFrequency / TFAR_fnc_setLrFrequency Source: https://context7.com/michail-nikolaev/task-force-arma-3-radio/llms.txt Gets or sets the frequency for the active channel on a long-range radio. LR frequencies range from 30-87 MHz. ```APIDOC ## TFAR_fnc_getLrFrequency / TFAR_fnc_setLrFrequency ### Description Gets or sets the frequency for the active channel on a long-range radio. LR frequencies range from 30-87 MHz. ### Method CALL ### Endpoint TFAR_fnc_getLrFrequency TFAR_fnc_setLrFrequency ### Parameters #### `TFAR_fnc_getLrFrequency` Parameters - **radioObject** (Object) - The LR radio object (first element from `TFAR_fnc_activeLrRadio`). - **radioQualifier** (String) - The radio identifier (second element from `TFAR_fnc_activeLrRadio`). #### `TFAR_fnc_setLrFrequency` Parameters - **radioObject** (Object) - The LR radio object (first element from `TFAR_fnc_activeLrRadio`). - **radioQualifier** (String) - The radio identifier (second element from `TFAR_fnc_activeLrRadio`). - **frequency** (String) - The desired frequency in MHz (e.g., "45.48"). ### Request Example (Get) ```sqf // Get current LR frequency _radio = call TFAR_fnc_activeLrRadio; _frequency = _radio call TFAR_fnc_getLrFrequency; hint format ["LR Frequency: %1 MHz", _frequency]; ``` ### Request Example (Set) ```sqf // Set LR frequency to 45.48 MHz _radio = call TFAR_fnc_activeLrRadio; [_radio select 0, _radio select 1, "45.48"] call TFAR_fnc_setLrFrequency; // Alternative: Set frequency on active LR radio directly "45.48" call TFAR_fnc_setLongRangeRadioFrequency; ``` ### Response #### Success Response (200) - **`TFAR_fnc_getLrFrequency`**: Returns the current frequency as a String (e.g., "45.48"). - **`TFAR_fnc_setLrFrequency`**: No direct return value. Success is indicated by the frequency being changed. #### Response Example ```sqf // Example output for get: // "45.48" ``` ``` -------------------------------- ### Get LR Radio Encryption Code (SQF) Source: https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Functions Returns the encryption code for a specified LR radio. This function takes a radio object as input and returns a string representing its encryption code. ```sqf (call TFAR_fnc_activeLrRadio) call TFAR_fnc_getLrRadioCode; ``` -------------------------------- ### Check if Can Speak (ArmaScript) Source: https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Functions Determines if a unit can speak, considering factors like eye height and whether the unit is isolated within a vehicle. It takes a boolean for isolation status and a number for eye depth, returning a boolean indicating if speaking is possible. This is useful for simulating realistic communication constraints. ```ArmaScript _canSpeak = [false, -12] call TFAR_fnc_canSpeak; ``` -------------------------------- ### Get LR Radio Frequency (SQF) Source: https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Functions Fetches the frequency for the active channel of a given LR radio. The function expects an array with the radio object and its ID. It returns a number representing the current frequency of the radio. ```sqf _frequency = (call TFAR_fnc_ActiveLrRadio) call TFAR_fnc_getLrFrequency; ``` -------------------------------- ### Get LR Radio Channel (SQF) Source: https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Functions Retrieves the current channel for a given LR radio. It requires an array containing the radio object and its ID as input. The function returns a number representing the channel the radio is currently tuned to. ```sqf _channel = (call TFAR_fnc_ActiveLrRadio) call TFAR_fnc_getLrChannel; ```