ACE3/addons/radiodirectionfinder/functions/fnc_beaconInitServer.sqf

30 lines
850 B
Plaintext
Raw Normal View History

2019-08-27 04:34:11 +00:00
#include "script_component.hpp"
/*
* Author: PabstMirror
2020-01-01 02:34:32 +00:00
* Handles beacon init and adds to signal list globally (Server Only)
2019-08-27 04:34:11 +00:00
*
* Arguments:
* 0: Beacon <OBJECT>
*
* Return Value:
* None
*
* Example:
2020-01-01 02:34:32 +00:00
* [x] call ace_radiodirectionfinder_fnc_beaconInitServer
2019-08-27 04:34:11 +00:00
*
* Public: No
*/
params ["_beacon"];
2020-01-01 02:34:32 +00:00
if (!alive _beacon) exitWith { TRACE_1("beaconInit - not dead",_this); };
2019-08-27 04:34:11 +00:00
private _typeOf = typeOf _beacon;
2019-09-06 03:58:27 +00:00
private _freqMHz = getNumber (configFile >> "CfgVehicles" >> _typeOf >> QGVAR(freq));
private _powerMW = getNumber (configFile >> "CfgVehicles" >> _typeOf >> QGVAR(power));
2020-01-01 02:34:32 +00:00
TRACE_4("beaconInitServer",_beacon,_typeOf,_freqMHz,_powerMW);
2019-08-27 04:34:11 +00:00
2019-09-06 03:58:27 +00:00
[_beacon, _freqMHz, _powerMW] call FUNC(addSignal);
2020-01-01 02:34:32 +00:00
_beacon addEventHandler ["Killed", {call FUNC(beaconCleanupServer)}];
_beacon addEventHandler ["Deleted", {call FUNC(beaconCleanupServer)}];