Advertisement
Guest User

greatveh.sqf

a guest
Jun 27th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.35 KB | None | 0 0
  1. private ["_rand_player","_loot_lists","_loot2","_position","_positionarray","_mainpos","_marker","_this","_despawn_timer",
  2. "_missiontimeout","_cleanmission","_playerPresent","_starttime","_currenttime","_spawnChance","_spawnRoll","_veh","_hint"];
  3.  
  4. _loot_lists = [
  5.  
  6. [
  7. ["DMR_DZ","Anzio_20_DZ"],
  8. ["ItemComboLock","20Rnd_762x51_DMR","CinderBlocks","CinderBlocks","CinderBlocks","3rnd_Anzio_20x102mm","3rnd_Anzio_20x102mm","3rnd_Anzio_20x102mm","3rnd_Anzio_20x102mm"]
  9. ],
  10.  
  11. [
  12. ["Anzio_20_DZ"],
  13. ["plot_pole_kit","CinderBlocks","CinderBlocks","CinderBlocks","CinderBlocks","CinderBlocks","CinderBlocks","CinderBlocks","3rnd_Anzio_20x102mm","3rnd_Anzio_20x102mm","3rnd_Anzio_20x102mm"]
  14. ],
  15.  
  16. [
  17. ["Stinger","M136"],
  18. ["ItemVault","Stinger","Stinger","Stinger","Stinger","Stinger","CinderBlocks","CinderBlocks","CinderBlocks","CinderBlocks","M136","M136","M136","M136"]
  19. ],
  20.  
  21. [
  22. ["MAAWS","RPG18"],
  23. ["ItemLockBox","MAAWS_HEAT","MAAWS_HEAT","MAAWS_HEAT","MAAWS_HEAT","MAAWS_HEAT","CinderBlocks","CinderBlocks","CinderBlocks","RPG18","RPG18","RPG18"]
  24. ]
  25.  
  26. ];
  27.  
  28. _loot2 = _loot_lists call BIS_fnc_selectRandom;
  29.  
  30. _position = [3376.9175,3975.3352,-7.6293945e-006];
  31. _positionarray = [
  32. [(_position select 0) - 140.5, (_position select 1) - 21,-0.012],
  33. [(_position select 0) - 200, (_position select 1) - 100,-0.012],
  34. [(_position select 0) + 125, (_position select 1) + 115,-0.012],
  35. [(_position select 0) + 106, (_position select 1) - 124,-0.012],
  36. [(_position select 0) + 149, (_position select 1) + 170.5,-0.012],
  37. [(_position select 0) + 138.5, (_position select 1) - 116,-0.012]
  38. ];
  39.  
  40.  
  41. _mainpos = _positionarray call BIS_fnc_selectRandom;
  42.  
  43. _marker = createMarker ["gv", _mainpos];
  44. _marker setMarkerText "GreatVehicle";
  45. _marker setMarkerType "mil_circle";
  46. _marker setMarkerColor "ColorBlue";
  47. _marker setMarkerBrush "Solid";
  48. _marker setMarkerSize [0.3, 0.3];
  49.  
  50. _veh = createVehicle ["ArmoredSUV_PMC", [(_mainpos select 0) + 1, (_mainpos select 1) - 1,-0.12],[], 0, "CAN_COLLIDE"];
  51. _veh setDir 0;
  52. _veh setVectorUp surfaceNormal position _veh;
  53. dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_veh];
  54.  
  55.  
  56.  
  57.  
  58. _hint = parseText format["<t align='center' color='#2fee11' shadow='2' size='1'>GREAT VEHICLE EVENT</t>"];
  59. RemoteMessage = ['hint', _hint];
  60. publicVariable "RemoteMessage";
  61.  
  62. _despawn_timer = 300;
  63. _missiontimeout = true;
  64. _cleanmission = false;
  65. _playerPresent = false;
  66. _starttime = floor(time);
  67. while {_missiontimeout} do {
  68. sleep 4;
  69. _currenttime = floor(time);
  70. {if((isPlayer _x) && (_x distance _mainpos <= 20)) then {_playerPresent = true};}forEach playableUnits;//check for nearest players
  71. if (_currenttime - _starttime >= _despawn_timer) then {_cleanmission = true;};
  72. if ((_playerPresent) || (_cleanmission)) then {_missiontimeout = false;};
  73. };
  74.  
  75.  
  76. if (_cleanmission) then {
  77. _hint = parseText format["<t align='center' color='#ee1132' shadow='2' size='1'>GREAT VEHICLE ENDS</t>"];
  78. RemoteMessage = ['hint', _hint];
  79. publicVariable "RemoteMessage";
  80. deleteMarker _marker;
  81. };
  82.  
  83.  
  84. if (_playerPresent) then {
  85. {
  86. _veh addWeaponCargoGlobal [_x,1];
  87. } forEach (_loot2 select 0);
  88. {
  89. _veh addMagazineCargoGlobal [_x,1];
  90. } forEach (_loot2 select 1);
  91. _hint = parseText format["<t align='center' color='#ee1132' shadow='2' size='1'>GREAT VEHICLE ENDS</t>"];
  92. RemoteMessage = ['hint', _hint];
  93. publicVariable "RemoteMessage";
  94. deleteMarker _marker;
  95. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement