Advertisement
Guest User

Untitled

a guest
Jul 15th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 1.45 KB | None | 0 0
  1. if (isServer) then {
  2. reservedSlots = [fbiunit,deaunit,msunit,sheriffunit,policeunit,notarztunit,arztunit];
  3.  
  4. ["reserved", "onPlayerConnected", {
  5.     private ["_uid","_player","_UIDList"];
  6.     _UIDList1 = call compile preProcessFile "scripts/whitelistciv.txt";
  7.     _UIDList2 = call compile preProcessFile "scripts/whitelistnotarzt.txt";
  8.     _UIDList3 = call compile preProcessFile "scripts/whitelistarzt.txt";
  9.     if (_uid < 1) exitWith {};
  10.  
  11.     _player = objNull;
  12.     while {isNull _player} do {
  13.         sleep 1;
  14.         {
  15.             if (_uid == getPlayerUID _x) then {
  16.                 _player = _x;
  17.             };
  18.         } forEach playableUnits;
  19.     };
  20.  
  21.     if (_player in reservedSlots) then {
  22.         if (! _uid in _UIDList1 ) then {
  23.             [["You are not entitled to use this slot!"], "BIS_fnc_infoText", _player, false] call BIS_fnc_MP;
  24.             sleep 1;
  25.             [["end1",false], "BIS_fnc_endMission", _player, false] call BIS_fnc_MP;
  26.         };
  27.     };
  28.    
  29.     if (_player in reservedSlots) then {
  30.         if (! _uid in _UIDList2 ) then {
  31.             [["You are not entitled to use this slot!"], "BIS_fnc_infoText", _player, false] call BIS_fnc_MP;
  32.             sleep 1;
  33.             [["end1",false], "BIS_fnc_endMission", _player, false] call BIS_fnc_MP;
  34.         };
  35.     };
  36.    
  37.     if (_player in reservedSlots) then {
  38.         if (! _uid in _UIDList3 ) then {
  39.             [["You are not entitled to use this slot!"], "BIS_fnc_infoText", _player, false] call BIS_fnc_MP;
  40.             sleep 1;
  41.             [["end1",false], "BIS_fnc_endMission", _player, false] call BIS_fnc_MP;
  42.         };
  43.     };
  44. }] call BIS_fnc_addStackedEventHandler;
  45. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement