How to add UID for triggers ?

kaysio

Valued Member!
Looking for some help,

Ive created a safe zone base with allowed UID to enter the base.
The script runs from the mission.pbo and Ive to alter it everytime I add a new UID.

Is there a way I can do it from the database instead ?
 
From the database? I don't know, but what you really want is a UIDarray. This will store the id's you want to have access and can be used where ever you need a uid list

create a new .sqf and name it admins.sqf or whatever you want.
Code:
if (isServer) exitWith {}; // only run this on client side
// List of admin's or other uid's
masterUIDArray = ["12345678","replace","as","needed","thanks"];
 
//You can create many arrays and have them compiled from here.
//otherUIDArray = ["12345678","12345678","12345678","12345678","12345678"];
Place this in your new file, now place this file in your mission folder.

Now open your init.sqf from your mission folder, near the top add
Code:
call compile preprocessFileLineNumbers "admins.sqf";
under the rest of the compiles. Now you only need to reference the array with
Code:
if (getPlayerUID player in masterUIDarray) then {  };
and you only need to edit the one file anytime you need to add a new UID.
I hope this helps, I use this for all my in game triggers and the UID based spawn and some other scripts that are limited to admins or special users.
 
Back
Top