Jump to content

dmustanger

Member
  • Content Count

    2
  • Joined

  • Last visited

  • Medals

Community Reputation

1 Neutral

About dmustanger

  • Rank
    Newbie
  1. dmustanger

    Unlocking a locked gate

    it is a "Land_BarGate2". I have it working for the most part now. its still a little buggy when there are more than 2 players on the trigger. but one at a time it works great. here is what i have now the gate text="gate1"; init="this addEventHandler [""HandleDamage"",{}]; lock = execVM ""gate\lock.sqf"""; lock.sqf while {isNil "gLock"} do { gate1 animate ["Door01",0]; sleep 0.1; }; I place a trigger around the gate a=15; b=15; activationBy="WEST"; repeating=1; age="UNKNOWN"; expActiv="unlock = execVM ""gate\unlock.sqf"""; expDesactiv="relock = execVM ""gate\relock.sqf"""; unlock.sqf if (isNil "gLock") then { _meters = player distance gate1; if (_meters <= 15) then { _Players = ["123456","123456"]; if (getPlayerUID player in _Players) then { gLock = false; publicVariable "gLock"; gate1 animate ["Door01",1]; }; }; }; relock.sqf if (!isNil "gLock") then { gLock = Nil; publicVariable "gLock"; lock = execVM "gate\lock.sqf" };
  2. Hi i am having problems unlocking a locked gate. The gate locks fine. Problem is i cant get the gate to unlock. I know for sure it is reading the uids as it is displaying the correct message to the players. Here is the code i am using, any suggestions? I create a gate and name it gate1 and in the init field i have this this addEventHandler ["HandleDamage",{}]; lock= [] execVM "lock.sqf" lock.sqf contains this Lock = true; APlayers = ["123456", "123456"]; while {Lock} do { gate1 animate ["Door01",0]; sleep 0.1; }; I then create a trigger over the gate and in the init field i have this unlock = [] execVM "unlock.sqf" unlock.sqf contains this if (getPlayerUID player in APlayers) then { Lock = false; gate1 animate ["Door01",1]; hint "Gate Unlocked!"; } else { Lock = true; gate1 animate ["Door01",0]; hint "Gate Is Locked!"; };
×