Jump to content
Sign in to follow this  
helldesign

Help with Clan scripts by UID

Recommended Posts

Hello guys,

I need little help with adding clan scripts to my mission file, so random players cannot access some features in the server till they get instructed and whitelisted by UID.

Basically the idea is to make a script that will store a list with player "UIDs", and redirecting their owners to a bunch of scripts (from different locations). Example:

first we calling the "clan_access" script via "init.sqf":

[] execVM "clan_access.sqf"";

and clan_access.sqf should be something like this:

getPlayerUID -> IF the UID is "000000001","000000002","000000003","000000004","000000005" ->

-> run "folder/script1.sqf",

-> run "folder/script2.sqf",

-> run "folder/script3.sqf",

-> run "folder/script4.sqf",

-> run "folder/script5.sqf"

I would like to call this script via init.sqf, not by the "init line" of each unit, so that way will be a lot easier to make it work with any mission without major editing.

Any help appreciated. Thanks.

Edited by helldesign

Share this post


Link to post
Share on other sites

This should work :

init.sqf:

[] execVM "clanAccess.sqf";

clanAccess.sqf:

_UIDArray = [allOfYourUidsInHereAsStrings];

if ((getPlayerUID player) in _UIDArray) then
{
{
	[] execVM _x;
} forEach ["ScriptOne.sqf", "ScriptTwo.sqf"];
};

I hope I could help you out :)

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
Sign in to follow this  

×