Forum Jump :

Author Message


Posts: 1
Rank:


Level: Member

Country: us
Location:
Occupation:
Age:
In-game name:

 
#1 Posted at 2018-02-12 21:50        
     
I got this much:

Helicopter init line
this addAction ["pop smoke", "popsmoke.sqf", "SmokeShellGreen"];


The script
_bird = _this select 0;
_color = _this select 3;
_smoke = createvehicle [_color, [1,1,1], [], 0, ""];

_smoke attachTo [_bird, [-0.6,2,1]];
sleep 3;
detach _smoke;

but this shows up to anyone within a 3m distance or so.


Author Message


Posts: 278
Rank:


Level: Videomaker

Country: ro
Location:
Occupation: freelancer
Age:
In-game name: ALIAS

 
#2 Posted at 2018-02-13 13:03        
     
I think you get the 3m access because of the boundingbox of the helicopter. In general actions atached to objects are accessible from distance, i am not sure but i think there is a parameter you can use for the action to showup even when you don't look at the object.
Anyways, i am not sure if i understood your issue correctly but what you need is to restrict the action to pilot/driver, gunner or commander, so only whoever ocupies those slots is able pop-up smoke.


Advertisement


Author Message


Posts: 47
Rank:


Level: Member

Country: de
Location: K-Town
Occupation: Medic
Age: 35
In-game name: Officer D

 
#3 Posted at 2018-02-14 18:37        
     
Place a Trigger in your mission with these settings or adjust to your needs :

    Detect by BLUFOR
    Repeating
    Condition: alive player
    On Act.: nul = [player] execVM "AddSmokeVeh.sqf";

AddSmokeVeh.sqf
_unit = _this select 0;
private ["_id","_veh"];

while {alive _unit} do {
	waituntil {vehicle _unit == _unit};
	if (!isnil "_veh") then { _veh removeaction _id };
	waituntil {vehicle _unit != _unit};
	_unit removeaction _id;
	_veh = vehicle _unit;
	if (_veh isKindOf "Air") then {
	_id = _veh addAction [("<t color=""#45bc00"">" + ("Drop green smoke") +"</t>"),"popsmoke.sqf","SmokeShellGreen",-3,false,true,"",""];
	};
	if (isnil "_veh") then { _veh removeaction _id };
   };

Edit this to however you need it.


Author Message


Posts: 89
Rank:


Level: Member

Country: in
Location:
Occupation:
Age:
In-game name:

 
#4 Posted at 2018-02-19 22:26        
     
Check this script as well.
add in init line of a helicopter-
togglesmoke = [this] execVM "addsmoke.sqf";

Place addsmoke.sqf and popsmoke.sqf in mission folder.
addsmoke.sqf
//addsmoke.sqf
_heli = _this select 0;

sleep 1;
dropsmoke = _heli addaction ["drop smoke","popsmoke.sqf",true,1,false,true,"","driver _target == _this"];

popsmoke.sqf
//popsmoke.sqf
_bird = _this select 0;
_pilot = driver _bird;
_smoke = createvehicle ["SmokeShellGreen", [1,1,1], [], 0, ""];

_smoke attachTo [_bird, [-0.6,2,1]];
sleep 3;
detach _smoke;
_pilot sidechat "smoke dropped!";