Hey.. I've a few problems with players who use bugs with vehicles to get loot from the AI. So i like to add a trigger at the WAI marker, which destroy player vehicle if they drive into the mission area.
But there is a mistake at my idea, so the missions spawns without the trigger...
But there is also no Error at the rpt file.
Hope someone could help me.
There is one of the Mission files with my addet trigger...
//Armed Vehicle
private ["_playerPresent","_cleanmission","_currenttime","_starttime","_missiontimeout","_vehname","_veh","_position","_vehclass","_vehdir","_objPosition","_Trigger1","_Trigger2","_Trigger3"];
_vehclass = armed_vehicle call BIS_fnc_selectRandom;
_vehname = getText (configFile >> "CfgVehicles" >> _vehclass >> "displayName");
_position = [getMarkerPos "center",0,5500,10,0,2000,0] call BIS_fnc_findSafePos;
antiauto1 = _Trigger1;
antiauto2 = _Trigger2;
antiauto3 = _Trigger3;
diag_log format["WAI: Mission Armed Vehicle Started At %1",_position];
_Trigger1 = createTrigger ["EmptyDetector", _position];
_Trigger1 setTriggerArea [380, 380, 0, false];
_Trigger1 setTriggerActivation ["ANY", "PRESENT", true];
_Trigger1 setTriggerTimeout [0, 0, 0, true];
_Trigger1 setTriggerStatements ["(player distance antiauto1) < 380;", "if ((vehicle player) isKindOf (""Car"")) then {titleText [""Warning, you are near a Mission. Please stop and leave your car or turn back."", ""PLAIN DOWN""];} else {""""};", ""];
_Trigger2 = createTrigger ["EmptyDetector", _position];
_Trigger2 setTriggerArea [330, 330, 0, false];
_Trigger2 setTriggerActivation ["ANY", "PRESENT", true];
_Trigger2 setTriggerTimeout [0, 0, 0, true];
_Trigger2 setTriggerStatements ["(player distance antiauto2) < 330;", "if ((vehicle player) isKindOf (""Car"")) then {titleText [""Last Warning! You are near a Mission. Stop your car or turn back!"", ""PLAIN DOWN""];} else {""""};", ""];
_Trigger3 = createTrigger ["EmptyDetector", _position];
_Trigger3 setTriggerArea [280, 280, 0, false];
_Trigger3 setTriggerActivation ["ANY", "PRESENT", true];
_Trigger3 setTriggerTimeout [0, 0, 0, true];
_Trigger3 setTriggerStatements ["(player distance antiauto3) < 280;", "if ((vehicle player) isKindOf (""Car"")) then {titleText [""You have been warned several times!"", ""PLAIN DOWN""]; player setdamage 1;} else {""""};", ""];
//Chain Bullet Box
_box = createVehicle ["USBasicWeaponsBox",[(_position select 0),(_position select 1) + 5,0], [], 0, "CAN_COLLIDE"];
[_box] call Chain_Bullet_Box;
//Armed Land Vehicle
_veh = createVehicle [_vehclass,_position, [], 0, "CAN_COLLIDE"];
_vehdir = round(random 360);
_veh setDir _vehdir;
_veh setVariable ["ObjectID","1",true];
PVDZE_serverObjectMonitor set [count PVDZE_serverObjectMonitor,_veh];
diag_log format["WAI: Mission Armed Vehicle spawned a %1",_vehname];
_objPosition = getPosATL _veh;
//[_veh,[_vehdir,_objPosition],_vehclass,true,"0"] call custom_publish;
//Troops
_rndnum = round (random 3) + 3;
[[_position select 0, _position select 1, 0], //position
_rndnum, //Number Of units
1, //Skill level 0-1. Has no effect if using custom skills
"Random", //Primary gun set number. "Random" for random weapon set.
4, //Number of magazines
"", //Backpack "" for random or classname here.
"Ins_Soldier_Sapper", //Skin "" for random or classname here.
"Random", //Gearset number. "Random" for random gear set.
true // Mission true or false
] call spawn_group;
[[_position select 0, _position select 1, 0], //position
4, //Number Of units
1, //Skill level 0-1. Has no effect if using custom skills
"Random", //Primary gun set number. "Random" for random weapon set.
4, //Number of magazines
"", //Backpack "" for random or classname here.
"Ins_Soldier_Sapper", //Skin "" for random or classname here.
"Random", //Gearset number. "Random" for random gear set.
true // Mission true or false
] call spawn_group;
[[_position select 0, _position select 1, 0], //position
4, //Number Of units
1, //Skill level 0-1. Has no effect if using custom skills
"Random", //Primary gun set number. "Random" for random weapon set.
4, //Number of magazines
"", //Backpack "" for random or classname here.
"Ins_Soldier_Sapper", //Skin "" for random or classname here.
"Random", //Gearset number. "Random" for random gear set.
true // mission true
] call spawn_group;
[[_position select 0, _position select 1, 0], //position
4, //Number Of units
1, //Skill level 0-1. Has no effect if using custom skills
"Random", //Primary gun set number. "Random" for random weapon set.
4, //Number of magazines
"", //Backpack "" for random or classname here.
"Ins_Soldier_Sapper", //Skin "" for random or classname here.
"Random", //Gearset number. "Random" for random gear set.
true // mission true
] call spawn_group;
//Turrets
[[[(_position select 0), (_position select 1) + 10, 0]], //position(s) (can be multiple).
"M2StaticMG", //Classname of turret
1, //Skill level 0-1. Has no effect if using custom skills
"Ins_Soldier_Sapper", //Skin "" for random or classname here.
1, //Primary gun set number. "Random" for random weapon set. (not needed if ai_static_useweapon = False)
2, //Number of magazines. (not needed if ai_static_useweapon = False)
"", //Backpack "" for random or classname here. (not needed if ai_static_useweapon = False)
"Random", //Gearset number. "Random" for random gear set. (not needed if ai_static_useweapon = False)
True // Mission true or false
] call spawn_static;
[_position,_vehname] execVM "\z\addons\dayz_server\WAI\missions\compile\markers.sqf";
[nil,nil,rTitleText,"Bandits have disabled an armed vehicle with lots of chain gun ammo in the gear! Check your map for the location!", "PLAIN",10] call RE;
_missiontimeout = true;
_cleanmission = false;
_playerPresent = false;
_starttime = floor(time);
while {_missiontimeout} do {
sleep 5;
_currenttime = floor(time);
{if((isPlayer _x) AND (_x distance _position <= 150)) then {_playerPresent = true};}forEach playableUnits;
if (_currenttime - _starttime >= wai_mission_timeout) then {_cleanmission = true;};
if ((_playerPresent) OR (_cleanmission)) then {_missiontimeout = false;};
};
if (_playerPresent) then {
[_veh,[_vehdir,_objPosition],_vehclass,true,"0"] call custom_publish;
waitUntil
{
sleep 5;
_playerPresent = false;
{if((isPlayer _x) AND (_x distance _position <= 30)) then {_playerPresent = true};}forEach playableUnits;
(_playerPresent)
};
diag_log format["WAI: Mission Armed vehicle Ended At %1",_position];
[nil,nil,rTitleText,"Survivors have secured the armed vehicle!", "PLAIN",10] call RE;
} else {
clean_running_mission = True;
deleteVehicle _veh;
deleteVehicle _box;
deleteVehicle _Trigger1;
deleteVehicle _Trigger2;
deleteVehicle _Trigger3;
{_cleanunits = _x getVariable "missionclean";
if (!isNil "_cleanunits") then {
switch (_cleanunits) do {
case "ground" : {ai_ground_units = (ai_ground_units -1);};
case "air" : {ai_air_units = (ai_air_units -1);};
case "vehicle" : {ai_vehicle_units = (ai_vehicle_units -1);};
case "static" : {ai_emplacement_units = (ai_emplacement_units -1);};
};
deleteVehicle _x;
deleteVehicle _Trigger1;
deleteVehicle _Trigger2;
deleteVehicle _Trigger3;
sleep 0.05;
};
} forEach allUnits;
diag_log format["WAI: Mission Armed vehicle Timed Out At %1",_position];
[nil,nil,rTitleText,"Survivors did not secure the armed vehicle in time!", "PLAIN",10] call RE;
};
missionrunning = false;
Question
joe_candy
Hey.. I've a few problems with players who use bugs with vehicles to get loot from the AI. So i like to add a trigger at the WAI marker, which destroy player vehicle if they drive into the mission area.
But there is a mistake at my idea, so the missions spawns without the trigger...
But there is also no Error at the rpt file.
Hope someone could help me.
There is one of the Mission files with my addet trigger...
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now