Skip to content

API: Events

Bracconiere edited this page May 13, 2015 · 2 revisions

Use the following calls:

Examples
[MyID, EventName, Code, Object] call TFAR_fnc_addEventHandler;

// binding to the player object: ["MyID", "OnSpeak", { hint format ["%1 %2 speaking", _this select 0, if(_this select 1)then{"is"}else{"isn't"}]; }, Player] call TFAR_fnc_addEventHandler;

// binding to the mission namespace and not the player object in particular: ["MyID", "OnSpeak", { hint format ["%1 %2 speaking", _this select 0, if(_this select 1)then{"is"}else{"isn't"}]; }, ObjNull] call TFAR_fnc_addEventHandler;

// removing event handler that was bound to the player: ["MyID", "OnSpeak", player] call TFAR_fnc_removeEventHandler

// removing event handler that was bound to the mission namespace: ["MyID", "OnSpeak", objNull] call TFAR_fnc_removeEventHandler

Current list of all available events within TFAR
        Event         Parameters
  • OnSpeak
    Whenever the local player is detected as speaking by TFAR.
  1. OBJECT – unit.
  2. BOOLEAN – is speaking.
  • OnTangent
    When the local player uses a radio.
  1. OBJECT – unit.
  2. STRING / ARRAY – former if SW radio class, latter if LR.
  3. NUMBER0 for SW, 1 for LR, 2 for underwater transceiver.
  4. BOOLEAN – additional channel key.
  5. BOOLEAN – button down.
  1. OBJECT – unit.
  2. STRING / ARRAY – former if SW radio class, latter if LR.
  3. NUMBER0 for SW, 1 for LR, 2 for underwater transceiver.
  4. BOOLEAN – additional channel key.
  5. BOOLEAN – button down.
  • OnSpeakVolume
    When the local player changes their speaking volume.
  1. OBJECT – unit.
  2. NUMBER – speaking distance in meters.
  1. OBJECT – unit.
  2. ARRAY – all of the radios received by this unit.
  1. OBJECT – unit.
  2. STRING – ID of SW radio.
  • OnLRChange
    When the local player switches their LR radio.
  1. OBJECT – unit.
  2. ARRAY – new LR radio.
  3. ARRAY – old LR radio.
  • OnSWChange
    When the local player switches their SW radio.
  1. OBJECT – unit.
  2. STRING – new SW radio.
  3. STRING – old SW radio.
  1. OBJECT – unit.
  2. OBJECT – LR radio object.
  3. STRING – LR radio qualifier.
  4. NUMBER – channel.
  5. BOOLEAN – additional channel.
  1. OBJECT – unit.
  2. STRING – SW radio.
  3. NUMBER – channel.
  4. BOOLEAN – additional channel.
  • OnLRstereoSet
    When the local player changes the LR stereo setting.
  1. OBJECT – unit.
  2. OBJECT – LR radio object.
  3. STRING – LR radio qualifier.
  4. NUMBER – stereo setting.
  5. BOOLEAN – additional channel.
  • OnSWstereoSet
    When the local player changes the SW stereo setting.
  1. OBJECT – unit.
  2. STRING – SW radio.
  3. NUMBER – stereo setting.
  4. BOOLEAN – additional channel.
  • OnLRvolumeSet
    When the local player sets the radio volume for LR radio.
  1. OBJECT – unit.
  2. OBJECT – LR radio.
  3. STRING – radio qualifier.
  4. NUMBER – volume.
  • OnSWvolumeSet
    When the local player sets the radio volume for SW radio.
  1. OBJECT – unit.
  2. STRING – SW radio.
  3. NUMBER – volume.