ACE3/addons/map_gestures/functions/fnc_transmit.sqf
SilentSpike 108ff4f644 Replace ACE event system calls with CBA counterparts
Regex used:

\[(.+?),(.+?),(.+?)\]\s+call\s+E?FUNC\((common,)?(target|object)Event\)
[$1,$3,$2] call CBA_fnc_targetEvent

E?FUNC\((common,)?(server|global|local)Event\)
CBA_fnc_$2Event

E?FUNC\((common,)?(add|remove)EventHandler\)
CBA_fnc_$2EventHandler
2016-05-22 16:47:39 +01:00

46 lines
1.2 KiB
Plaintext

/*
* Author: Dslyecxi, MikeMatrix
* Transmit PFH
*
* Arguments:
* 0: Arguments <ARRAY>
* 1: PFH ID <NUMBER>
*
* Return Value:
* Return description <TYPE>
*
* Example:
* [[], 2] call ace_map_gestures_fnc_transmit
*
* Public: No
*/
#include "script_component.hpp"
private ["_ownerID", "_unitUID", "_drawPosVariableName", "_playerOwnerID"];
params ["", "_pfhId"];
if (!visibleMap) then {
call FUNC(endTransmit);
};
if (!GVAR(EnableTransmit) || !visibleMap) exitWith {
[_pfhId] call CBA_fnc_removePerFrameHandler;
};
{
_ownerID = _x getVariable QGVAR(owner_id);
if (isNil "_ownerID") then {
[EVENT_PLAYER_HAS_NO_OWNER_ID, [name _x]] call CBA_fnc_serverEvent;
} else {
_playerOwnerID = ACE_player getVariable QGVAR(owner_id);
if (!isNil "_playerOwnerID" && _ownerID != _playerOwnerID) then {
_unitUID = getPlayerUID ACE_Player;
_drawPosVariableName = if (!isNil "_unitUID" && _unitUID != "") then {format [QGVAR(%1_DrawPos), _unitUID]} else {nil};
if (!isNil "_drawPosVariableName") then {
_ownerID publicVariableClient _drawPosVariableName;
};
};
};
} count ([ACE_player, GVAR(maxRange)] call FUNC(getProximityPlayers));