Advertisement
Guest User

Untitled

a guest
May 28th, 2016
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.46 KB | None | 0 0
  1. if(isServer) then {
  2.  
  3. private ["_complete","_crate","_mission","_static_gun","_crate_type","_rndnum","_playerPresent","_vehname","_vehicle","_position","_vehclass"];
  4.  
  5. //Armed Land Vehicle
  6. _vehclass = armed_vehicle call BIS_fnc_selectRandom;
  7. _vehname = getText (configFile >> "CfgVehicles" >> _vehclass >> "displayName");
  8.  
  9. _position = [30] call find_position;
  10. _mission = [_position,"Medium",format["Disabled %1",_vehname],"MainHero",true] call mission_init;
  11.  
  12. diag_log format["WAI: [Mission:[Hero] Armed Vehicle]: Starting... %1",_position];
  13.  
  14. //Setup the crate
  15. _crate_type = crates_small call BIS_fnc_selectRandom;
  16. _crate = createVehicle [_crate_type,[(_position select 0),(_position select 1) + 5,0], [], 0, "CAN_COLLIDE"];
  17.  
  18. //Troops
  19. _rndnum = (2 + round (random 4));
  20. [[_position select 0,_position select 1,0],_rndnum,"Medium","Random",3,"Random","Bandit","Random","Bandit",_mission] call spawn_group;
  21. [[_position select 0,_position select 1,0],_rndnum,"Medium","Random",3,"Random","Bandit","Random","Bandit",_mission] call spawn_group;
  22. [[_position select 0,_position select 1,0],_rndnum,"Medium","Random",3,"Random","Bandit","Random","Bandit",_mission] call spawn_group;
  23. [[_position select 0,_position select 1,0],3,"Random",["Random","at"],4,"Random","Bandit","Random","Bandit",_mission] call spawn_group;
  24.  
  25. //Static Guns
  26. _static_gun = ai_static_weapons call BIS_fnc_selectRandom;
  27. [[
  28. [(_position select 0),(_position select 1) + 10, 0]
  29. ],_static_gun,"Medium","Bandit","Bandit",0,2,"Random","Random",_mission] call spawn_static;
  30.  
  31. //Spawn Vehicle
  32. _vehicle = [_vehclass,_position] call custom_publish;
  33.  
  34. if(debug_mode) then {
  35. diag_log format["WAI: [Hero] armed_vehicle spawned a %1",_vehname];
  36. };
  37.  
  38. //Condition
  39. _complete = [
  40. [_mission,_crate], // mission number and crate
  41. ["crate"], // ["crate"], or ["kill"], or ["assassinate", _unitGroup],
  42. [_vehicle], // cleanup objects
  43. "Bandits have disabled an armed vehicle with lots of chain gun ammo in the gear! Check your map for the location!", // mission announcement
  44. "Survivors have secured the armed vehicle!", // mission success
  45. "Survivors did not secure the armed vehicle in time" // mission fail
  46. ] call mission_winorfail;
  47.  
  48. if(_complete) then {
  49. [_crate,0,0,[25,crate_items_chainbullets],2] call dynamic_crate;
  50. };
  51.  
  52. diag_log format["WAI: [Bandit] armed_vehicle ended at %1",_position];
  53.  
  54. h_missionrunning = false;
  55. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement