Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // initServer.sqf
- approvedList = [WSL, ASL, WS1, WS2, WS3, WS4];
- publicVariable "approvedList";
- // init.sqf or initPlayerLocal.sqf
- fnc_closeInventory = {
- [] spawn {
- waitUntil { !isNull findDisplay 602 };
- closeDialog 0;
- hint "Access denied";
- };
- };
- // Object init
- _this addEventHandler [
- "ContainerOpened",
- {
- params ["_container", "_unit"];
- // These need to be fetched at the moment of event trigger
- private _approved = missionNamespace getVariable ["approvedList", []];
- private _isAdmin = serverCommandAvailable "#kick";
- private _isZeus = (allCurators findIf { getAssignedCuratorUnit _x isEqualTo _unit }) > -1;
- if (!(_unit in _approved) && !_isZeus && !_isAdmin && (_unit == player)) then {
- fnc_closeInventory call {};
- };
- }
- ];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement