Jump to content
Sign in to follow this  
jamesj505

Help re-running a script? Looping it

Recommended Posts

Hey everyone! I'm a first time poster (Go easy). I'm pretty novice when it comes to editing and have only recently started playing around with editing. I have near no clue when it comes to scripting, but I found a real awesome script that runs at the start of the mission and I would like to include on a mission of mine. The script spawns a C-130 and drops supplies at a random town and then leaves and wont return. I'd like it to do this every 15-30 minutes not only at the start of the mission does anyone know how I can achieve this? Here is the script(s):

Init.sqf

// Test cargo drop script.

private ["_supplytext","_supply","_missionType","_picture","_vehicleName","_mainTextColour","_subTextColour","_centerPos","_flatAreas","_pilot","_jet","_para","_DropPos","_Chute1","_Chute2","_Chute3","_Chute4","_cargo1","_cargo2","_cargo3","_cargo4","_S1","_S2","_S3","_S4","_S5","_S6","_S7","_S8","_land1","_land2","_land3","_land4"];  // variables weren't seen outside fn_findMissionSpot

if (!isServer) exitWith {};
waituntil {!isnil "bis_fnc_init"};

// Still to create private!!!!!! 
private ["_supplytext","_supply"];// variables weren't seen outside fn_findMissionSpot

fn_findMissionSpot = {
   // Finding the mission spot
       _centerPos = getArray (configFile >> "CfgWorlds" >> worldName >> "centerPosition");
       _flatAreas = nearestLocations [_centerPos, ["FlatArea"], _rad];
       _randomPos = getpos (_flatAreas select random (count _flatAreas -1));

           // Creating the marker.
           _supply = createMarker ["Supply", _randomPos ];
           _supply setMarkershape "ELLIPSE";
           _supply setMarkerColor "ColorRed";
           _supply setMarkerBrush "Grid";
           _supply setMarkerSize [250,250];

       _supplytext = createMarker ["supplytext", _randomPos ];
       _supplytext setMarkertype "mil_objective";
       _supplytext setMarkerColor "ColorBlack";
       _supplytext setmarkerText "   Supply Drop Area";

   group _pilot Move getmarkerpos "supplytext";   

   Call fn_supplydrop; 
   }; // End function 


// Function for dropping the cargo from the C130 which will be used incase of abort.

   fn_supplydrop = {

Waituntil {((_jet distance getmarkerPos "supplytext") < 1200)};


	// Opening Cargo Bay doors
	_jet animate ["ramp_top",1];
	_jet animate ["ramp_bottom",1];

_jet FlyInHeight 150;

Sleep 0.1;


Waituntil {((_jet distance getmarkerPos "supplytext") < 350)};  // Possibly using distance to help with if then else statement below?

//If ( (getposatl _jet select 2) > 200) then {hint "Supply Drop Mission Aborted. Finding New Drop Zone!"};

If  ( (getposatl _jet select 2) > 200) then
       {
      hint "Supply Drop Mission Aborted. Finding New Drop Zone!";
      	Deletemarker _supply;
      	Deletemarker _supplytext;
     	call fn_findMissionSpot;
   } else  {       // removed the ; after first }


Waituntil {((_jet distance getmarkerPos "supplytext") < 150)};

// Dropping First Vehicle
        _DropPos = getpos _jet;

sleep 0.5;
        _Chute1 = createVehicle [_para, _DropPos, [], 0, "NONE"];
        _Cargo1 = createVehicle [_supply1, _DropPos, [], 0, "NONE"];
        _Cargo1 attachTo [_Chute1, [0,0,3]];
        _Chute1 setpos _DropPos;

// Creating rest of drop, and shuffling creating vehicle spots to have a tighter spread on drop.


Sleep 1;
        _DropPos2 = getpos _jet;

             _Chute2 = createVehicle [_para, _DropPos, [], 0, "NONE"];
            _Cargo2 = createVehicle [_supply2, _DropPos, [], 0, "NONE"];
            _Cargo2 attachTo [_Chute2, [0,0,3]];
            _Chute2 setpos _DropPos2;


sleep 1;
         _DropPos3 = getpos _jet;

             _Chute3 = createVehicle [_para, _DropPos2, [], 0, "NONE"];
            _Cargo3 = createVehicle [_supply3, _DropPos2, [], 0, "NONE"];
            _Cargo3 attachTo [_Chute3, [0,0,2]];
            _Chute3 setpos _DropPos;


sleep 1;


             _Chute4 = createVehicle [_para, _DropPos3, [], 0, "NONE"];
            _Cargo4 = createVehicle [_supply4, _DropPos3, [], 0, "NONE"];
            _Cargo4 attachTo [_Chute4, [0,0,3]];
            _Chute4 setpos _DropPos3;

// Smoking 
Sleep 2;

    _S1 = "smokeShellBlue" createVehicle _DropPos;
    _S2 = "smokeShellRed" createVehicle _DropPos;
    _S3 = "smokeShellGreen" createVehicle _DropPos2;
    _S4 = "smokeShellred" createVehicle _DropPos3;

       		 _S1 attachto [_Cargo1, [0,0,0]];
        		 _S2 attachto [_Cargo2, [0,0,0]];
        		 _S3 attachto [_Cargo3, [0,0,0]];
        		 _S4 attachto [_Cargo4, [0,0,0]];

           		_jet setspeedmode "full";
           		_jet flyInHeight 500;

_hint = parseText format ["<t align='center' color='%4' shadow='2' size='1.75'>Supply Drop Succesfull!</t><br/><t align='center' color='%4'>------------------------------</t><br/><t align='center' color='%5' size='1.25'>%1</t><br/><t align='center'><img size='5' image='%2'/></t><br/><t align='center' color='%5'>The<t color='%4'> %3</t>, has relinquished the supplies.</t>", _missionType, _picture, _vehicleName, _mainTextColour, _subTextColour];
[nil,nil,rHINT,_hint] call RE;


       // Closing Cargo Bay Doors
	_jet animate ["ramp_top",0];
	_jet animate ["ramp_bottom",0];


// Flying Away and deleting things etc!

Waituntil {((_jet distance getmarkerPos "supply") > 4000)};

deletevehicle _jet;
deletevehicle _pilot;
deleteMarker _supply;
deletemarker _supplytext;

Sleep 0.1;

   _land1 = getpos _cargo1;
   _land2 = getpos _cargo2;
   _land3 = getpos _cargo3;
   _land4 = getpos _cargo4;
        _S5 = "smokeShellpurple" createVehicle _land1;
        _S6 = "smokeShellpurple" createVehicle _land2;
        _S7 = "smokeShellpurple" createVehicle _land3;
        _S8 = "smokeShellpurple" createVehicle _land4;

};
};  //End fn_supplydrop function


   _rad=20000;
   _missionType = "C130 Supply Drop";
_mainTextColour = "#52bf90";
_successTextColour = "#17FF41";
_failTextColour = "#FF1717";
_subTextColour = "#FFFFFF";
_missionTimeOut = 30;
_missionDelayTime = 20;
_missionPlayerRadius = 50;
   _supply1 = "HMMWV_Ambulance"; //supply vehicle
   _supply2 = "USVehicleBox"; // Supply 2
   _supply3 = "Barrels"; // Supply 3
   _supply4 = "Land_stand_small_EP1"; // Supply 2
   _para = "ParachuteMediumWest"; // chute
   _plane = "C130J_US_EP1";  //  Vehicle

sleep 1; // INCREASE FOR LONGER ARRIVAL - Will change to seperate timing function at later date.


   _jet = createVehicle [_plane,  getMarkerPos "plane2", [], 0, "FLY"]; //Creating vehicle
   _jet flyInHeight 300;
   _jet setspeedmode "normal";
   _jet setvelocity [0,230,0];
   _jet allowDamage false;

   sleep 0.5;
       _jet setvehiclevarname "_jet";
       _grp = creategroup west;

           _pilot = _grp createunit ["USMC_Soldier_Pilot",getmarkerpos "spawn2",[],0,"FORM"];
           _pilot moveindriver _jet;
           _pilot assignAsDriver _jet;

           _picture = getText (configFile >> "cfgVehicles" >> typeOf _jet >> "picture");
	_vehicleName = getText (configFile >> "cfgVehicles" >> typeOf _jet >> "displayName");
_hint = parseText format ["<t align='center' color='%4' shadow='2' size='1.75'>Russian Supply Drop</t><br/><t align='center' color='%4'>------------------------------</t><br/><t align='center' color='%5' size='1.25'>%1</t><br/><t align='center'><img size='5' image='%2'/></t><br/><t align='center' color='%5'>A<t color='%4'> %3</t>, has been designated to fly in supplies.</t>", _missionType, _picture, _vehicleName, _mainTextColour, _subTextColour];
[nil,nil,rHINT,_hint] call RE;

call fn_findMissionSpot;

Call fn_supplydrop;
Sleep 1;


Init_working.sqf:

// Test cargo drop script.

private ["_supplytext","_supply","_missionType","_picture","_vehicleName","_mainTextColour","_subTextColour","_centerPos","_flatAreas","_pilot","_jet","_para","_DropPos","_Chute1","_Chute2","_Chute3","_Chute4","_cargo1","_cargo2","_cargo3","_cargo4","_S1","_S2","_S3","_S4","_S5","_S6","_S7","_S8","_land1","_land2","_land3","_land4"];  // variables weren't seen outside fn_findMissionSpot

if (!isServer) exitWith {};
waituntil {!isnil "bis_fnc_init"};

// Still to create private!!!!!! 
private ["_supplytext","_supply"];// variables weren't seen outside fn_findMissionSpot

fn_findMissionSpot = {
   // Finding the mission spot
       _centerPos = getArray (configFile >> "CfgWorlds" >> worldName >> "centerPosition");
       _flatAreas = nearestLocations [_centerPos, ["FlatArea"], _rad];
       _randomPos = getpos (_flatAreas select random (count _flatAreas -1));

           // Creating the marker.
           _supply = createMarker ["Supply", _randomPos ];
           _supply setMarkershape "ELLIPSE";
           _supply setMarkerColor "ColorRed";
           _supply setMarkerBrush "Grid";
           _supply setMarkerSize [250,250];

       _supplytext = createMarker ["supplytext", _randomPos ];
       _supplytext setMarkertype "mil_objective";
       _supplytext setMarkerColor "ColorBlack";
       _supplytext setmarkerText "   Supply Drop Area";

   group _pilot Move getmarkerpos "supplytext";   

   Call fn_supplydrop; 
   }; // End function 


// Function for dropping the cargo from the C130 which will be used incase of abort.

   fn_supplydrop = {

Waituntil {((_jet distance getmarkerPos "supplytext") < 1200)};


	// Opening Cargo Bay doors
	_jet animate ["ramp_top",1];
	_jet animate ["ramp_bottom",1];

_jet FlyInHeight 150;

Sleep 0.1;


Waituntil {((_jet distance getmarkerPos "supplytext") < 350)};  // Possibly using distance to help with if then else statement below?

//If ( (getposatl _jet select 2) > 200) then {hint "Supply Drop Mission Aborted. Finding New Drop Zone!"};

If  ( (getposatl _jet select 2) > 200) then
       {
      hint "Supply Drop Mission Aborted. Finding New Drop Zone!";
      	Deletemarker _supply;
      	Deletemarker _supplytext;
     	call fn_findMissionSpot;
   } else  {       // removed the ; after first }


Waituntil {((_jet distance getmarkerPos "supplytext") < 150)};

// Dropping First Vehicle
        _DropPos = getpos _jet;

sleep 0.5;
        _Chute1 = createVehicle [_para, _DropPos, [], 0, "NONE"];
        _Cargo1 = createVehicle [_supply1, _DropPos, [], 0, "NONE"];
        _Cargo1 attachTo [_Chute1, [0,0,3]];
        _Chute1 setpos _DropPos;

// Creating rest of drop, and shuffling creating vehicle spots to have a tighter spread on drop.


Sleep 1;
        _DropPos2 = getpos _jet;

             _Chute2 = createVehicle [_para, _DropPos, [], 0, "NONE"];
            _Cargo2 = createVehicle [_supply2, _DropPos, [], 0, "NONE"];
            _Cargo2 attachTo [_Chute2, [0,0,3]];
            _Chute2 setpos _DropPos2;


sleep 1;
         _DropPos3 = getpos _jet;

             _Chute3 = createVehicle [_para, _DropPos2, [], 0, "NONE"];
            _Cargo3 = createVehicle [_supply3, _DropPos2, [], 0, "NONE"];
            _Cargo3 attachTo [_Chute3, [0,0,2]];
            _Chute3 setpos _DropPos;


sleep 1;


             _Chute4 = createVehicle [_para, _DropPos3, [], 0, "NONE"];
            _Cargo4 = createVehicle [_supply4, _DropPos3, [], 0, "NONE"];
            _Cargo4 attachTo [_Chute4, [0,0,3]];
            _Chute4 setpos _DropPos3;

// Smoking 
Sleep 2;

    _S1 = "smokeShellBlue" createVehicle _DropPos;
    _S2 = "smokeShellRed" createVehicle _DropPos;
    _S3 = "smokeShellGreen" createVehicle _DropPos2;
    _S4 = "smokeShellred" createVehicle _DropPos3;

       		 _S1 attachto [_Cargo1, [0,0,0]];
        		 _S2 attachto [_Cargo2, [0,0,0]];
        		 _S3 attachto [_Cargo3, [0,0,0]];
        		 _S4 attachto [_Cargo4, [0,0,0]];

           		_jet setspeedmode "full";
           		_jet flyInHeight 500;

_hint = parseText format ["<t align='center' color='%4' shadow='2' size='1.75'>Supply Drop Succesfull!</t><br/><t align='center' color='%4'>------------------------------</t><br/><t align='center' color='%5' size='1.25'>%1</t><br/><t align='center'><img size='5' image='%2'/></t><br/><t align='center' color='%5'>The<t color='%4'> %3</t>, has relinquished the supplies.</t>", _missionType, _picture, _vehicleName, _mainTextColour, _subTextColour];
[nil,nil,rHINT,_hint] call RE;


       // Closing Cargo Bay Doors
	_jet animate ["ramp_top",0];
	_jet animate ["ramp_bottom",0];


// Flying Away and deleting things etc!

Waituntil {((_jet distance getmarkerPos "supply") > 4000)};

deletevehicle _jet;
deletevehicle _pilot;
deleteMarker _supply;
deletemarker _supplytext;

Sleep 0.1;

   _land1 = getpos _cargo1;
   _land2 = getpos _cargo2;
   _land3 = getpos _cargo3;
   _land4 = getpos _cargo4;
        _S5 = "smokeShellpurple" createVehicle _land1;
        _S6 = "smokeShellpurple" createVehicle _land2;
        _S7 = "smokeShellpurple" createVehicle _land3;
        _S8 = "smokeShellpurple" createVehicle _land4;

};
};  //End fn_supplydrop function


   _rad=20000;
   _missionType = "C130 Supply Drop";
_mainTextColour = "#52bf90";
_successTextColour = "#17FF41";
_failTextColour = "#FF1717";
_subTextColour = "#FFFFFF";
_missionTimeOut = 30;
_missionDelayTime = 20;
_missionPlayerRadius = 50;
   _supply1 = "HMMWV_Ambulance"; //supply vehicle
   _supply2 = "USVehicleBox"; // Supply 2
   _supply3 = "Barrels"; // Supply 3
   _supply4 = "Land_stand_small_EP1"; // Supply 2
   _para = "ParachuteMediumWest"; // chute
   _plane = "C130J_US_EP1";  //  Vehicle

sleep 1; // INCREASE FOR LONGER ARRIVAL - Will change to seperate timing function at later date.


   _jet = createVehicle [_plane,  getMarkerPos "plane2", [], 0, "FLY"]; //Creating vehicle
   _jet flyInHeight 300;
   _jet setspeedmode "normal";
   _jet setvelocity [0,230,0];
   _jet allowDamage false;

   sleep 0.5;
       _jet setvehiclevarname "_jet";
       _grp = creategroup west;

           _pilot = _grp createunit ["USMC_Soldier_Pilot",getmarkerpos "spawn2",[],0,"FORM"];
           _pilot moveindriver _jet;
           _pilot assignAsDriver _jet;

           _picture = getText (configFile >> "cfgVehicles" >> typeOf _jet >> "picture");
	_vehicleName = getText (configFile >> "cfgVehicles" >> typeOf _jet >> "displayName");
_hint = parseText format ["<t align='center' color='%4' shadow='2' size='1.75'>Russian Supply Drop</t><br/><t align='center' color='%4'>------------------------------</t><br/><t align='center' color='%5' size='1.25'>%1</t><br/><t align='center'><img size='5' image='%2'/></t><br/><t align='center' color='%5'>A<t color='%4'> %3</t>, has been designated to fly in supplies.</t>", _missionType, _picture, _vehicleName, _mainTextColour, _subTextColour];
[nil,nil,rHINT,_hint] call RE;

call fn_findMissionSpot;

Call fn_supplydrop;
Sleep 1;


Init1.sqf

// Test cargo drop script.

waituntil {!isnil "bis_fnc_init"};

_supply1 = "HMMWV_Ambulance"; //supply vehicle
_supply2 = "USVehicleBox"; // Supply 2
_supply3 = "Barrels"; // Supply 3
_supply4 = "Land_stand_small_EP1"; // Supply 2
_para = "ParachuteMediumWest"; // chute
_plane = "C130J_US_EP1";  //  Vehicle
_drop = getmarkerPos "pos1"; // Select Random Drop Position.
//_veh = ["HMMWV_Armored","HMMWV_Ambulance_CZ_DES_EP1","HMMWV_Ambulance"] call BIS_fnc_selectRandom; // Vehicle
_spoof1 = "USVehicleBox"; // For spoofing
_spoof2 = "Barrels"; // For spoofing
_spoof3 = "Land_stand_small_EP1"; // For spoofing
Sleep 1;


// Creating the marker.
_supply = createMarker ["Supply", _drop ];
_supply setMarkershape "ELLIPSE";
_supply setMarkerColor "ColorRed";
_supply setMarkerBrush "Grid";
_supply setMarkerSize [250,250];

_supplytext = createMarker ["supplytext", _drop ];
_supplytext setMarkertype "mil_objective";
_supplytext setMarkerColor "ColorBlack";
_supplytext setmarkerText "   Supply Drop Area";

//_spoof1 = createVehicle [_spoof1,  getMarkerPos "spoof1", [], 0, "CanCollide"]; //Creating spoof
//_spoof2 = createVehicle [_spoof2,  getMarkerPos "spoof2", [], 0, "CanCollide"]; //Creating spoof
//_spoof3 = createVehicle [_spoof3,  getMarkerPos "spoof3", [], 0, "CanCollide"]; //Creating spoof


sleep 5; // INCREASE FOR LONGER ARRIVAL

_jet = createVehicle [_plane,  getMarkerPos "plane2", [], 0, "FLY"]; //Creating vehicle

sleep 0.5;

_grp = creategroup west;

_pilot = _grp createunit ["USMC_Soldier_Pilot",getmarkerpos "spawn2",[],0,"FORM"];
_pilot moveindriver _jet;
_pilot assignAsDriver _jet;

group _pilot Move getmarkerpos "supplytext";

_jet flyInHeight 300;
_jet setspeedmode "normal";
_jet setvelocity [220,0,0];
_jet allowDamage false;
_jet setDir 140;
_jet setfuel 1;

_jet setvehiclevarname "_jet";

sleep 0.5;

Waituntil {((_jet distance getmarkerPos "supplytext") < 1200)};

_jet FlyInHeight 150;

Sleep 0.5;

Waituntil {((_jet distance getmarkerPos "supplytext") < 250)};

// Dropping First Vehicle
_DropPos = getpos _jet;
sleep 0.5;
_Chute1 = createVehicle [_para,  getPos _jet, [], 0, "NONE"];
_Cargo1 = createVehicle [_supply1,  getPos _jet, [], 0, "NONE"];
_Cargo1 attachTo [_Chute1, [0,0,3]];
_Chute1 setpos _DropPos;


Waituntil {((_jet distance getmarkerPos "supplytext") > 50)};
// Dropping 2nd Vehicle. 15mtrs Behind plane to stop collision.
Sleep 1.5;
_DropPos2 = getpos _jet;
sleep 0.5;
 _Chute2 = createVehicle [_para,  getPos _jet, [], 0, "NONE"];
_Cargo2 = createVehicle [_supply2,  getPos _jet, [], 0, "NONE"];
_Cargo2 attachTo [_Chute2, [0,0,3]];
_Chute2 setpos _DropPos2;

Waituntil {((_jet distance getmarkerPos "supplytext") > 100)};
sleep 0.5;
 _DropPos3 = getpos _jet;
sleep 1;
 _Chute3 = createVehicle [_para,  getPos _jet, [], 0, "NONE"];
_Cargo3 = createVehicle [_supply3,  getPos _jet, [], 0, "NONE"];
_Cargo3 attachTo [_Chute3, [0,0,2]];
_Chute3 setpos _DropPos3;

Waituntil {((_jet distance getmarkerPos "supplytext") > 150)};
 sleep 0.5;
 _DropPos4 = getpos _jet;
sleep 1;
 _Chute4 = createVehicle [_para,  getPos _jet, [], 0, "NONE"];
_Cargo4 = createVehicle [_supply4,  getPos _jet, [], 0, "NONE"];
_Cargo4 attachTo [_Chute4, [0,0,2]];
_Chute4 setpos _DropPos4;

// Smoking 
Sleep 4;
_S1 = "smokeShellBlue" createVehicle _DropPos;
_S2 = "smokeShellRed" createVehicle _DropPos2;
_S3 = "smokeShellGreen" createVehicle _DropPos3;
_S4 = "smokeShellred" createVehicle _DropPos4;

_S1 attachto [_Cargo1, [0,0,0]];
_S2 attachto [_Cargo2, [0,0,0]];
 _S3 attachto [_Cargo3, [0,0,0]];
_S4 attachto [_Cargo4, [0,0,0]];

_jet flyInHeight 500;



// Flying Away and deleting things etc!

Waituntil {((_jet distance getmarkerPos "supply") > 4000)};

deletevehicle _jet;
deletevehicle _pilot;
deleteMarker _supply;
deletemarker _supplytext;

I'm very confused because to me it looks like init.sqf is doing the same as the other scripts. Thanks everyone.

Share this post


Link to post
Share on other sites

init1.sqf

[color=#000000][color=#FF8000]// Test cargo drop script. 
[/color][/color]while {true} do {// start the loop[color=#000000][color=#FF8000]
[/color][color=#0000BB]waituntil [/color][color=#007700]{![/color][color=#0000BB]isnil [/color][color=#DD0000]"bis_fnc_init"[/color][color=#007700]}; 

[/color][color=#0000BB]_supply1 [/color][color=#007700]= [/color][color=#DD0000]"HMMWV_Ambulance"[/color][color=#007700]; [/color][color=#FF8000]//supply vehicle 
[/color][color=#0000BB]_supply2 [/color][color=#007700]= [/color][color=#DD0000]"USVehicleBox"[/color][color=#007700]; [/color][color=#FF8000]// Supply 2 
[/color][color=#0000BB]_supply3 [/color][color=#007700]= [/color][color=#DD0000]"Barrels"[/color][color=#007700]; [/color][color=#FF8000]// Supply 3 
[/color][color=#0000BB]_supply4 [/color][color=#007700]= [/color][color=#DD0000]"Land_stand_small_EP1"[/color][color=#007700]; [/color][color=#FF8000]// Supply 2 
[/color][color=#0000BB]_para [/color][color=#007700]= [/color][color=#DD0000]"ParachuteMediumWest"[/color][color=#007700]; [/color][color=#FF8000]// chute 
[/color][color=#0000BB]_plane [/color][color=#007700]= [/color][color=#DD0000]"C130J_US_EP1"[/color][color=#007700];  [/color][color=#FF8000]//  Vehicle 
[/color][color=#0000BB]_drop [/color][color=#007700]= [/color][color=#0000BB]getmarkerPos [/color][color=#DD0000]"pos1"[/color][color=#007700]; [/color][color=#FF8000]// Select Random Drop Position. 
//_veh = ["HMMWV_Armored","HMMWV_Ambulance_CZ_DES_EP1","HMMWV_Ambulance"] call BIS_fnc_selectRandom; // Vehicle 
[/color][color=#0000BB]_spoof1 [/color][color=#007700]= [/color][color=#DD0000]"USVehicleBox"[/color][color=#007700]; [/color][color=#FF8000]// For spoofing 
[/color][color=#0000BB]_spoof2 [/color][color=#007700]= [/color][color=#DD0000]"Barrels"[/color][color=#007700]; [/color][color=#FF8000]// For spoofing 
[/color][color=#0000BB]_spoof3 [/color][color=#007700]= [/color][color=#DD0000]"Land_stand_small_EP1"[/color][color=#007700]; [/color][color=#FF8000]// For spoofing 
[/color][color=#0000BB]Sleep 1[/color][color=#007700]; 


[/color][color=#FF8000]// Creating the marker. 
[/color][color=#0000BB]_supply [/color][color=#007700]= [/color][color=#0000BB]createMarker [/color][color=#007700][[/color][color=#DD0000]"Supply"[/color][color=#007700], [/color][color=#0000BB]_drop [/color][color=#007700]]; 
[/color][color=#0000BB]_supply setMarkershape [/color][color=#DD0000]"ELLIPSE"[/color][color=#007700]; 
[/color][color=#0000BB]_supply setMarkerColor [/color][color=#DD0000]"ColorRed"[/color][color=#007700]; 
[/color][color=#0000BB]_supply setMarkerBrush [/color][color=#DD0000]"Grid"[/color][color=#007700]; 
[/color][color=#0000BB]_supply setMarkerSize [/color][color=#007700][[/color][color=#0000BB]250[/color][color=#007700],[/color][color=#0000BB]250[/color][color=#007700]]; 

[/color][color=#0000BB]_supplytext [/color][color=#007700]= [/color][color=#0000BB]createMarker [/color][color=#007700][[/color][color=#DD0000]"supplytext"[/color][color=#007700], [/color][color=#0000BB]_drop [/color][color=#007700]]; 
[/color][color=#0000BB]_supplytext setMarkertype [/color][color=#DD0000]"mil_objective"[/color][color=#007700]; 
[/color][color=#0000BB]_supplytext setMarkerColor [/color][color=#DD0000]"ColorBlack"[/color][color=#007700]; 
[/color][color=#0000BB]_supplytext setmarkerText [/color][color=#DD0000]"   Supply Drop Area"[/color][color=#007700]; 

[/color][color=#FF8000]//_spoof1 = createVehicle [_spoof1,  getMarkerPos "spoof1", [], 0, "CanCollide"]; //Creating spoof 
//_spoof2 = createVehicle [_spoof2,  getMarkerPos "spoof2", [], 0, "CanCollide"]; //Creating spoof 
//_spoof3 = createVehicle [_spoof3,  getMarkerPos "spoof3", [], 0, "CanCollide"]; //Creating spoof 


[/color][color=#0000BB]sleep 5[/color][color=#007700]; [/color][color=#FF8000]// INCREASE FOR LONGER ARRIVAL 

[/color][color=#0000BB]_jet [/color][color=#007700]= [/color][color=#0000BB]createVehicle [/color][color=#007700][[/color][color=#0000BB]_plane[/color][color=#007700],  [/color][color=#0000BB]getMarkerPos [/color][color=#DD0000]"plane2"[/color][color=#007700], [], [/color][color=#0000BB]0[/color][color=#007700], [/color][color=#DD0000]"FLY"[/color][color=#007700]]; [/color][color=#FF8000]//Creating vehicle 

[/color][color=#0000BB]sleep 0.5[/color][color=#007700]; 

[/color][color=#0000BB]_grp [/color][color=#007700]= [/color][color=#0000BB]creategroup west[/color][color=#007700]; 

[/color][color=#0000BB]_pilot [/color][color=#007700]= [/color][color=#0000BB]_grp createunit [/color][color=#007700][[/color][color=#DD0000]"USMC_Soldier_Pilot"[/color][color=#007700],[/color][color=#0000BB]getmarkerpos [/color][color=#DD0000]"spawn2"[/color][color=#007700],[],[/color][color=#0000BB]0[/color][color=#007700],[/color][color=#DD0000]"FORM"[/color][color=#007700]]; 
[/color][color=#0000BB]_pilot moveindriver _jet[/color][color=#007700]; 
[/color][color=#0000BB]_pilot assignAsDriver _jet[/color][color=#007700]; 

[/color][color=#0000BB]group _pilot Move getmarkerpos [/color][color=#DD0000]"supplytext"[/color][color=#007700]; 

[/color][color=#0000BB]_jet flyInHeight 300[/color][color=#007700]; 
[/color][color=#0000BB]_jet setspeedmode [/color][color=#DD0000]"normal"[/color][color=#007700]; 
[/color][color=#0000BB]_jet setvelocity [/color][color=#007700][[/color][color=#0000BB]220[/color][color=#007700],[/color][color=#0000BB]0[/color][color=#007700],[/color][color=#0000BB]0[/color][color=#007700]]; 
[/color][color=#0000BB]_jet allowDamage false[/color][color=#007700]; 
[/color][color=#0000BB]_jet setDir 140[/color][color=#007700]; 
[/color][color=#0000BB]_jet setfuel 1[/color][color=#007700]; 

[/color][color=#0000BB]_jet setvehiclevarname [/color][color=#DD0000]"_jet"[/color][color=#007700]; 

[/color][color=#0000BB]sleep 0.5[/color][color=#007700]; 

[/color][color=#0000BB]Waituntil [/color][color=#007700]{(([/color][color=#0000BB]_jet distance getmarkerPos [/color][color=#DD0000]"supplytext"[/color][color=#007700]) < [/color][color=#0000BB]1200[/color][color=#007700])}; 

[/color][color=#0000BB]_jet FlyInHeight 150[/color][color=#007700]; 

[/color][color=#0000BB]Sleep 0.5[/color][color=#007700]; 

[/color][color=#0000BB]Waituntil [/color][color=#007700]{(([/color][color=#0000BB]_jet distance getmarkerPos [/color][color=#DD0000]"supplytext"[/color][color=#007700]) < [/color][color=#0000BB]250[/color][color=#007700])}; 

[/color][color=#FF8000]// Dropping First Vehicle 
[/color][color=#0000BB]_DropPos [/color][color=#007700]= [/color][color=#0000BB]getpos _jet[/color][color=#007700]; 
[/color][color=#0000BB]sleep 0.5[/color][color=#007700]; 
[/color][color=#0000BB]_Chute1 [/color][color=#007700]= [/color][color=#0000BB]createVehicle [/color][color=#007700][[/color][color=#0000BB]_para[/color][color=#007700],  [/color][color=#0000BB]getPos _jet[/color][color=#007700], [], [/color][color=#0000BB]0[/color][color=#007700], [/color][color=#DD0000]"NONE"[/color][color=#007700]]; 
[/color][color=#0000BB]_Cargo1 [/color][color=#007700]= [/color][color=#0000BB]createVehicle [/color][color=#007700][[/color][color=#0000BB]_supply1[/color][color=#007700],  [/color][color=#0000BB]getPos _jet[/color][color=#007700], [], [/color][color=#0000BB]0[/color][color=#007700], [/color][color=#DD0000]"NONE"[/color][color=#007700]]; 
[/color][color=#0000BB]_Cargo1 attachTo [/color][color=#007700][[/color][color=#0000BB]_Chute1[/color][color=#007700], [[/color][color=#0000BB]0[/color][color=#007700],[/color][color=#0000BB]0[/color][color=#007700],[/color][color=#0000BB]3[/color][color=#007700]]]; 
[/color][color=#0000BB]_Chute1 setpos _DropPos[/color][color=#007700]; 


[/color][color=#0000BB]Waituntil [/color][color=#007700]{(([/color][color=#0000BB]_jet distance getmarkerPos [/color][color=#DD0000]"supplytext"[/color][color=#007700]) > [/color][color=#0000BB]50[/color][color=#007700])}; 
[/color][color=#FF8000]// Dropping 2nd Vehicle. 15mtrs Behind plane to stop collision. 
[/color][color=#0000BB]Sleep 1.5[/color][color=#007700]; 
[/color][color=#0000BB]_DropPos2 [/color][color=#007700]= [/color][color=#0000BB]getpos _jet[/color][color=#007700]; 
[/color][color=#0000BB]sleep 0.5[/color][color=#007700]; 
 [/color][color=#0000BB]_Chute2 [/color][color=#007700]= [/color][color=#0000BB]createVehicle [/color][color=#007700][[/color][color=#0000BB]_para[/color][color=#007700],  [/color][color=#0000BB]getPos _jet[/color][color=#007700], [], [/color][color=#0000BB]0[/color][color=#007700], [/color][color=#DD0000]"NONE"[/color][color=#007700]]; 
[/color][color=#0000BB]_Cargo2 [/color][color=#007700]= [/color][color=#0000BB]createVehicle [/color][color=#007700][[/color][color=#0000BB]_supply2[/color][color=#007700],  [/color][color=#0000BB]getPos _jet[/color][color=#007700], [], [/color][color=#0000BB]0[/color][color=#007700], [/color][color=#DD0000]"NONE"[/color][color=#007700]]; 
[/color][color=#0000BB]_Cargo2 attachTo [/color][color=#007700][[/color][color=#0000BB]_Chute2[/color][color=#007700], [[/color][color=#0000BB]0[/color][color=#007700],[/color][color=#0000BB]0[/color][color=#007700],[/color][color=#0000BB]3[/color][color=#007700]]]; 
[/color][color=#0000BB]_Chute2 setpos _DropPos2[/color][color=#007700]; 

[/color][color=#0000BB]Waituntil [/color][color=#007700]{(([/color][color=#0000BB]_jet distance getmarkerPos [/color][color=#DD0000]"supplytext"[/color][color=#007700]) > [/color][color=#0000BB]100[/color][color=#007700])}; 
[/color][color=#0000BB]sleep 0.5[/color][color=#007700]; 
 [/color][color=#0000BB]_DropPos3 [/color][color=#007700]= [/color][color=#0000BB]getpos _jet[/color][color=#007700]; 
[/color][color=#0000BB]sleep 1[/color][color=#007700]; 
 [/color][color=#0000BB]_Chute3 [/color][color=#007700]= [/color][color=#0000BB]createVehicle [/color][color=#007700][[/color][color=#0000BB]_para[/color][color=#007700],  [/color][color=#0000BB]getPos _jet[/color][color=#007700], [], [/color][color=#0000BB]0[/color][color=#007700], [/color][color=#DD0000]"NONE"[/color][color=#007700]]; 
[/color][color=#0000BB]_Cargo3 [/color][color=#007700]= [/color][color=#0000BB]createVehicle [/color][color=#007700][[/color][color=#0000BB]_supply3[/color][color=#007700],  [/color][color=#0000BB]getPos _jet[/color][color=#007700], [], [/color][color=#0000BB]0[/color][color=#007700], [/color][color=#DD0000]"NONE"[/color][color=#007700]]; 
[/color][color=#0000BB]_Cargo3 attachTo [/color][color=#007700][[/color][color=#0000BB]_Chute3[/color][color=#007700], [[/color][color=#0000BB]0[/color][color=#007700],[/color][color=#0000BB]0[/color][color=#007700],[/color][color=#0000BB]2[/color][color=#007700]]]; 
[/color][color=#0000BB]_Chute3 setpos _DropPos3[/color][color=#007700]; 

[/color][color=#0000BB]Waituntil [/color][color=#007700]{(([/color][color=#0000BB]_jet distance getmarkerPos [/color][color=#DD0000]"supplytext"[/color][color=#007700]) > [/color][color=#0000BB]150[/color][color=#007700])}; 
 [/color][color=#0000BB]sleep 0.5[/color][color=#007700]; 
 [/color][color=#0000BB]_DropPos4 [/color][color=#007700]= [/color][color=#0000BB]getpos _jet[/color][color=#007700]; 
[/color][color=#0000BB]sleep 1[/color][color=#007700]; 
 [/color][color=#0000BB]_Chute4 [/color][color=#007700]= [/color][color=#0000BB]createVehicle [/color][color=#007700][[/color][color=#0000BB]_para[/color][color=#007700],  [/color][color=#0000BB]getPos _jet[/color][color=#007700], [], [/color][color=#0000BB]0[/color][color=#007700], [/color][color=#DD0000]"NONE"[/color][color=#007700]]; 
[/color][color=#0000BB]_Cargo4 [/color][color=#007700]= [/color][color=#0000BB]createVehicle [/color][color=#007700][[/color][color=#0000BB]_supply4[/color][color=#007700],  [/color][color=#0000BB]getPos _jet[/color][color=#007700], [], [/color][color=#0000BB]0[/color][color=#007700], [/color][color=#DD0000]"NONE"[/color][color=#007700]]; 
[/color][color=#0000BB]_Cargo4 attachTo [/color][color=#007700][[/color][color=#0000BB]_Chute4[/color][color=#007700], [[/color][color=#0000BB]0[/color][color=#007700],[/color][color=#0000BB]0[/color][color=#007700],[/color][color=#0000BB]2[/color][color=#007700]]]; 
[/color][color=#0000BB]_Chute4 setpos _DropPos4[/color][color=#007700]; 

[/color][color=#FF8000]// Smoking  
[/color][color=#0000BB]Sleep 4[/color][color=#007700]; 
[/color][color=#0000BB]_S1 [/color][color=#007700]= [/color][color=#DD0000]"smokeShellBlue" [/color][color=#0000BB]createVehicle _DropPos[/color][color=#007700]; 
[/color][color=#0000BB]_S2 [/color][color=#007700]= [/color][color=#DD0000]"smokeShellRed" [/color][color=#0000BB]createVehicle _DropPos2[/color][color=#007700]; 
[/color][color=#0000BB]_S3 [/color][color=#007700]= [/color][color=#DD0000]"smokeShellGreen" [/color][color=#0000BB]createVehicle _DropPos3[/color][color=#007700]; 
[/color][color=#0000BB]_S4 [/color][color=#007700]= [/color][color=#DD0000]"smokeShellred" [/color][color=#0000BB]createVehicle _DropPos4[/color][color=#007700]; 

[/color][color=#0000BB]_S1 attachto [/color][color=#007700][[/color][color=#0000BB]_Cargo1[/color][color=#007700], [[/color][color=#0000BB]0[/color][color=#007700],[/color][color=#0000BB]0[/color][color=#007700],[/color][color=#0000BB]0[/color][color=#007700]]]; 
[/color][color=#0000BB]_S2 attachto [/color][color=#007700][[/color][color=#0000BB]_Cargo2[/color][color=#007700], [[/color][color=#0000BB]0[/color][color=#007700],[/color][color=#0000BB]0[/color][color=#007700],[/color][color=#0000BB]0[/color][color=#007700]]]; 
 [/color][color=#0000BB]_S3 attachto [/color][color=#007700][[/color][color=#0000BB]_Cargo3[/color][color=#007700], [[/color][color=#0000BB]0[/color][color=#007700],[/color][color=#0000BB]0[/color][color=#007700],[/color][color=#0000BB]0[/color][color=#007700]]]; 
[/color][color=#0000BB]_S4 attachto [/color][color=#007700][[/color][color=#0000BB]_Cargo4[/color][color=#007700], [[/color][color=#0000BB]0[/color][color=#007700],[/color][color=#0000BB]0[/color][color=#007700],[/color][color=#0000BB]0[/color][color=#007700]]]; 

[/color][color=#0000BB]_jet flyInHeight 500[/color][color=#007700]; 



[/color][color=#FF8000]// Flying Away and deleting things etc! 

[/color][color=#0000BB]Waituntil [/color][color=#007700]{(([/color][color=#0000BB]_jet distance getmarkerPos [/color][color=#DD0000]"supply"[/color][color=#007700]) > [/color][color=#0000BB]4000[/color][color=#007700])}; 

[/color][color=#0000BB]deletevehicle _jet[/color][color=#007700]; 
[/color][color=#0000BB]deletevehicle _pilot[/color][color=#007700]; 
[/color][color=#0000BB]deleteMarker _supply[/color][color=#007700]; 
[/color][color=#0000BB]deletemarker _supplytext[/color][color=#007700]; 

[/color][/color]sleep 900 + (random 900); //15 minutes minimum + random addition, up to another 15 minutes for a total of possible 30min
}; // end of the loop

Edited by Iceman77

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  

×