Jump to content
Sign in to follow this  
avibird 1

Need help How to delete a replacemnet gunner from a script!

Recommended Posts

I will attempt to explain this lol. I am using a great script that allows you to replace static weapon personal if the original gunner is killed however if the gun is destroyed the respawn of the gunner does not occur (All is good)

I have a trigger telling me when all the original gunners are killed

I have a second trigger telling me when all the static weapons are destroyed. This trigger will set a timer that will reset the publicvariable that will allow the commander to recall the both of the scripts via action menu (only the commander can use) that I am using to spawn the static weapons and spawn/respawn the gunners. I have a third trigger via addaction that will only both of the game commanders to recall both of the scripts which will delete the static weapons and delete the original gunners from the battlefield and reset the call in SQF's for the scripts. My issue is I have no clue how to delete the replacement gunners that the script spawn in after the original gunners are killed. This is not a script killed but I would like to delete the replacement gunners and not have them static in locations throughout the mission after the FOB's move to a new location during the mission.

Here is the script that call in the gunners

//Outpost Sparrow 2 East Static Weapon Squad

[] execVM "AVIBIRD\menu\ci_menu2_close.sqf";
EastStaticmanHQ2 = false;
publicvariable "EastStaticmanHQ2";

hq2d removeaction hq2SWME; 

if (isServer) then {

   MoveGunner = {
       private ["_vcl","_deg","_dir","_unit"];
       _vcl = _this select 0;_deg = _this select 1;_dir = getdir _vcl;_unit = (gunner (vehicle _vcl));
       while {(alive _unit) && (alive _vcl)} do {
           _unit setformdir _dir +((random -(_deg)+(_deg/2)));
           sleep 3+(random 6);
       };
   };

   ReplaceGunner = {
       private ["_unit","_gun","_grp"];
    _unit = _this select 0;_gun = _this select 1;_grp = _this select 2;
    while {alive _unit} do {sleep 1};
	if !(alive _unit) then {
	   sleep 10+random 10;
          _unit = _grp createUnit ["BAF_Soldier_DDPM", getPos _gun, [], 0.6, "form"];
          _unit assignAsGunner _gun;
          _unit moveInGunner _gun;
          _unit addEventHandler ["killed",{_this execVM "scripts\dead.sqf"}];
      [_unit,_gun,_grp] spawn ReplaceGunner;
   };
   };

   ReloadGun = {
       private ["_gun"];
       _gun = _this select 0;
       while {alive _gun} do {
         sleep 30;
         _gun setVehicleAmmo 1;
    };
   };


  _grp = createGroup WEST;

  hq2gunner_1 = _grp createUnit ["BAF_Soldier_FAC_DDPM", getPos FOB2gun_1, [], 0.6, "form"];
  hq2gunner_1 assignAsGunner FOB2gun_1;
  hq2gunner_1 moveInGunner FOB2gun_1;
  hq2gunner_1 setVariable ["BIS_noCoreConversations", true];
  hq2gunner_1 setSkill 0.4+(random 0.3);
  hq2gunner_1 addEventHandler ["killed",{_this execVM "scripts\dead.sqf"}];
  if (hq2gunner_1 hasWeapon "NVGoggles") then {hq2gunner_1 removeWeapon "NVGoggles"};
  hq2gunner_1 addWeapon "NVGoggles";
  sleep 0.3;

  hq2gunner_2 = _grp createUnit ["BAF_Soldier_FAC_DDPM", getPos FOB2gun_2, [], 0.6, "form"];
  hq2gunner_2 assignAsGunner FOB2gun_2;
  hq2gunner_2 moveInGunner FOB2gun_2;
  hq2gunner_2 setVariable ["BIS_noCoreConversations", true];
  hq2gunner_2 setSkill 0.4+(random 0.3);
  hq2gunner_2 addEventHandler ["killed",{_this execVM "scripts\dead.sqf"}];
  if (hq2gunner_2 hasWeapon "NVGoggles") then {hq2gunner_2 removeWeapon "NVGoggles"};
  hq2gunner_2 addWeapon "NVGoggles";
  sleep 0.3;

  hq2gunner_3 = _grp createUnit ["BAF_Soldier_FAC_DDPM", getPos FOB2gun_3, [], 0.6, "form"];
  hq2gunner_3 assignAsGunner FOB2gun_3;
  hq2gunner_3 moveInGunner FOB2gun_3;
  hq2gunner_3 setVariable ["BIS_noCoreConversations", true];
  hq2gunner_3 setSkill 0.4+(random 0.3);
  hq2gunner_3 addEventHandler ["killed",{_this execVM "scripts\dead.sqf"}];
  if (hq2gunner_3 hasWeapon "NVGoggles") then {hq2gunner_3 removeWeapon "NVGoggles"};
  hq2gunner_3 addWeapon "NVGoggles";
  sleep 0.3;

  hq2gunner_4 = _grp createUnit ["BAF_Soldier_FAC_DDPM", getPos FOB2gun_4, [], 0.6, "form"];
  hq2gunner_4 assignAsGunner FOB2gun_4;
  hq2gunner_4 moveInGunner FOB2gun_4;
  hq2gunner_4 setVariable ["BIS_noCoreConversations", true];
  hq2gunner_4 setSkill 0.4+(random 0.3);
  hq2gunner_4 addEventHandler ["killed",{_this execVM "scripts\dead.sqf"}];
  if (hq2gunner_4 hasWeapon "NVGoggles") then {hq2gunner_4 removeWeapon "NVGoggles"};
  hq2gunner_4 addWeapon "NVGoggles";
  sleep 0.3;

  hq2gunner_5 = _grp createUnit ["BAF_Soldier_FAC_DDPM", getPos FOB2gun_5, [], 0.6, "form"];
  hq2gunner_5 assignAsGunner FOB2gun_5;
  hq2gunner_5 moveInGunner FOB2gun_5;
  hq2gunner_5 setVariable ["BIS_noCoreConversations", true];
  hq2gunner_5 setSkill 0.4+(random 0.3);
  hq2gunner_5 addEventHandler ["killed",{_this execVM "scripts\dead.sqf"}];
  if (hq2gunner_5 hasWeapon "NVGoggles") then {hq2gunner_5 removeWeapon "NVGoggles"};
  hq2gunner_5 addWeapon "NVGoggles";
  sleep 0.3;


  hq2gunner_6 = _grp createUnit ["BAF_Soldier_FAC_DDPM", getPos FOB2gun_6, [], 0.6, "form"];
  hq2gunner_6 assignAsGunner FOB2gun_6;
  hq2gunner_6 moveInGunner FOB2gun_6;
  hq2gunner_6 setVariable ["BIS_noCoreConversations", true];
  hq2gunner_6 setSkill 0.4+(random 0.3);
  hq2gunner_6 addEventHandler ["killed",{_this execVM "scripts\dead.sqf"}];
  if (hq2gunner_6 hasWeapon "NVGoggles") then {hq2gunner_6 removeWeapon "NVGoggles"};
  hq2gunner_6 addWeapon "NVGoggles";
  sleep 0.3;

  hq2gunner_7 = _grp createUnit ["BAF_Soldier_FAC_DDPM", getPos FOB2gun_7, [], 0.6, "form"];
  hq2gunner_7 assignAsGunner FOB2gun_7;
  hq2gunner_7 moveInGunner FOB2gun_7;
  hq2gunner_7 setVariable ["BIS_noCoreConversations", true];
  hq2gunner_7 setSkill 0.4+(random 0.3);
  hq2gunner_7 addEventHandler ["killed",{_this execVM "scripts\dead.sqf"}]; 
  if (hq2gunner_7 hasWeapon "NVGoggles") then {hq2gunner_7 removeWeapon "NVGoggles"};
  hq2gunner_7 addWeapon "NVGoggles";
  sleep 0.3;

  hq2gunner_8 = _grp createUnit ["BAF_Soldier_FAC_DDPM", getPos FOB2gun_8, [], 0.6, "form"];
  hq2gunner_8 assignAsGunner FOB2gun_8;
  hq2gunner_8 moveInGunner FOB2gun_8;
  hq2gunner_8 setVariable ["BIS_noCoreConversations", true];
  hq2gunner_8 setSkill 0.4+(random 0.3);
  hq2gunner_8 addEventHandler ["killed",{_this execVM "scripts\dead.sqf"}]; 
  if (hq2gunner_8 hasWeapon "NVGoggles") then {hq2gunner_8 removeWeapon "NVGoggles"};
  hq2gunner_8 addWeapon "NVGoggles";
  sleep 0.3;

  (leader _grp) setRank "LIEUTENANT";

  //FOB2gun_1 allowDamage false;
  [FOB2gun_1,360] spawn MoveGunner;
  [FOB2gun_1] spawn ReloadGun;
  [hq2gunner_1,FOB2gun_1,_grp] spawn ReplaceGunner;
  sleep 0.3;

  //FOB2gun_2 allowDamage false;
  [FOB2gun_2,360] spawn MoveGunner;
  [FOB2gun_2] spawn ReloadGun;
  [hq2gunner_2, FOB2gun2,_grp] spawn ReplaceGunner;
  sleep 0.3;

  //FOB2gun_3 allowDamage false;
  [FOB2gun_3,360] spawn MoveGunner;
  [FOB2gun_3] spawn ReloadGun;
  [hq2gunner_3, FOB2gun_3,_grp] spawn ReplaceGunner;
  sleep 0.3;

  //FOB2gun_4 allowDamage false;
  [FOB2gun_4,180] spawn MoveGunner;
  [FOB2gun_4] spawn ReloadGun;
  [hq2gunner_4, FOB2gun_4,_grp] spawn ReplaceGunner;
  sleep 0.3;

  //FOB2gun_5 allowDamage false;
  [FOB2gun_5,180] spawn MoveGunner;
  [FOB2gun_5] spawn ReloadGun;
  [hq2gunner_5,FOB2gun_5,_grp] spawn ReplaceGunner;
  sleep 0.3;

  //FOB2gun_6 allowDamage false;
  [FOB2gun_6,360] spawn MoveGunner;
  [FOB2_6] spawn ReloadGun;
  [hq2gunner_6, FOB1gun_6,_grp] spawn ReplaceGunner;

  //FOB2gun_7 allowDamage true;
  [FOB2gun_7,60] spawn MoveGunner;
  [FOB2gun_7] spawn ReloadGun;
  [hq2gunner_7, FOB2gun_7,_grp] spawn ReplaceGunner;
  sleep 0.3;

  //FOB2gun_8 allowDamage false;
  [FOB2gun_8,180] spawn MoveGunner;
  [FOB2gun_8] spawn ReloadGun;
  [hq2gunner_8, FOB2gun_8,_grp] spawn ReplaceGunner;
  sleep 0.3;

sleep 3;
hint "East Static Weapons are now manned in fortification positions Sir"; 

};

if (true) exitwith {};

This is the code that calls the static weapons

//Outpost Sparrow 2 Static Weapons setup East 8 weapons 

[] exec "AVIBIRD\menu\ci_menu2_close.sqf";
EastStaticgunHQ2 = false;
publicvariable "EastStaticgunHQ2";

hq2d removeaction hq2SWE; 

_pos = [(getPosATL Player select 0) + (20 * sin(90)), (getPosATL Player select 1) + (20 * cos(90)), 0];
FOB2StaticGunEast = CreateGroup WEST; 

FOB2gun_1 = createVehicle ["M119", _pos, [], 0, "FORM"];
FOB2gun_1 setPosATL [(getPosATL Player select 0) + (20 * sin(84)), (getPosATL Player select 1) + (20 * cos(84)), 0];
FOB2gun_2 = createVehicle ["BAF_L2A1_Tripod_D", _pos, [], 0, "FORM"];
FOB2gun_2 setPosATL [(getPosATL Player select 0) + (20 * sin(92)), (getPosATL Player select 1) + (20 * cos(92)), 0];
FOB2gun_3 = createVehicle ["TOW_TriPod_US_EP1", _pos, [], 0, "FORM"];
FOB2gun_3 setPosATL [(getPosATL Player select 0) + (20 * sin(94)), (getPosATL Player select 1) + (20 * cos(94)), 0];
FOB2gun_4 = createVehicle ["BAF_GMG_Tripod_D", _pos, [], 0, "FORM"];
FOB2gun_4 setPosATL [(getPosATL Player select 0) + (20 * sin(96)), (getPosATL Player select 1) + (20 * cos(96)), 0];
FOB2gun_5 = createVehicle ["Stinger_Pod_US_EP1", _pos, [], 0, "FORM"];
FOB2gun_5 setPosATL [(getPosATL Player select 0) + (20 * sin(98)), (getPosATL Player select 1) + (20 * cos(98)), 0];
FOB2gun_6 = createVehicle ["TOW_TriPod_US_EP1", _pos, [], 0, "FORM"];
FOB2gun_6 setPosATL [(getPosATL Player select 0) + (20 * sin(100)), (getPosATL Player select 1) + (20 * cos(100)), 0];
FOB2gun_7 = createVehicle ["BAF_GPMG_Minitripod_D", _pos, [], 0, "FORM"];
FOB2gun_7 setPosATL [(getPosATL Player select 0) + (20 * sin(102)), (getPosATL Player select 1) + (20 * cos(102)), 0];
FOB2gun_8 = createVehicle ["ZU23_CDF", _pos, [], 0, "FORM"];
FOB2gun_8 setPosATL [(getPosATL Player select 0) + (20 * sin(110)), (getPosATL Player select 1) + (20 * cos(110)), 0];
//
sleep 3;
hint "East Static Weapons Deployment completed please precede with gun placement of fortifications before maning weapons with Squad"; 


FOB2StaticGunEastTD= createTrigger ["EmptyDetector", getPos player]; 
FOB2StaticGunEastTD setTriggerArea [0, 0, 0, false];
FOB2StaticGunEastTD setTriggerActivation ["NONE", "NOT PRESENT", false];
FOB2StaticGunEastTD setTriggerStatements ["!(alive FOB2gun_1)  && !(alive FOB2Egun_2)  && !(alive FOB2Egun_3)  && !(alive FOB2Egun_4)  && !(alive FOB2Egun_5)  && !(alive FOB2Egun_6)  && !(alive FOB2Egun_7)  && !(alive FOB2Egun_8)","player sideChat ""Outpost Sparrow REPORTS: All East Defensive Static weapon Fortifications have been destroyed Sir""; FOB2StaticGunEast execVM ""lkscripts\fob-bu2\doneHQ2StaticGunEast.sqf""" , ""];

this is the code that resets both of them

//Outpost Sparrow 2 Static Weapons setup East 8 weapons 

{deleteVehicle _x} forEach (units FOB2StaticGunEast);
deleteVehicle FOB2gun_1;
deleteVehicle FOB2gun_2;
deleteVehicle FOB2gun_3;
deleteVehicle FOB2gun_4;
deleteVehicle FOB2gun_5;
deleteVehicle FOB2gun_6;
deleteVehicle FOB2gun_7;
deleteVehicle FOB2gun_8;
deletevehicle FOB2EgunTD;
deletevehicle hq2gunner_1;
deletevehicle hq2gunner_2;
deletevehicle hq2gunner_3;
deletevehicle hq2gunner_4;
deletevehicle hq2gunner_5;
deletevehicle hq2gunner_6;
deletevehicle hq2gunner_7;
deletevehicle hq2gunner_8;



hint "Outpost East Static weapon section has been pulled off the frontlines by The British Secretary of Defence";

sleep 60;                                                                                       //unlimited spawns of this Group at FOB2 unslash

EastStaticgunHQ2 = true;                                                                        //unslash

publicVariable "EastStaticgunHQ2";                                                              //unslash

EastStaticmanHQ2 = true;                                                                        //unslash

publicVariable "EastStaticmanHQ2";                                                              //unslash


hint "New East Static Weapons now available for Deployment from Outpost Sparrow 2";             //unslash

Edited by AVIBIRD 1

Share this post


Link to post
Share on other sites

in most case you could just use

{deleteVehicle _x} foreach  crew _gun+[vehicle _gun];

but if the gun is damaged the gunner gets out and so won't be deleted with the vehicle.

if you place this at the end of ReplaceGunner section, it will store the name of the spawned unit in variable space so when you need to remove the gun and the created unit it knows who it needs to delete.

place after [_unit,_gun,_grp] spawn ReplaceGunner;

_gun setvariable ["crew",_unit];

then to delete vehicle and crew the code will only need to know the gun name your deleting

{deleteVehicle _x} foreach  [_gun getvariable "crew",vehicle _gun];

it works in editor so it should work in script, although that was using just one spawned unit.

Share this post


Link to post
Share on other sites

@Fel Sel I will check it out to see if that is the fix I need.

I don't fully understand the whole use of _grp for the group. Can you explain what does the _grp _unit _gun mean and how the script uses it and call it within the script. AVIBIRD.

Share this post


Link to post
Share on other sites

I suck at explaining but here goes.

FOB2gun_1 = createVehicle ["M119", getpos player, [], 0, "FORM"];

_grp = createGroup WEST;// creates a  West group  named  _grp 

hq2gunner_1 = _grp createUnit ["BAF_Soldier_DDPM", getPos _gun, [], 0.6, "form"];

what you have now is a static gun named FOB2gun_1

You have a group named _grp

and a unit named FOB2gun_1

In your script they are spawning various scripts and are called using a spawn

[hq2gunner_1, FOB2gun_1,_grp] spawn ReplaceGunner;

In the spawned script they have been retrieved using _unit = _this select 0 ,_gun = _this select 1 ect

    ReplaceGunner = {
       private ["_unit","_gun","_grp"];

    _unit = _this select 0;//  hq2gunner_1 
            _gun = _this select 1;// FOB2gun_1
            _grp = _this select 2;//  _grp name

    while {alive _unit} do {sleep 1};
	if !(alive _unit) then {
	   sleep 10+random 10;
          _unit = _grp createUnit ["BAF_Soldier_DDPM", getPos _gun, [], 0.6, "form"];
          _unit assignAsGunner _gun;
          _unit moveInGunner _gun;
          _unit addEventHandler ["killed",{_this execVM "scripts\dead.sqf"}];
      [_unit,_gun,_grp] spawn ReplaceGunner;
   };
   };

The reason to change the name to a local variable _unit,_gun ect is so that you can call that script multiple times as it allows variable names.

If you used hq2gunner_1,FOB2gun_1 you'd have to have a different script for each object.

I'm not sure that will help but as I said I suck at explanations.

Share this post


Link to post
Share on other sites
in most case you could just use

{deleteVehicle _x} foreach  crew _gun+[vehicle _gun];

but if the gun is damaged the gunner gets out and so won't be deleted with the vehicle.

if you place this at the end of ReplaceGunner section, it will store the name of the spawned unit in variable space so when you need to remove the gun and the created unit it knows who it needs to delete.

place after [_unit,_gun,_grp] spawn ReplaceGunner;

_gun setvariable ["crew",_unit];

then to delete vehicle and crew the code will only need to know the gun name your deleting

{deleteVehicle _x} foreach  [_gun getvariable "crew",vehicle _gun];

it works in editor so it should work in script, although that was using just one spawned unit.

@F2K Sel IT works fine for the original gunners but not for the replacement gunners that the script respawn in after the original gunners are killed. any more direction where to go from here? like I said it is not a script killer and most likely the replacement gunners will get killed but if the commander recalls the static weapon section and move the FOB you will have 8 replacement gunners just sitting around the old FOB site

Share this post


Link to post
Share on other sites

Actually it may be much easier, when deleting crew you delete the crew first and then the vehicle so try it this way around

{deleteVehicle _x} forEach (units FOB2StaticGunEast);

deletevehicle hq2gunner_1;

deletevehicle hq2gunner_2;

deletevehicle hq2gunner_3;

deletevehicle hq2gunner_4;

deletevehicle hq2gunner_5;

deletevehicle hq2gunner_6;

deletevehicle hq2gunner_7;

deletevehicle hq2gunner_8;

deletevehicle FOB2EgunTD;

deleteVehicle FOB2gun_1;

deleteVehicle FOB2gun_2;

deleteVehicle FOB2gun_3;

deleteVehicle FOB2gun_4;

deleteVehicle FOB2gun_5;

deleteVehicle FOB2gun_6;

deleteVehicle FOB2gun_7;

deleteVehicle FOB2gun_8;

Share this post


Link to post
Share on other sites

@F2k Sel I will try to put the gunners first (: do you want this {deleteVehicle _x} forEach (units FOB2StaticGunEast); or {deleteVehicle _x} foreach [_gun getvariable "crew",vehicle _gun]; at the top of the SQF that recalls the units and sets the timer for the new variables.

Share this post


Link to post
Share on other sites

Just had another look and I think it's sorted.

spawns had some wrong names that I fixed.

[] execVM "AVIBIRD\menu\ci_menu2_close.sqf";
EastStaticmanHQ2 = false;
publicvariable "EastStaticmanHQ2";

hq2d removeaction hq2SWME; 

if (isServer) then {

   MoveGunner = {
       private ["_vcl","_deg","_dir","_unit"];
       _vcl = _this select 0;_deg = _this select 1;_dir = getdir _vcl;_unit = (gunner (vehicle _vcl));
       while {(alive _unit) && (alive _vcl)} do {
           _unit setformdir _dir +((random -(_deg)+(_deg/2)));
           sleep 3+(random 6);
       };
   };

   ReplaceGunner = {
       private ["_unit","_gun","_grp"];
    _unit = _this select 0;_gun = _this select 1;_grp = _this select 2;
    while {alive _unit} do {sleep 1};
	if !(alive _unit) then {
	   sleep 10+random 10;
          _unit = _grp createUnit ["BAF_Soldier_DDPM", getPos _gun, [], 0.6, "form"];
          _unit assignAsGunner _gun;
          _unit moveInGunner _gun;
          _unit addEventHandler ["killed",{_this execVM "scripts\dead.sqf"}];
      [_unit,_gun,_grp] spawn ReplaceGunner;
      _gun setvariable ["crew",_unit]; 
   };
   };

   ReloadGun = {
       private ["_gun"];
       _gun = _this select 0;
       while {alive _gun} do {
         sleep 30;
         _gun setVehicleAmmo 1;
    };
   };


  _grp = createGroup WEST;

  hq2gunner_1 = _grp createUnit ["BAF_Soldier_FAC_DDPM", getPos FOB2gun_1, [], 0.6, "form"];
  hq2gunner_1 assignAsGunner FOB2gun_1;
  hq2gunner_1 moveInGunner FOB2gun_1;
  hq2gunner_1 setVariable ["BIS_noCoreConversations", true];
  hq2gunner_1 setSkill 0.4+(random 0.3);
  hq2gunner_1 addEventHandler ["killed",{_this execVM "scripts\dead.sqf"}];
  if (hq2gunner_1 hasWeapon "NVGoggles") then {hq2gunner_1 removeWeapon "NVGoggles"};
  hq2gunner_1 addWeapon "NVGoggles";
  sleep 0.3;

  hq2gunner_2 = _grp createUnit ["BAF_Soldier_FAC_DDPM", getPos FOB2gun_2, [], 0.6, "form"];
  hq2gunner_2 assignAsGunner FOB2gun_2;
  hq2gunner_2 moveInGunner FOB2gun_2;
  hq2gunner_2 setVariable ["BIS_noCoreConversations", true];
  hq2gunner_2 setSkill 0.4+(random 0.3);
  hq2gunner_2 addEventHandler ["killed",{_this execVM "scripts\dead.sqf"}];
  if (hq2gunner_2 hasWeapon "NVGoggles") then {hq2gunner_2 removeWeapon "NVGoggles"};
  hq2gunner_2 addWeapon "NVGoggles";
  sleep 0.3;

  hq2gunner_3 = _grp createUnit ["BAF_Soldier_FAC_DDPM", getPos FOB2gun_3, [], 0.6, "form"];
  hq2gunner_3 assignAsGunner FOB2gun_3;
  hq2gunner_3 moveInGunner FOB2gun_3;
  hq2gunner_3 setVariable ["BIS_noCoreConversations", true];
  hq2gunner_3 setSkill 0.4+(random 0.3);
  hq2gunner_3 addEventHandler ["killed",{_this execVM "scripts\dead.sqf"}];
  if (hq2gunner_3 hasWeapon "NVGoggles") then {hq2gunner_3 removeWeapon "NVGoggles"};
  hq2gunner_3 addWeapon "NVGoggles";
  sleep 0.3;

  hq2gunner_4 = _grp createUnit ["BAF_Soldier_FAC_DDPM", getPos FOB2gun_4, [], 0.6, "form"];
  hq2gunner_4 assignAsGunner FOB2gun_4;
  hq2gunner_4 moveInGunner FOB2gun_4;
  hq2gunner_4 setVariable ["BIS_noCoreConversations", true];
  hq2gunner_4 setSkill 0.4+(random 0.3);
  hq2gunner_4 addEventHandler ["killed",{_this execVM "scripts\dead.sqf"}];
  if (hq2gunner_4 hasWeapon "NVGoggles") then {hq2gunner_4 removeWeapon "NVGoggles"};
  hq2gunner_4 addWeapon "NVGoggles";
  sleep 0.3;

  hq2gunner_5 = _grp createUnit ["BAF_Soldier_FAC_DDPM", getPos FOB2gun_5, [], 0.6, "form"];
  hq2gunner_5 assignAsGunner FOB2gun_5;
  hq2gunner_5 moveInGunner FOB2gun_5;
  hq2gunner_5 setVariable ["BIS_noCoreConversations", true];
  hq2gunner_5 setSkill 0.4+(random 0.3);
  hq2gunner_5 addEventHandler ["killed",{_this execVM "scripts\dead.sqf"}];
  if (hq2gunner_5 hasWeapon "NVGoggles") then {hq2gunner_5 removeWeapon "NVGoggles"};
  hq2gunner_5 addWeapon "NVGoggles";
  sleep 0.3;


  hq2gunner_6 = _grp createUnit ["BAF_Soldier_FAC_DDPM", getPos FOB2gun_6, [], 0.6, "form"];
  hq2gunner_6 assignAsGunner FOB2gun_6;
  hq2gunner_6 moveInGunner FOB2gun_6;
  hq2gunner_6 setVariable ["BIS_noCoreConversations", true];
  hq2gunner_6 setSkill 0.4+(random 0.3);
  hq2gunner_6 addEventHandler ["killed",{_this execVM "scripts\dead.sqf"}];
  if (hq2gunner_6 hasWeapon "NVGoggles") then {hq2gunner_6 removeWeapon "NVGoggles"};
  hq2gunner_6 addWeapon "NVGoggles";
  sleep 0.3;

  hq2gunner_7 = _grp createUnit ["BAF_Soldier_FAC_DDPM", getPos FOB2gun_7, [], 0.6, "form"];
  hq2gunner_7 assignAsGunner FOB2gun_7;
  hq2gunner_7 moveInGunner FOB2gun_7;
  hq2gunner_7 setVariable ["BIS_noCoreConversations", true];
  hq2gunner_7 setSkill 0.4+(random 0.3);
  hq2gunner_7 addEventHandler ["killed",{_this execVM "scripts\dead.sqf"}]; 
  if (hq2gunner_7 hasWeapon "NVGoggles") then {hq2gunner_7 removeWeapon "NVGoggles"};
  hq2gunner_7 addWeapon "NVGoggles";
  sleep 0.3;

  hq2gunner_8 = _grp createUnit ["BAF_Soldier_FAC_DDPM", getPos FOB2gun_8, [], 0.6, "form"];
  hq2gunner_8 assignAsGunner FOB2gun_8;
  hq2gunner_8 moveInGunner FOB2gun_8;
  hq2gunner_8 setVariable ["BIS_noCoreConversations", true];
  hq2gunner_8 setSkill 0.4+(random 0.3);
  hq2gunner_8 addEventHandler ["killed",{_this execVM "scripts\dead.sqf"}]; 
  if (hq2gunner_8 hasWeapon "NVGoggles") then {hq2gunner_8 removeWeapon "NVGoggles"};
  hq2gunner_8 addWeapon "NVGoggles";
  sleep 0.3;

  (leader _grp) setRank "LIEUTENANT";

  //FOB2gun_1 allowDamage false;
  [FOB2gun_1,360] spawn MoveGunner;
  [FOB2gun_1] spawn ReloadGun;
  [hq2gunner_1,FOB2gun_1,_grp] spawn ReplaceGunner;
  sleep 0.3;

  //FOB2gun_2 allowDamage false;
  [FOB2gun_2,360] spawn MoveGunner;
  [FOB2gun_2] spawn ReloadGun;
  [hq2gunner_2, FOB2gun_2,_grp] spawn ReplaceGunner;
  sleep 0.3;

  //FOB2gun_3 allowDamage false;
  [FOB2gun_3,360] spawn MoveGunner;
  [FOB2gun_3] spawn ReloadGun;
  [hq2gunner_3, FOB2gun_3,_grp] spawn ReplaceGunner;
  sleep 0.3;

  //FOB2gun_4 allowDamage false;
  [FOB2gun_4,180] spawn MoveGunner;
  [FOB2gun_4] spawn ReloadGun;
  [hq2gunner_4, FOB2gun_4,_grp] spawn ReplaceGunner;
  sleep 0.3;

  //FOB2gun_5 allowDamage false;
  [FOB2gun_5,180] spawn MoveGunner;
  [FOB2gun_5] spawn ReloadGun;
  [hq2gunner_5,FOB2gun_5,_grp] spawn ReplaceGunner;
  sleep 0.3;

  //FOB2gun_6 allowDamage false;
  [FOB2gun_6,360] spawn MoveGunner;
  [FOB2gun_6] spawn ReloadGun;
  [hq2gunner_6, FOB2gun_6,_grp] spawn ReplaceGunner;

  //FOB2gun_7 allowDamage true;
  [FOB2gun_7,60] spawn MoveGunner;
  [FOB2gun_7] spawn ReloadGun;
  [hq2gunner_7, FOB2gun_7,_grp] spawn ReplaceGunner;
  sleep 0.3;

  //FOB2gun_8 allowDamage false;
  [FOB2gun_8,180] spawn MoveGunner;
  [FOB2gun_8] spawn ReloadGun;
  [hq2gunner_8, FOB2gun_8,_grp] spawn ReplaceGunner;
  sleep 0.3;

sleep 3;
hint "East Static Weapons are now manned in fortification positions Sir"; 

};

if (true) exitwith {};

Clean up.

//Outpost Sparrow 2 Static Weapons setup East 8 weapons 


deletevehicle FOB2EgunTD;
{deleteVehicle _x} forEach (units FOB2StaticGunEast);

_gun =   [FOB2gun_1  ,FOB2gun_2  ,FOB2gun_3  ,FOB2gun_4  ,FOB2gun_5  ,FOB2gun_6  ,FOB2gun_7  ,FOB2gun_8];
_units = [hq2gunner_1,hq2gunner_2,hq2gunner_3,hq2gunner_4,hq2gunner_5,hq2gunner_6,hq2gunner_7,hq2gunner_8];

{
{deleteVehicle _x} foreach  _units+[_x getvariable "crew",vehicle _x];  
} foreach  _gun;


hint "Outpost East Static weapon section has been pulled off the frontlines by The British Secretary of Defence";

sleep 60;                                                                                       //unlimited spawns of this Group at FOB2 unslash

EastStaticgunHQ2 = true;                                                                        //unslash

publicVariable "EastStaticgunHQ2";                                                              //unslash

EastStaticmanHQ2 = true;                                                                        //unslash

publicVariable "EastStaticmanHQ2";                                                              //unslash

hint "New East Static Weapons now available for Deployment from Outpost Sparrow 2";             //unslash

Edited by F2k Sel

Share this post


Link to post
Share on other sites

@f2K Sel I have not had time this weekend to check it out but I will this week. Hope this works.

---------- Post added at 16:42 ---------- Previous post was at 15:52 ----------

Hey F2k Sel you are the shit!!! That means you are the man in the states. Works great (: I am sure I will have a few more questions that I will need help with before I am done with this project. Avibird

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×