Forum Jump :

Author Message


Posts: 5
Rank:


Level: Member

Country: nl
Location:
Occupation:
Age:
In-game name: Hinshaw.L [160th/4SFG]

 
#1 Posted at 2013-09-01 17:48        
     
Hi everyone, for learning purposes I'm trying to make a script that adds an action to the scroll menu to open the doors.
I only want to add this action to the Ghosthawk.
How do I this action to every Ghosthawk in the mission?
This is what I've got (Work in progress):

Open.sqf
_hasinfo = _this select 3
_target = _this select 0
_id = _this select 2
if (_hasInfo == "left_open") then {_target animateDoor ['door_L', 1]; _target removeAction _id; _leftclosed = this addAction ["Close left door","close.sqf", left_close]; };
//opens the door and removes the actionmenu, adds close actionmenu.

Action I wish to add to every Ghosthawk:
addAction ["Open left door","open.sqf", left_open];


Author Message


Posts: 333
Rank:


Level: Member

Country: de
Location:
Occupation: Student
Age: 28
In-game name:

 
#2 Posted at 2013-09-01 20:35        
     
{
  if (typeOf _x == "B_Heli_Transport_01_F" || typeOf _x == "B_Heli_Transport_01_camo_F") then
    {
        _x addAction ["Open left door","open.sqf", left_open];
    };
}
forEach vehicles;


Advertisement


Author Message


Posts: 5
Rank:


Level: Member

Country: nl
Location:
Occupation:
Age:
In-game name: Hinshaw.L [160th/4SFG]

 
#3 Posted at 2013-09-01 21:39        
     
Thanks a lot, this got it working!