forge/arma/server/addons/locker/functions/fnc_initLocker.sqf

38 lines
1.0 KiB
Plaintext

#include "..\script_component.hpp"
/*
* File: fnc_initLocker.sqf
* Author: IDSolutions
* Date: 2025-12-17
* Last Update: 2026-01-30
* Public: No
*
* Description:
* Initializes lockers by hiding editor-placed global locker objects.
* Each client will create their own local instance.
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* call forge_server_locker_fnc_initLocker
*/
private _lockers = (allVariables missionNamespace) select {
private _var = missionNamespace getVariable _x;
("locker" in _x) && { _var isEqualType objNull } && { !isNull _var } && { _x isNotEqualTo "forge_locker_box" }
};
if (_lockers isEqualTo []) exitWith { diag_log "[FORGE:Server:Locker] No editor-placed lockers found."; };
diag_log format ["[FORGE:Server:Locker] Found %1 editor-placed locker(s), hiding globally", count _lockers];
{
private _locker = missionNamespace getVariable _x;
_locker hideObjectGlobal true;
diag_log format ["[FORGE:Server:Locker] Hidden locker: %1 at position %2", _x, getPosASL _locker];
} forEach _lockers;