Jump to content
Sign in to follow this  
quicksilver67

Interesting problem with restricting vehicle access.

Recommended Posts

Our clan has reached the point where we need to cut down on the public use of certain vehicles in the game. After reading through the forum, I have seen information on how to restrict vehicles by class type, by player role, and simply by a GUID array. But not by referencing a custom name in the vehicle's name field. That's what we need.

I am using a trigger instead of a special sqf.

in the init.sqf, I have the following (the UID array is blank intentionally):

masterUIDArray = ["xxxxxxx","yyyyyyy","zzzzzzz"];

masterClassArray =

["birddog1","guarddog1","guarddog2","simon1","simon2","eyeball1","eyeball2","FACmobile","ch7","apache2","ch1","ch4","ch5","flash1","clearview1"];

condition: vehicle player != player

On Activation: if (typeOf (vehicle player) in masterClassArray) then {if ((vehicle player emptyPositions "driver" == 0) && (player != driver vehicle player)) exitWith {};if (getPlayerUID player in masterUIDArray) then {hint "Authorization confirmed -- Good Hunting!"} else {player action ["getOut",(vehicle player)];hint "This vehicle is reserved for authorized personnel only."}}

Where am I going wrong?

Share this post


Link to post
Share on other sites

Here:

(typeOf (vehicle player) in masterClassArray)

With typeof command you ask for the classname.

((vehicle player) in masterClassArray)

should return the desried result.

Share this post


Link to post
Share on other sites

Thanks Myke, but... I already have that in the trigger. What I need is something to include in place of class which will cause the trigger to look for names instead of classes.

We do not wish to bar the public from all vehicles of a class, we just wish to preserve some of the vehicles for our own usage. In the trigger above, I attempted to insure that the public could still enter the desired vehicles if a clan member were driving/flying them.

Oh, by the way, that cockpit of yours is looking brilliant!

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  

×