Jump to content
Evan_Olson

Making White-Listed Cops Only

Recommended Posts

I am starting up a server with a few friends and the first problem/need we want to fix/Change is, Making it for only people/Cops that are whitelisted can join as a cop. I have the script below and if anyone can point me in the right direction to change this that would be much appreciated. 

 

 

 

 

#include "..\script_macros.hpp"

/*

    File: fn_initCop.sqf

    Author: Bryan "Tonic" Boardwine

 

    Description:

    Cop Initialization file.

*/

waitUntil {!(isNull (findDisplay 46))};

 

if (life_blacklisted) exitWith {

    ["Blacklisted",false,true] call BIS_fnc_endMission;

    sleep 30;

};

 

if (!(str(player) in ["cop_1","cop_2","cop_3","cop_4"])) then {

    if ((FETCH_CONST(life_coplevel) isEqualTo 0) && (FETCH_CONST(life_adminlevel) isEqualTo 0)) then {

        ["NotWhitelisted",false,true] call BIS_fnc_endMission;

        sleep 35;

    };

};

 

 

player setVariable ["rank",(FETCH_CONST(life_coplevel)),true];

[] call life_fnc_spawnMenu;

waitUntil{!isNull (findDisplay 38500)}; //Wait for the spawn selection to be open.

waitUntil{isNull (findDisplay 38500)}; //Wait for the spawn selection to be done.

Share this post


Link to post
Share on other sites

what Spatsiba said in this post

just slightly modified to make it cleaner(imo). run from initPlayerLocal

params ["_unit"];
waitUntil {!isNil _unit};

_whitelistedUID = ["3424324324324324", "3242343242342343", "4234234324324234"];

_whitelistedSlots = ["AlphaSL", "BravoSL", "CharlieSL"];

_uid = getPlayerUID _unit;
_slot = vehiclevarname _unit;

if ((_slot in _whitelistedSlots)&& !(_uid in _whitelistedUID)) then {
   failMission "End1";
};

 

  • Thanks 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×