Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2025
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 0.84 KB | None | 0 0
  1. missionNamespace setVariable ["approvedList", [WSL, ASL, WS1, WS2, WS3, WS4]];
  2.  
  3. missionNamespace setVariable [
  4.     "fnc_closeInventory",
  5.     {
  6.         [] spawn {
  7.             waitUntil { !isNull findDisplay 602 };
  8.             closeDialog 0;
  9.             hint "Access denied";
  10.         };
  11.     }
  12. ];
  13.  
  14. this addEventHandler [
  15.     "ContainerOpened",
  16.     {
  17.         params ["_container", "_unit"];
  18.         private _approved = missionNamespace getVariable ["approvedList", []];
  19.         private _fnc = missionNamespace getVariable "fnc_closeInventory";
  20.  
  21.         private _isAdmin = serverCommandAvailable "#kick";
  22.         private _isZeus = (allCurators findIf {getAssignedCuratorUnit _x isEqualTo _unit}) > -1;
  23.  
  24.         if (!(_unit in _approved) && !_isZeus && !_isAdmin && (_unit == player)) then {
  25.             call _fnc;
  26.         };
  27.     }
  28. ];
  29.  
Tags: SQF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement