UID Gate Locks

It's possible, but it'll take a lot of coding. You'll have to save the uid of the gate and then set Uid of the players you want access. Requires writing and reading from db. Then with a series of checks. Doable just a lot of work and debugging.
 
We used to have this for our Admin base. Crappy and does not work properly. Best way is using hideobject client side. Then add an action to an indestructible object. BTW easy to get UID. No need to fiddle around with DB stuff.
 
We used to have this for our Admin base. Crappy and does not work properly. Best way is using hideobject client side. Then add an action to an indestructible object. BTW easy to get UID. No need to fiddle around with DB stuff.

Depends if he's is going to add custom gates or already spawned gates. Spawned gates you don't need db, but with custom built ones or spawned ones you do. But not an easy feat in my opinion and not worth the time to code, since there are better alternatives.
 
Depends if he's is going to add custom gates or already spawned gates. Spawned gates you don't need db, but with custom built ones or spawned ones you do. But not an easy feat in my opinion and not worth the time to code, since there are better alternatives.
I beg to differ. I'll post the code on how we do it. simple
 
Depends if he's is going to add custom gates or already spawned gates. Spawned gates you don't need db, but with custom built ones or spawned ones you do. But not an easy feat in my opinion and not worth the time to code, since there are better alternatives.
If there are better alternatives, please enlighten me. I'm just trying to protect my groups base from people walking in and stealing our shit. I don't care if we get raided with a heli. They just wont get no vehicles out.
 
Here it is...
Written by Dmustanger

From the Mission .SQM
{
position[]={1229.4916,6.0802674,2456.1497};
azimut=274.92899;
id=116;
side="EMPTY";
vehicle="Land_Fire_barrel";
skill=1;
init="this addEventHandler [""HandleDamage"",{}]; this setVectorUp [0.0001,0.0001,1]; this addAction [""Open Gate"", ""Gate\open.sqf""]; this addAction [""Close Gate"", ""Gate\close.sqf""]";

From Open.sqf
_laptop = _this select 0;
_player = _this select 1;
_actionid = _this select 2;

_GatePlayers = ["UID","UID2"];
if (getPlayerUID _player in _GatePlayers) then
{
yourobjectname hideObject true;
yourobjectname2 hideObject true;
} else {
titleText ["You do not have permission to open the door.", "PLAIN DOWN", 3];
};

From Close.sqf
_laptop = _this select 0;
_player = _this select 1;
_actionid = _this select 2;

_GatePlayers = ["UID","UID2"];
if (getPlayerUID _player in _GatePlayers) then
{
yourobjectname hideObject false;
yourobjectname2 hideObject false;
} else {
titleText ["You do not have permission to open the door.", "PLAIN DOWN", 3];
};.

This is only clientside so no one else will be able to see the object disappear. Good for Admin Base doors and roofs...
All the vehicles that are used in this are spawned via mission sqm and named in there. Have not tried any other way ATM
 
This is only an example. The parts that go into your mission.sqm would be the base and the doors. the open.sqf and close.sqf would go into a folder named gate. You should look at tutorials regarding adding buildings in via the mission.sqf file.
 
I've been trying to get this working on my epoch server. I managed to get the dialog to open and close gate but when I click it nothing happens. I'm assuming that it is either not reading the .sqf or something is wrong with my sqf. Everything is in its correct position. The only part of the code I don't understand is
Code:
_laptop = _this select 0;
_player = _this select 1;
_actionid = _this select 2;
what is this referring to? Is it different since epoch is not running on a reality build?
Any help would be greatly appreciated
 
Sorry if I was not clear on that part.
_Laptop = Object that has the action assigned to it
_Player = Unit that activated the action (How we get UID)
_actionid = ID of the activated action (Open or close)

Make sure the objects you are trying to hide are properly named in the mission.sqm
Ex.
class Item1064
{
position[]={2348.7112,535.07953,14340.907};
azimut=98.528503;
id=1165;
side="EMPTY";
vehicle="Land_budova1";
skill=1;
text="Youruniquenamehere";
init="this addEventHandler [""HandleDamage"",{}];
 
Im trying to do gate lock as well. I have tired the way you said but is not working. I want to know where should I put the
{
position[]={1229.4916,6.0802674,2456.1497};
azimut=274.92899;
id=116;
side="EMPTY";
vehicle="Land_Fire_barrel";
skill=1;
init="this addEventHandler [""HandleDamage"",{}]; this setVectorUp [0.0001,0.0001,1]; this addAction [""Open Gate"", ""Gate\open.sqf""]; this addAction [""Close Gate"", ""Gate\close.sqf""]";
}
inside the class Vehicles
{
items=100;

or outside of it ?
 
Back
Top