Jump to content
Sign in to follow this  
hogmason

exec command in a initfield via script

Recommended Posts

i am spawning a static weapon via script and need to place a exec command in the init how is this done

i tried


       _staticman = createGroup east;		

      _staticdistance = [100,200,300,400] call BIS_fnc_selectRandom;
   _statictype = ["AGS_RU","D30_RU","KORD","Metis","RU_WarfareBMGNest_PK"] call BIS_fnc_selectRandom;

      _staticpos = [getMarkerPos "E_Patrol", _staticdistance, random 359, false, [0, 0]] call SHK_pos;	      
      _staticgun = createVehicle [_statictype, _staticpos, [], 0, "NONE"];
      _staticgun setDir random 290;

   _staticgunner = _staticman createUnit ["RU_Soldier_Crew", [0,0,1], [], 0, "CAN_COLLIDE"];
      _staticgunner assignAsGunner _staticgun;
      _staticgunner moveInGunner _staticgun; 
   _staticgunner setCombatMode "RED";
[color="#FF0000"]	   _staticgunner setVehicleInit "null = [_staticgunner] execVM "missions\spawners\Task_Enemy\static_scanner.sqf";";
      processInitCommands;	[/color]

also i have placed _staticgunner inside the [] i.e null = [_staticgunner] execVM

as i need to carry that name over to the next script as

_sgun = this select 1;

did i do that correct

Share this post


Link to post
Share on other sites

Don't need that at all, this should work:

_staticgunner setCombatMode "RED";
null = [_staticgunner] execVM "missions\spawners\Task_Enemy\static_scanner.sqf";

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  

×