Jump to content

[RELEASE] Vehicle Patrols on missions


Recommended Posts

/*
	Medical Supply Camp by lazyink (Full credit for original code to TheSzerdi & TAW_Tonic)
	Updated to New Mission Format by Vampire
*/

private ["_missName","_coords","_base1","_base2","_base3","_base4","_base5","_base6","_base7","_base8","_base9","_base10","_base11","_base12","_base13","_base14","_base15","_base16","_base17","_veh1","_vehicle","_crate","_patrol"];

//Name of the Mission
_missName = "Bandit Medical Camp";

//DZMSFindPos loops BIS_fnc_findSafePos until it gets a valid result
_coords = call DZMSFindPos;

[nil,nil,rTitleText,"Bandits have Opened a Medical Camp!\nStop Them from Re-Supplying the Region!", "PLAIN",10] call RE;

//DZMSAddMajMarker is a simple script that adds a marker to the location
[_coords,_missname] ExecVM DZMSAddMajMarker;

//Create the scenery
_base1 = createVehicle ["Land_fort_artillery_nest",[(_coords select 0) - 5.939,(_coords select 1) + 10.0459,0],[], 0, "CAN_COLLIDE"];
_base1 setDir -31.158424;
[_base1] call DZMSProtectObj;
_base1 setVehicleLock "LOCKED";
_base1 setPos [(_coords select 0) - 5.939,(_coords select 1) + 10.0459,0];

_base2 = createVehicle ["Land_fort_artillery_nest",[(_coords select 0) + 6.3374, (_coords select 1) - 11.1944,0],[], 0, "CAN_COLLIDE"];
_base2 setDir -211.14516;
[_base2] call DZMSProtectObj;
_base2 setVehicleLock "LOCKED";
_base2 setPos [(_coords select 0) + 6.3374, (_coords select 1) - 11.1944,0];

_base3 = createVehicle ["Land_fort_rampart",[(_coords select 0) + 12.2456, (_coords select 1) + 6.249,0],[], 0, "CAN_COLLIDE"];
_base3 setDir -120.93051;
[_base3] call DZMSProtectObj;
_base3 setVehicleLock "LOCKED";
_base3 setPos [(_coords select 0) + 12.2456, (_coords select 1) + 6.249,0];

_base4 = createVehicle ["Land_fort_rampart",[(_coords select 0) - 11.4253, (_coords select 1) - 7.628,0],[], 0, "CAN_COLLIDE"];
_base4 setDir 59.42643;
[_base4] call DZMSProtectObj;
_base4 setVehicleLock "LOCKED";
_base4 setPos [(_coords select 0) - 11.4253, (_coords select 1) - 7.628,0];

_base5 = createVehicle ["MedBox0",[(_coords select 0) - 7.1519, (_coords select 1) + 1.8144,0],[], 0, "CAN_COLLIDE"];
_base5 setDir -29.851013;
[_base5] call DZMSProtectObj;

_base6 = createVehicle ["MedBox0",[(_coords select 0) - 7.4116, (_coords select 1) + 2.5244,0],[], 0, "CAN_COLLIDE"];
[_base6] call DZMSProtectObj;

_base7 = createVehicle ["WeaponHolder_ItemToolbox",[(_coords select 0) - 7.7041, (_coords select 1) + 3.332,0],[], 0, "CAN_COLLIDE"];
_base7 setDir -106.46461;
[_base7] call DZMSProtectObj;

_base8 = createVehicle ["Land_CamoNetVar_EAST",[(_coords select 0) + 4.1738, (_coords select 1) - 7.9112],[], 0, "CAN_COLLIDE"];
_base8 setDir -27.004126;
[_base8] call DZMSProtectObj;
_base8 setVehicleLock "LOCKED";
_base8 setPos [(_coords select 0) + 4.1738, (_coords select 1) - 7.9112];

_base9 = createVehicle ["PowGen_Big",[(_coords select 0) - 0.8936, (_coords select 1) + 8.1582,0],[], 0, "CAN_COLLIDE"];
_base9 setDir -56.044361;
[_base9] call DZMSProtectObj;

_base10 = createVehicle ["Barrel5",[(_coords select 0) - 2.5074, (_coords select 1) + 7.3466,0],[], 0, "CAN_COLLIDE"];
[_base10] call DZMSProtectObj;

_base11 = createVehicle ["Barrel5",[(_coords select 0) - 3.293, (_coords select 1) + 7.9179,0],[], 0, "CAN_COLLIDE"];
[_base11] call DZMSProtectObj;

_base12 = createVehicle ["Land_Campfire_burning",[(_coords select 0) + 3.1367, (_coords select 1) - 5.087,0],[], 0, "CAN_COLLIDE"];
[_base12] call DZMSProtectObj;

_base13 = createVehicle ["FoldChair",[(_coords select 0) + 0.8589, (_coords select 1) - 6.2676,0],[], 0, "CAN_COLLIDE"];
_base13 setDir -132.43658;
[_base13] call DZMSProtectObj;

_base14 = createVehicle ["FoldChair",[(_coords select 0) + 2.6909, (_coords select 1) - 7.4805,0],[], 0, "CAN_COLLIDE"];
_base14 setDir -184.45828;
[_base14] call DZMSProtectObj;

_base15 = createVehicle ["FoldChair",[(_coords select 0) + 5.4175, (_coords select 1) - 5.4903,0],[], 0, "CAN_COLLIDE"];
_base15 setDir 96.993355;
[_base15] call DZMSProtectObj;

_base16 = createVehicle ["FoldChair",[(_coords select 0) + 4.5722, (_coords select 1) - 7.2305,0],[], 0, "CAN_COLLIDE"];
_base16 setDir 142.91867;
[_base16] call DZMSProtectObj;

_base17 = createVehicle ["FoldChair",[(_coords select 0) + 5.0542, (_coords select 1) - 3.4649,0],[], 0, "CAN_COLLIDE"];
_base17 setDir 55.969147;
[_base17] call DZMSProtectObj;

//Create the vehicles
_veh1 = ["small"] call DZMSGetVeh;
_vehicle = createVehicle [_veh1,[(_coords select 0) - 17.5078, (_coords select 1) + 5.2578,0],[], 0, "CAN_COLLIDE"];
[_vehicle] call DZMSSetupVehicle;

//Create the loot
_crate = createVehicle ["USLaunchersBox",[(_coords select 0) - 6.8277, (_coords select 1) + 5.6748,0],[], 0, "CAN_COLLIDE"];
[_crate,"medical"] ExecVM DZMSBoxSetup;

//Spawn patrol
_patrol = ["patrol"] call DZMSGetVeh;
[[_coords],   //Position to patrol
[_coords], // Position to spawn
75, //Radius of patrol
10,                     //Number of waypoints to give
_patrol, //Classname of vehicle (make sure it has driver and gunner)
1 //Skill level of units 
] call DZMSVehiclePatrol;

//DZMSAISpawn spawns AI to the mission.
//Usage: [_coords, count, skillLevel, unitArray]
[[(_coords select 0) - 0.5635,(_coords select 1) + 0.3173,0],3,1,"DZMSUnitsMajor"] call DZMSAISpawn;
sleep 5;
[[(_coords select 0) - 0.5635,(_coords select 1) + 0.3173,0],3,1,"DZMSUnitsMajor"] call DZMSAISpawn;
sleep 5;
[[(_coords select 0) - 0.5635,(_coords select 1) + 0.3173,0],3,1,"DZMSUnitsMajor"] call DZMSAISpawn;
sleep 5;
[[(_coords select 0) - 0.5635,(_coords select 1) + 0.3173,0],3,1,"DZMSUnitsMajor"] call DZMSAISpawn;


//Wait until the player is within 30 meters and also meets the kill req
[_coords,"DZMSUnitsMajor"] call DZMSWaitMissionComp;

//Call DZMSSaveVeh to attempt to save the vehicles to the database
//If saving is off, the script will exit.
[_vehicle] ExecVM DZMSSaveVeh;

//Let everyone know the mission is over
[nil,nil,rTitleText,"Survivors have Taken Control of the Camp and Medical Supplies.", "PLAIN",6] call RE;
diag_log text format["[DZMS]: Major SM3 Medical Camp Mission has Ended."];
deleteMarker "DZMSMajMarker";
deleteMarker "DZMSMajDot";

//Let the timer know the mission is over
DZMSMajDone = true;

No RTP errors

Link to comment
Share on other sites

//Spawn patrol
_patrol = ["patrol"] call DZMSGetVeh;
[[_coords],   //Position to patrol
[_coords], // Position to spawn
75, //Radius of patrol
10,                     //Number of waypoints to give
_patrol, //Classname of vehicle (make sure it has driver and gunner)
1 //Skill level of units 
] call DZMSVehiclePatrol;

 

When I was testing this, I was using fixed coordinates. It's possible that [_coords], needs to be replaced with _coords, 

 

In other words:

//Spawn patrol
_patrol = ["patrol"] call DZMSGetVeh;
[_coords, //Position to patrol
_coords, // Position to spawn
75, //Radius of patrol
10, //Number of waypoints to give
_patrol, //Classname of vehicle (make sure it has driver and gunner)
1 //Skill level of units
] call DZMSVehiclePatrol;

Please try that and let me know and if that fixes it, then I'll change the original post.

Link to comment
Share on other sites

I apologize for the problems people have had with this. When I was testing, I was using set coordinates and I used the variable _veh instead of _patrol, so when I went to post this, I didn't make all the proper edits. I've now fixed the original post one more time. I've changed [_coords] to just _coords without the []. I've tested it on my server and it's working properly now.

 

If anyone has an issue with it not working, then go back and make sure your code is exactly like the example. If it still doesn't work, post you mission through a pastebin.com link and post any error that appears in your RPT file.

Link to comment
Share on other sites

This code is completely untested right now, but is my first attempt to clean it up and match code from other parts of DZMS.

/*																		//
	Usage: [patrolPos,startingPos,radius,waypointNum,skillLevel] execVM "dir\DZMSVehiclePatrol.sqf";
		PatrolPos is the coordinates to patrol at [X,Y,Z]
		StartingPos is the coordinates to spawn at [X,Y,Z]
		Radius is the radius of the patrol area from PatrolPos
		WaypointNum is the number of waypoints along the patrol
		SkillLevel is the skill number defined in DZMSAIConfig.sqf
*/																		//
private ["_patrolPos","_startingPos","_wpRadius","_wpNum","_skill","_unitArrayName","_unitGroup","_veh","_vehicle","_aiskin","_driver","_gunner","_wp","_unitMissionCount"];
_patrolPos = _this select 0;
_startingPos = _this select 1;
_wpRadius = _this select 2;
_wpNum = _this select 3;
_skill = _this select 4;
_unitArrayName = _this select 5;

//Probably unnecessary, but prevents client AI stacking
if (!isServer) exitWith {};

//Create the unit group. We use east by default.
_unitGroup = createGroup east;

//Let's pick a vehicle from the array
_veh = ["patrol"] call DZMSGetVeh;

//Let's spawn the vehicle
_vehicle = createVehicle [_veh, [(_startingPos select 0),(_startingPos select 1),10], [], 0, "CAN_COLLIDE"];

//DZMSSetupVehicle prevents the vehicle from disappearing and sets fuel and such
[_vehicle] call DZMSSetupVehicle;

//Fill fuel tank to at least 20%
if (fuel _vehicle < .2) then {_vehicle setFuel .2;};

//Not sure if these are really needed
_vehicle engineOn true;
_vehicle allowCrewInImmobile true;

//Need to figure out how to add ammo to the first turret on the vehicle. Until then...
_vehicle setVehicleAmmo 1; 
_vehicle lock true;

//Later, add a cleanup to remove ammo from the vehicle on gunner's death

//Pick a skin from the array
_aiskin = DZMSBanditSkins call BIS_fnc_selectRandom;

//Spawn the driver and add him to the vehicle
_driver = _unitGroup createUnit ["_aiskin", [0,0,0], [], 1, "PRIVATE"];
[_driver] joinSilent _unitGroup;
_driver assignAsDriver _vehicle;
_driver moveInDriver _vehicle;

//Spawn the gunner and add him to the first turret
_gunner = _unitGroup createUnit ["_aiskin", [0,0,0], [], 1, "PRIVATE"];
[_gunner] joinSilent _unitGroup;
_gunner assignAsGunner _vehicle;
_gunner moveInTurret [_vehicle,[0]];

//Setup each unit (taken from DZMSAISpawn.sqf)
//Too bad we can't call DZMSAISpawn directly and have it return a unit as that would make things easier
{
	private ["_unit"];
	_unit = _x;

	//Add the behavior
	_unit enableAI "TARGET";
	_unit enableAI "AUTOTARGET";
	_unit enableAI "MOVE";
	_unit enableAI "ANIM";
	_unit enableAI "FSM";
	_unit setCombatMode "RED";
	_unit setBehaviour "COMBAT";

	//Remove the items he spawns with by default
	removeAllWeapons _unit;
	removeAllItems _unit;

	//Now we need to figure out their loadout, and assign it

	//Get the weapon array based on skill
	_weaponArray = [_skill] call DZMSGetWeapon;

	_weapon = _weaponArray select 0;
	_magazine = _weaponArray select 1;

	//diag_log text format ["[DZMS]: AI Weapon:%1 / AI Magazine:%2",_weapon,_magazine];

	//Get the gear array
	_aigearArray = [DZMSGear0,DZMSGear1,DZMSGear2,DZMSGear3,DZMSGear4];
	_aigear = _aigearArray call BIS_fnc_selectRandom;
	_gearmagazines = _aigear select 0;
	_geartools = _aigear select 1;

	//Gear the AI backpack
	_aipack = DZMSPacklist call BIS_fnc_selectRandom;

	//Lets add it to the Unit
	for "_i" from 1 to 3 do {
		_unit addMagazine _magazine;
	};
	_unit addWeapon _weapon;
	_unit selectWeapon _weapon;

	_unit addBackpack _aipack;

	if (DZMSUseNVG) then {
		_unit addWeapon "NVGoggles";
	};

	{
		_unit addMagazine _x
	} forEach _gearmagazines;

	{
		_unit addWeapon _x
	} forEach _geartools;

	//Lets set the skills
	switch (_skill) do {
		case 0: {_aicskill = DZMSSkills0;};
		case 1: {_aicskill = DZMSSkills1;};
		case 2: {_aicskill = DZMSSkills2;};
		case 3: {_aicskill = DZMSSkills3;};
	};

	{
		_unit setSkill [(_x select 0),(_x select 1)]
	} forEach _aicskill;

	//Lets prepare the unit for cleanup
	_unit addEventHandler ["Killed",{ [(_this select 0), (_this select 1)] ExecVM DZMSAIKilled; }];
	_unit setVariable ["DZMSAI", true];
} forEach (units _unitGroup);

for "_i" from 1 to _wpNum do {
	_wp = _unitGroup addWaypoint [[(_patrolPos select 0),(_patrolPos select 1),0],_wpRadius];
	_wp setWaypointType "SAD";
	_wp setWaypointCompletionRadius 200;
};

_wp = _unitGroup addWaypoint [[(_patrolPos select 0),(_patrolPos select 1),0],100];
_wp setWaypointType "CYCLE";
_wp setWaypointCompletionRadius 200;

// load the unit groups into a passed array name so they can be cleaned up later
call compile format["
%1 = %1 + (units _unitGroup); 
_unitMissionCount = count %1;
",_unitArrayName];

diag_log text format["[DZMS]: (%3) %1 AI Spawned, %2 units in mission.",count (units _unitGroup),_unitMissionCount,_unitArrayName];

I give no guarantees about any of this as I don't have a test server to work on, so errors/fixes are gladly welcomed. The one change is that you no longer pass the classname of the patrol vehicle as that is already taken care. Still need to find a way to arm a DZE vehicle and remove any ammo on the gunner's death. I'm not familiar enough with BIS to know if you can stack the same kind of event handlers.

P.S. Update to include the unitArray.

Edited by TheFarix
Link to comment
Share on other sites

Thanks for this, it's got potential for more creativity with DZMS.

 

One question, if I have different missions in mind to write, and I have a few different vehicle arrays I want to use for seperate missions, how do I implement them into the actual mission code? Say at most missions I'd like a PK pickup or a DSHkM, but at one particular mission I'd want a HMMWV M240 or a Armored SUV? The default array for the first pair obviously are in "patrol", the second pair I want are currently in "convoy" just for example.

//Spawn patrol
_patrol = ["convoy"] call DZMSGetVeh;

This doesn't bring up a HMMWV or SUV, in my case. It spawns in a DSHkM or PK. How do I make it right with this system?

		case "convoy": {_vehArray = DZMSConvoy;};

and

DZMSConvoy = ["HMMWV_Armored","Armored_SUV_PMC"];

are both set up in their correct places.

 

Thanks.

Link to comment
Share on other sites

Thanks for this, it's got potential for more creativity with DZMS.

 

One question, if I have different missions in mind to write, and I have a few different vehicle arrays I want to use for seperate missions, how do I implement them into the actual mission code? Say at most missions I'd like a PK pickup or a DSHkM, but at one particular mission I'd want a HMMWV M240 or a Armored SUV? The default array for the first pair obviously are in "patrol", the second pair I want are currently in "convoy" just for example.

//Spawn patrol
_patrol = ["convoy"] call DZMSGetVeh;

This doesn't bring up a HMMWV or SUV, in my case. It spawns in a DSHkM or PK. How do I make it right with this system?

		case "convoy": {_vehArray = DZMSConvoy;};

and

DZMSConvoy = ["HMMWV_Armored","Armored_SUV_PMC"];

are both set up in their correct places.

 

Thanks.

 

Is DZMSConvoy = ["HMMWV_Armored","Armored_SUV_PMC"]; in the DZMSConfig.sqf file? Also, are those the right classnames for those vehicles?

Link to comment
Share on other sites

The classes you are looking for are HMMWV_M1151_M2_CZ_DES_EP1_DZ and ArmoredSUV_PMC_DZ.

 

Is DZMSConvoy = ["HMMWV_Armored","Armored_SUV_PMC"]; in the DZMSConfig.sqf file? Also, are those the right classnames for those vehicles?

Hello and thanks. The classnames were examples. I tried with HMMWV_M1151_M2_CZ_DES_EP1_DZ & some other specific Epoch-class vehicles before posting my query. And yes, the line below is in DZMSConfig.sqf. I've made other arrays in there already that work fine for regular missions that I wrote or edited, before ever trying your patrols code.

DZMSConvoy = ["classname","classname"];

EDIT:

I suppose the part that makes the "patrol" class vehicles spawn is in DZMSVehiclePatrol.sqf

_patrol = ["patrol"] call DZMSGetVeh;

I've tried changing that to the line below but that doesn't make a difference.

_patrol = ["patrol","convoy"] call DZMSGetVeh;

Is there an alternative way to just spawn in one particular vehicle for a patrol on one particular mission? Such as using createvehicle or something?

Link to comment
Share on other sites

The problem is that DZMSVehiclePatrol itself calls DZMSGetVeh to get a classname and any classname you passed to it is ignored. One other issues is that vehicles created by DZMSVehiclePatrol will not be saved into the database regardless of whether DZMSSaveVehicles is set to true or not. Maybe these can be addressed by rethinking how DZMSVehiclePatrol is invoked.

Link to comment
Share on other sites

The problem is that DZMSVehiclePatrol itself calls DZMSGetVeh to get a classname and any classname you passed to it is ignored. One other issues is that vehicles created by DZMSVehiclePatrol will not be saved into the database regardless of whether DZMSSaveVehicles is set to true or not. Maybe these can be addressed by rethinking how DZMSVehiclePatrol is invoked.

 

This should work: Just comment out "_patrol = ["patrol"] call DZMSGetVeh;" in DZMSVehiclePatrol.sqf since _patrol is defined in the mission. I'm not real sure why I even have that in the DZMSVehiclePatrol.sqf.  

 

The problem of not being able to save the vehicles that are spawning was addressed in the first post. Due to my limited knowledge, I can't make it so the vehicles can be saved. I'm sure someone can expand on that, though, and fix it.

Link to comment
Share on other sites

Just to add, the only way to add a second vehicle array was to have a second "install" of the add-on, and rename everything to have a 2 on the end or something similar.

 

i.e.

_patrol --> _patrol2

"patrol" --> "patrol2"

DZMSVehiclePatrol.sqf --> DZMSVehiclePatrol2.sqf

 

And so on. I wanted lower-end armed vehicles for most missions, and then higher-end vehicles for the biggest two missions. With this I now can. Thanks again.

Link to comment
Share on other sites

AI not spawning at missions only at the vehicle portal ones

Do I use this one or the other one?
 

//Spawn patrol
_patrol = ["patrol"] call DZMSGetVeh;
[_coords,   //Position to patrol
_coords, // Position to spawn
75, //Radius of patrol
10,                     //Number of waypoints to give
_patrol, //Classname of vehicle (make sure it has driver and gunner)
1 //Skill level of units 
] call DZMSVehiclePatrol;
Link to comment
Share on other sites

Getting this error
 

5:31:45 Error in expression <= ["patrol"] call DZMSGetVeh;
_patrol = createVehicle [_patrol, [(_startingpos s>
5:31:45 Error position: <createVehicle [_patrol, [(_startingpos s>
5:31:45 Error Type Any, expected String
5:31:45 File z\addons\dayz_server\DZMS\Scripts\DZMSVehiclePatrol.sqf, line 17

Mission.sqf file

/*
	Bandit Supply Heli Crash by lazyink (Full credit for original code to TheSzerdi & TAW_Tonic)
	New Mission Format by Vampire
*/

private ["_missName","_coords","_ranChopper","_chopper","_truck","_trash","_trash2","_crate","_crate2","_patrol","_patrol"];

//Name of the Mission
_missName = "Helicopter Landing";
MAmission = "Helicopter Landing";
publicVariable "MAmission";
//DZMSFindPos loops BIS_fnc_findSafePos until it gets a valid result
_coords = call DZMSFindPos;

[nil,nil,rTitleText,"A Supply Helicopter has been Forced to Land!\nStop the Bandits from Taking Control of it!", "PLAIN",10] call RE;

//DZMSAddMajMarker is a simple script that adds a marker to the location
[_coords,_missname] ExecVM DZMSAddMajMarker;

//We create the vehicles like normal
_ranChopper = ["heli"] call DZMSGetVeh;
_chopper = createVehicle [_ranChopper,_coords,[], 0, "NONE"];

//DZMSSetupVehicle prevents the vehicle from disappearing and sets fuel and such
[_chopper] call DZMSSetupVehicle;
_chopper setDir -36.279881;

_truck = createVehicle ["HMMWV_DZ",[(_coords select 0) - 8.7802,(_coords select 1) + 6.874,0],[], 0, "CAN_COLLIDE"];
[_truck] call DZMSSetupVehicle;
//Spawn patrol
_patrol = ["patrol"] call DZMSGetVeh;
[_coords,   //Position to patrol
_coords, // Position to spawn
75, //Radius of patrol
10,                     //Number of waypoints to give
_patrol, //Classname of vehicle (make sure it has driver and gunner)
1 //Skill level of units 
] call DZMSVehiclePatrol;
//Lets add the scenery
_trash = createVehicle ["Body1",[(_coords select 0) - 3.0185,(_coords select 1) - 0.084,0],[], 0, "CAN_COLLIDE"];
_trash2 = createVehicle ["Body2",[(_coords select 0) + 1.9248,(_coords select 1) + 2.1201,0],[], 0, "CAN_COLLIDE"];
[_trash] call DZMSProtectObj;
[_trash2] call DZMSProtectObj;

//DZMSBoxFill fills the box, DZMSProtectObj prevents it from disappearing
_crate = createVehicle ["USLaunchersBox",[(_coords select 0) - 6.1718,(_coords select 1) + 0.6426,0],[], 0, "CAN_COLLIDE"];
[_crate,"weapons"] ExecVM DZMSBoxSetup;
[_crate] call DZMSProtectObj;

_crate2 = createVehicle ["USLaunchersBox",[(_coords select 0) - 7.1718,(_coords select 1) + 1.6426,0],[], 0, "CAN_COLLIDE"];
[_crate2,"weapons"] ExecVM DZMSBoxSetup;
[_crate2] call DZMSProtectObj;

//DZMSAISpawn spawns AI to the mission.
//Usage: [_coords, count, skillLevel, unitArray]
[[(_coords select 0) - 8.4614,(_coords select 1) - 5.0527,0],6,1,"DZMSUnitsMajor"] call DZMSAISpawn;
sleep 5;
[[(_coords select 0) - 8.4614,(_coords select 1) - 5.0527,0],4,1,"DZMSUnitsMajor"] call DZMSAISpawn;
sleep 5;
[[(_coords select 0) + 7.5337,(_coords select 1) + 4.2656,0],4,1,"DZMSUnitsMajor"] call DZMSAISpawn;
sleep 5;
[[(_coords select 0) + 7.5337,(_coords select 1) + 4.2656,0],4,1,"DZMSUnitsMajor"] call DZMSAISpawn;
sleep 5;

//Wait until the player is within 30 meters and also meets the kill req
[_coords,"DZMSUnitsMajor"] call DZMSWaitMissionComp;

//Call DZMSSaveVeh to attempt to save the vehicles to the database
//If saving is off, the script will exit.
[_chopper] ExecVM DZMSSaveVeh;
[_truck] ExecVM DZMSSaveVeh;

//Let everyone know the mission is over
[nil,nil,rTitleText,"The Helicopter has been Taken by Survivors!", "PLAIN",6] call RE;
diag_log text format["[DZMS]: Major SM4 Helicopter Landing Mission has Ended."];
deleteMarker "DZMSMajMarker";
deleteMarker "DZMSMajDot";
MAmission = "";
publicVariable "MAmission";
//Let the timer know the mission is over
DZMSMajDone = true;

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×
×
  • Create New...