pokertour 30 Posted June 26, 2013 Hi everyone ! this is the solution to open and close your bargate ! yourbargatename animate ["Door_1_rot", 1] //this open the bargate yourbargatename animate ["Door_1_rot", 0] //this close the bargate 1 Share this post Link to post Share on other sites
kylania 568 Posted June 26, 2013 Good stuff, looks like they might have changed the animation name for A3... Share this post Link to post Share on other sites
pokertour 30 Posted June 26, 2013 Thanks yes! this animated name has no relation with the object. Share this post Link to post Share on other sites
SaOk 112 Posted June 26, 2013 Thanks, :) tested it and made a simple loop - to make the gate automatically open for nearby cars, I have this code in the bargate's initbox: _nul = [this] SPAWN {while {true} do { waitUntil {sleep 1; count ((getposATL (_this select 0)) nearEntities [["Car"],30]) > 0}; (_this select 0) animate ["Door_1_rot", 1]; waitUntil {sleep 1; count ((getposATL (_this select 0)) nearEntities [["Car"],30]) == 0}; (_this select 0) animate ["Door_1_rot", 0]; }; }; Civilian pickups drive nicely through it if not alarmed and speedmode set to limited. Share this post Link to post Share on other sites
pokertour 30 Posted June 26, 2013 Yes you can also place trigger on bargate with "Axis A 5" and "Axis B 20" conf : Type : None Activation : Anybody (or what you want) Repeatedly Present Condition : this On act : yournamebargate animate ["Door_1_rot", 1] On desac : yournamebargate animate ["Door_1_rot", 0] Share this post Link to post Share on other sites
Blackyâ„¢ 10 Posted August 29, 2013 Thank you for info Share this post Link to post Share on other sites
Kydoimos 916 Posted August 29, 2013 Does anyone know if the commands above have changed? It's been working for me and now it doesn't! Share this post Link to post Share on other sites
pokertour 30 Posted August 29, 2013 it's fully work for me on last DEV version. Do you name your bargate ? example : Bargate : name gate trigger : Activation Blufor repeatedly present condition this On Act gate animate ["Door_1_rot", 1] On Dea gate animate ["Door_1_rot", 0] Share this post Link to post Share on other sites
Kydoimos 916 Posted August 29, 2013 Yeah, named the gate and everything. Super strange. I'll check it out tomorrow. Maybe it was just bugging out or something, Share this post Link to post Share on other sites
Kydoimos 916 Posted August 30, 2013 Seems to work fine again now! Madness! Share this post Link to post Share on other sites
Echo5Hotel Actual 8 Posted August 28, 2015 I have found that this is not working for me either. Has anyone come up with a work around or a fix to get the gates closing and opening using these commands? Share this post Link to post Share on other sites
R3vo 2654 Posted August 28, 2015 I have found that this is not working for me either. Has anyone come up with a work around or a fix to get the gates closing and opening using these commands? Works fine for me. 1. place a trigger 2. set activation to anybody 3. set it to activate repeatedly 4. on activation: bargate animate ["Door_1_rot", 1]; 5. on deactivation: bargate animate ["Door_1_rot", 0]; 6. place a bargate and name it bargate Share this post Link to post Share on other sites
madpat3 29 Posted March 20, 2017 On 26.6.2013 at 11:38 PM, SaOk said: Thanks, :) tested it and made a simple loop - to make the gate automatically open for nearby cars, I have this code in the bargate's initbox: _nul = [this] SPAWN {while {true} do { waitUntil {sleep 1; count ((getposATL (_this select 0)) nearEntities [["Car"],30]) > 0}; (_this select 0) animate ["Door_1_rot", 1]; waitUntil {sleep 1; count ((getposATL (_this select 0)) nearEntities [["Car"],30]) == 0}; (_this select 0) animate ["Door_1_rot", 0]; }; }; Civilian pickups drive nicely through it if not alarmed and speedmode set to limited. how do i get multiple classes in it. like having the gate to open for cars, just as well, as to open for trucks and tanks? Share this post Link to post Share on other sites
Djavu 9 Posted May 22, 2018 On 20/03/2017 at 2:15 PM, madpat3 said: how do i get multiple classes in it. like having the gate to open for cars, just as well, as to open for trucks and tanks? To check tanks, men,trucks and cars, I usually disable the damage to the object and disable the summation, prevent it from falling if you hit it with a vehicle: _nul = [this] SPAWN {while {true} do { waitUntil {sleep 1; count ((getposATL (_this select 0)) nearEntities [["Man","Car","Motorcycle","Tank"],30]) > 0}; (_this select 0) animate ["Door_1_rot", 1]; waitUntil {sleep 1; count ((getposATL (_this select 0)) nearEntities [["Man","Car","Motorcycle","Tank"],30]) == 0}; (_this select 0) animate ["Door_1_rot", 0]; }; }; This also works: _Object animateSource ['Door_1_sound_source',0]; Share this post Link to post Share on other sites
Federick90 0 Posted September 23, 2018 Hi guys I placed the bar on altis life server and the police can open the bar both in the car and on foot only even applying the control to the west faction the civilians can open the bar while it should open only in the presence of a west (policeman) This is a code: his allowDamage false;_nul = [this] SPAWN {while {true} do { waitUntil {sleep 1; count ((getposATL (_this select 0)) nearEntities [["Car","Man"],9]) > 0 && (playerSide == west)}; (_this select 0) animate ["door_1_rot", 1]; waitUntil {sleep 1; count ((getposATL (_this select 0)) nearEntities [["Car","Man"],9]) == 0 && (playerSide == west)}; (_this select 0) animate ["door_1_rot", 0]; }; }; Share this post Link to post Share on other sites
Grumpy Old Man 3546 Posted September 23, 2018 1 hour ago, Federick90 said: Hi guys I placed the bar on altis life server and the police can open the bar both in the car and on foot only even applying the control to the west faction the civilians can open the bar while it should open only in the presence of a west (policeman) This is a code: his allowDamage false;_nul = [this] SPAWN {while {true} do { waitUntil {sleep 1; count ((getposATL (_this select 0)) nearEntities [["Car","Man"],9]) > 0 && (playerSide == west)}; (_this select 0) animate ["door_1_rot", 1]; waitUntil {sleep 1; count ((getposATL (_this select 0)) nearEntities [["Car","Man"],9]) == 0 && (playerSide == west)}; (_this select 0) animate ["door_1_rot", 0]; }; }; playerSide will be different on every client, just use nearEntities to filter for west units: _gateStuff = [gate] SPAWN { params ["_gate"]; while {alive _gate} do { waitUntil {sleep 1; count (_gate nearEntities 8 select {side _x isEqualTo west}) > 0}; _gate animate ["Door_1_rot", 1]; waitUntil {sleep 1; count (_gate nearEntities 8 select {side _x isEqualTo west}) == 0}; _gate animate ["Door_1_rot", 0]; }; }; Cheers Share this post Link to post Share on other sites
Federick90 0 Posted September 24, 2018 On 23/9/2018 at 4:20 PM, Grumpy Old Man said: The script you suggested works perfectly on a gate, but how can I put the gate locked and open only in the presence of a west? I tried to set from the closed editor, but it opens anyway. This is the modified script applied to my private server: this allowDamage false;_nul = [this] SPAWN {while {true} do { waitUntil {sleep 1; count ((getposATL (_this select 0)) nearEntities 8 select {side _x isEqualTo west}) > 0}; (_this select 0) animate ["Door_1_rot", 1]; waitUntil {sleep 1; count ((getposATL (_this select 0)) nearEntities 8 select {side _x isEqualTo west}) == 0}; (_this select 0) animate ["Door_1_rot", 0]; }; }; On 23/9/2018 at 4:20 PM, Grumpy Old Man said: playerSide will be different on every client, just use nearEntities to filter for west units: _gateStuff = [gate] SPAWN { params ["_gate"]; while {alive _gate} do { waitUntil {sleep 1; count (_gate nearEntities 8 select {side _x isEqualTo west}) > 0}; _gate animate ["Door_1_rot", 1]; waitUntil {sleep 1; count (_gate nearEntities 8 select {side _x isEqualTo west}) == 0}; _gate animate ["Door_1_rot", 0]; }; }; Cheers Share this post Link to post Share on other sites
Harzach 2517 Posted September 24, 2018 1 hour ago, Federick90 said: but how can I put the gate locked and open only in the presence of a west? That's what the code does. Works fine for me, anyway. Share this post Link to post Share on other sites
Federick90 0 Posted September 24, 2018 14 minutes ago, Harzach said: That's what the code does. Works fine for me, anyway. I do not deny that it works but on altis life if they are in the west faction with police role and the gate is closed by a key key editor and at play the civilians still open the door as if it were not locked with key. Share this post Link to post Share on other sites
Harzach 2517 Posted September 24, 2018 Then there is something going on in the Arma Life code that determines bargate behavior. You can't override it by pasting some more code in the object's init. Share this post Link to post Share on other sites
Federick90 0 Posted September 24, 2018 14 minutes ago, Harzach said: That's what the code does. Works fine for me, anyway. how can I integrate this variable in the script I used? setVariable ['bis_disabled_Door_1',1,true]; 1 Share this post Link to post Share on other sites
HazJ 1289 Posted September 25, 2018 On 6/26/2013 at 9:56 PM, pokertour said: Hi everyone ! this is the solution to open and close your bargate ! yourbargatename animate ["Door_1_rot", 1] //this open the bargate yourbargatename animate ["Door_1_rot", 0] //this close the bargate When is a door not a door? When it's ajar! When it's a A3 bar gate 9 hours ago, Federick90 said: how can I integrate this variable in the script I used? setVariable ['bis_disabled_Door_1',1,true]; What? Read up. Solution is right there! Why are you trying to use setVariable? Makes no sense. Share this post Link to post Share on other sites
Federick90 0 Posted September 25, 2018 12 hours ago, HazJ said: When is a door not a door? When it's ajar! When it's a A3 bar gate What? Read up. Solution is right there! Why are you trying to use setVariable? Makes no sense. Because the script works to open and close the door automatically when there is a police club near the west faction, but I want that if for example you are a civilian and do not belong to the west faction (coop) the door is closed with a key. Because if you use the mouse wheel control as a civilian, the door opens even if from the door sept Share this post Link to post Share on other sites
Harzach 2517 Posted September 25, 2018 25 minutes ago, Federick90 said: Because the script works to open and close the door automatically when there is a police club near the west faction, but I want that if for example you are a civilian and do not belong to the west faction (coop) the door is closed with a key. Because if you use the mouse wheel control as a civilian, the door opens even if from the door sept Again. The code upthread does exactly that. If it isn't working in A3L then there is something in the A3L code that is conflicting with it. Are you sure the civilians are actually side CIV? Share this post Link to post Share on other sites
Grumpy Old Man 3546 Posted September 27, 2018 On 9/24/2018 at 8:15 PM, Federick90 said: I do not deny that it works but on altis life if they are in the west faction with police role and the gate is closed by a key key editor and at play the civilians still open the door as if it were not locked with key. Not sure what you want, you can't lock the bargate with a key, the setVariable option you mentioned only works on building doors from what I know. Your only way would be to bruteforce the bargate closed if no blufor is nearby, if that's what you want: _gateStuff = [gate] SPAWN { params ["_gate"]; while {alive _gate} do { //small delay before closing the gate again sleep 5; waitUntil { _gate animate ["Door_1_rot", 0]; count (_gate nearEntities 8 select {side _x isEqualTo west}) > 0 }; _gate animate ["Door_1_rot", 1]; waitUntil {sleep 1; count (_gate nearEntities 8 select {side _x isEqualTo west}) == 0}; _gate animate ["Door_1_rot", 0]; }; }; Cheers 1 Share this post Link to post Share on other sites