ok ive almost got something now
1st trigger:
activation: anyone present repetedly and gateone
onact: {[_x, gate1] exec "gateo.sqs"} forEach thislist;
2nd trigger:
activation: anyone present repetedly and traffic1
onact: {[_x, gate1] exec "gatec.sqs"} forEach thislist;
gateo.sqs opens the gate and gatec.sqs will close the gate when there are no vehicles present.
gateo.sqs:
_unit = _this Select 0
_gate = _this Select 1
? vehicle _unit != DRIVER _unit: goto "inveh"
hint "no vehicle present"
Exit
#inveh
gateone=false
traffic1=true
_gate animate ["Bargate", 0];
Exit
gatec.sqs:
_unit = _this Select 0
_gate = _this Select 1
? vehicle _unit != DRIVER _unit: goto "inveh"
hint "opening gate"
_gate animate ["Bargate", 1];
traffic1=false
gateone=true
Exit
#inveh
hint "vehicle present"
Exit
There still seems to be problems if multiple units are in the triggers zone (i think perhaps only the 1st unit in the zone is check to see if it is a vehicle for some reason).
Im trying to clarifly how repeating triggers work. The 2nd trigger (with activation: anyone present repetedly and traffic1) needs a soldier stationed in the trigger zone by the gate to re-trigger the 2nd trigger thats set to repetedly i think.
Im close to having it working without the soldier guarding the gate in the trigger zone. The gate opens for vehicles as long as there are not soldiers on foot in the trigger zone when the script is called and closes again if a unit enters the trigger's zone to call the 2nd repeating trigger that activates the gatec.sqs and closes the gate
can someone help me with the triggers so that they call the two gate opening and closing scripts properly pls? I want the gate opened when a vehcile comes along and closed afterwards when no more vehicles are present.