Advertisement
Guest User

Untitled

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