Advertisement
Guest User

Untitled

a guest
May 30th, 2015
383
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.93 KB | None | 0 0
  1. /*
  2.     @file Version: 1.0.0.0
  3.     @file Author: RYN_Ryan
  4.     @file edit: 20.01.2015
  5.     Copyright ? 2015 Ryan Torzynski, All rights reserved
  6.     All servers are allowed to use this code, modify and publish it. Every modified release of this script must contain "Original by RTT"!
  7. */
  8.  
  9. //schiffsw_obj_arr = ["Land_Wreck_Traw_F","Land_Wreck_Traw2_F"];
  10.  
  11. //########################## CONFIGURATION ##########################
  12.  
  13. schiffsw_chance = 100;
  14. schiffsw_positions = [[4462.89,6515.78,-2.19486],[5391.75,25136.2,-1.98308],[25323.2,27886.6,-2.15125]];
  15. //_schiffsw_time_interval = [1,2]; //Time given in hours, this is the interval in which the shipwreck should take spawn
  16. schiffsw_loot_array = [["apple",100],["peach",100],["goldbar",20],["cocainep",40],["heroinp",40]];
  17. schiffsw_loot_amount = 5;
  18.  
  19. //######################## CONFIGURATION END ########################
  20.  
  21. // Do not modify the following code
  22.  
  23. /*schiffsw_time_min = _schiffsw_time_interval select 0;
  24. schiffsw_time_max = _schiffsw_time_interval select 1;
  25. schiffsw_time_min = schiffsw_time_min*3600;
  26. schiffsw_time_max = schiffsw_time_max*3600;
  27.  
  28. if (schiffsw_time_min>=schiffsw_time_max OR count schiffsw_loot_array < schiffsw_loot_amount) exitWith {schiffsw_enable=false;};
  29. schiffsw_enable=true;
  30.  
  31. sleep 1;
  32.  
  33. if (!schiffsw_enable) exitWith {};
  34.  
  35. _chance = floor(random 100);
  36. if (_chance>schiffsw_chance) exitWith {};
  37. _toWait = (random (schiffsw_time_max - schiffsw_time_min)) + schiffsw_time_min;*/
  38. sleep 1800;
  39.  
  40. // schiffsw STARTEN
  41. [[5,"<t size='1.4'><t color='#A5DF00'>SHIPWRECK</t></t><br/><br/><t size='1'>A sunken ship has been located! It may contain expensive items, it has been marked on your map!</t>"],"life_fnc_broadcast",true,false] spawn life_fnc_MP;
  42. _poses = count schiffsw_positions;
  43. _inArr = floor(random _poses);
  44. _dest = schiffsw_positions select _inArr;
  45.  
  46. sleep 5;
  47.  
  48. _marker = createMarker ["schiffswmarker", _dest];
  49. "schiffswmarker" setMarkerColor "ColorGreen";
  50. "schiffswmarker" setMarkerType "Empty";
  51. "schiffswmarker" setMarkerShape "ELLIPSE";
  52. "schiffswmarker" setMarkerSize [550,550];
  53. _markerText = createMarker ["schiffswmarkertext", _dest];
  54. "schiffswmarkertext" setMarkerColor "ColorBlack";
  55. "schiffswmarkertext" setMarkerText "Shipwreck";
  56. "schiffswmarkertext" setMarkerType "mil_warning";
  57.  
  58. "schiffswmarker" setMarkerAlpha 0.3;
  59.  
  60. // DAS WRACK SPAWNEN
  61.  
  62. /*_type = "";
  63. _chance = floor(random 2);
  64. if (_chance==1) then {_type = "Land_Wreck_Traw_F"} else {_type = "Land_Wreck_Traw2_F"};*/
  65. _type = "Land_Wreck_Traw_F";
  66.  
  67. _xPOS = floor(random 400);
  68. _yPOS = floor(random 400);
  69.  
  70. _pos = [(_dest select 0) - 500 + random(500*2),(_dest select 1) - 500 + random(500*2),0];
  71. _dasWrack = createVehicle [_type, [0,0,0], [], 0, "CAN_COLLIDE"];
  72. _dasWrack setPosATL _pos;
  73. _dasWrack allowDamage false;
  74. _dasWrack enableSimulation false;
  75. _dasWrack setVariable ["trunk_in_use",false,true];
  76. _dasWrack setVariable ["opened",false,true];
  77. schiffwoffen = false;
  78.  
  79. waitUntil {schiffwoffen}; // Warten, bis es ge?ffnet wird
  80.  
  81. _dasWrack setVariable ["opened",true,true];
  82.  
  83. // RANDOM LOOT EINF?HREN
  84.  
  85. _lootAmount = schiffsw_loot_amount;
  86. _lootArray = schiffsw_loot_array;
  87. _lootTempToAdd = [];
  88. _lootArrayFinal = [];
  89.  
  90. while {_lootAmount>0} do {
  91.     _lootAmount = _lootAmount - 1;
  92.     _loot_inArr = count _lootArray;
  93.     _inArr = floor(random _loot_inArr);
  94.     _lootTempToAdd = _lootArray select _inArr;
  95.     _lootArrayFinal = _lootArrayFinal + [_lootTempToAdd];
  96. };
  97.  
  98. _dasWrack setVariable ["Trunk",[_lootArrayFinal,500],true];
  99.  
  100. sleep 1800;
  101.  
  102. "schiffswmarker" setMarkerAlpha 0;
  103. "schiffswmarkertext" setMarkerAlpha 0;
  104.  
  105. deleteMarker "schiffswmarker";
  106. deleteMarker "schiffswmarkertext";
  107. deleteVehicle _dasWrack;
  108. schiffwoffen = false;
  109. [[5,"<t size='1.4'><t color='#A5DF00'>SHIPWRECK</t></t><br/><br/><t size='1'>The ship has been successfully looted and has despawned!</t>"],"life_fnc_broadcast",true,false] spawn life_fnc_MP;
  110. sleep 1800;
  111. [] execVM "\life_server\Functions\Schiffswrack\fn_generateschiffwrackAuto.sqf";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement