Files
MissionTemplate/functions/client/fn_bindEventHandlers.sqf
2023-06-19 00:59:05 -05:00

43 lines
1.3 KiB
Plaintext

if ( !hasInterface ) exitWith {};
player addEventHandler["Respawn",
{
params ["_unit", "_corpse"];
_killer = _corpse getVariable ["ace_medical_causeOfDeath", "#scripted"];
if (_killer == "respawn_button") then {
format["[MILSIM] (client) %1 was unconscious then clicked the respawn button", name _unit] remoteExec["diag_log", 0];
// format["%1 was unconscious then clicked the respawn button", name _unit] remoteExec["systemChat", 0];
};
}
];
[
{
params ["_unit", "_object", "_cost"];
private _return = (count nearestObjects [_unit, ["B_APC_Tracked_01_CRV_F", "rhsusf_M1239_M2_Deploy_socom_d", "rhsusf_stryker_m1132_m2_wd", "rhsusf_m113_usarmy_supply", "rhsusf_M1078A1P2_B_WD_CP_fmtv_usarmy", "B_Slingload_01_Cargo_F"], 120]) > 0;
_return
}
] call ace_fortify_fnc_addDeployHandler;
addMissionEventHandler ["HandleChatMessage",
{
params ["_channel", "_owner", "_from", "_text", "_person", "_name", "_strID", "_forcedDisplay", "_isPlayerMessage", "_sentenceType", "_chatMessageType"];
if ( missionNamespace getVariable ["milsim_sideChat", false] ) exitWith{ false };
if (_channel != 1) exitWith { false };
if ( ( admin _owner ) != 0 ) exitWith { false };
if ( !isNull ( getAssignedCuratorLogic _person ) ) exitWith { false };
true;
}
];
diag_log text "[MILSIM] (client) event handlers bound";
nil;