Advertisement
Guest User

Untitled

a guest
Mar 6th, 2015
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.64 KB | None | 0 0
  1. /*
  2.     @file Version: 1.0.0.0
  3.     @file Author: RYN_Ryan
  4.     @Modified by: RPGforYOU
  5.     @file edit: 20.01.2015
  6.     Copyright © 2015 Ryan Torzynski, All rights reserved
  7.     All servers are allowed to use this code, modify and publish it. Every modified release of this script must contain "Original by RTT"!
  8. */
  9.  
  10. ship_obj_arr = ["Land_Wreck_Traw_F","Land_Wreck_Traw2_F","_var"];
  11.  
  12. //########################## CONFIGURATION ##########################
  13.  
  14. ship_chance = 100;
  15. ship_positions = [[4462.89,6515.78,-2.19486],[5391.75,25136.2,-1.98308],[25323.2,27886.6,-2.15125]];
  16. _ship_time_interval = [1,2]; //
  17. _var=floor(random 4);
  18. if (_var==0) then {
  19. ship_loot_array = [["silverbar",46],["goldbar",22]];
  20. };
  21. if (_var==1) then {
  22. ship_loot_array = [["diamondc",14],["goldbar",25],["ruby",7]];
  23. };
  24. if (_var==2) then {
  25. ship_loot_array = [["diamondc",23],["silverbar",8],["goldbar",12],["ruby",3]];
  26. };
  27. if (_var==3) then {
  28. ship_loot_array = [["diamondc",28],["silverbar",9],["goldbar",4],["ac",2]];
  29. };
  30. if (_var==4) then {
  31. ship_loot_array = [["silverbar",16],["goldbar",37],["ruby",2],["diamondc",17]];
  32. };
  33. ship_loot_amount = 1;
  34.  
  35. //######################## CONFIGURATION END ########################
  36.  
  37. // Do not modify the following code
  38.  
  39. ship_time_min = _ship_time_interval select 0;
  40. ship_time_max = _ship_time_interval select 1;
  41. ship_time_min = ship_time_min*450;
  42. ship_time_max = ship_time_max*600;
  43.  
  44. if (ship_time_min>=ship_time_max OR count ship_loot_array < ship_loot_amount) exitWith {ship_enable=false;};
  45. ship_enable=true;
  46.  
  47. sleep 1;
  48.  
  49. if (!ship_enable) exitWith {};
  50.  
  51. _chance = floor(random 100);
  52. if (_chance>ship_chance) exitWith {};
  53. _toWait = (random (ship_time_max - ship_time_min)) + ship_time_min;
  54. sleep _toWait;
  55.  
  56. // ship STARTEN
  57. [[5,"<br/><t align='center'><t size='6'><img image='textures\shipheader.paa'/></t></t><br/><br/><t size='1.4'><t color='#A5DF00'>SHIP WRECK</t></t><br/><br/><t size='1'>A ship stranded on the coast of Altis! The Radius has been marked on your map!<br/> <br/>  The loot will be washed away by the water in 60 minutes!<br/><br/>  So hurry and watch out for other treasure hunters! <br/><br/> Don't forget your <t size='1.5'><img image='icons\items\lance.paa'/></t>lance and <t size='1.5'><img image='icons\items\wetool.paa'/></t>welding tools!</t>"],"life_fnc_broadcast",true,false] spawn life_fnc_MP;
  58. _poses = count ship_positions;
  59. _inArr = floor(random _poses);
  60. _dest = ship_positions select _inArr;
  61.  
  62. sleep 5;
  63.  
  64. _marker = createMarker ["shipmarker", _dest];
  65. "shipmarker" setMarkerColor "ColorGreen";
  66. "shipmarker" setMarkerType "Empty";
  67. "shipmarker" setMarkerShape "ELLIPSE";
  68. "shipmarker" setMarkerSize [300,300];
  69. _markerText = createMarker ["shipmarkertext", _dest];
  70. "shipmarkertext" setMarkerColor "ColorBlack";
  71. "shipmarkertext" setMarkerText "Ship Wreck";
  72. "shipmarkertext" setMarkerType "mil_warning";
  73.  
  74. "shipmarker" setMarkerAlpha 0.3;
  75.  
  76. // Spawning the wreck
  77.  
  78. _type = "";
  79. _chance = floor(random 2);
  80. if (_chance==1) then {_type = "Land_Wreck_Traw_F"} else {_type = "Land_Wreck_Traw2_F"};
  81.  
  82. _xPOS = floor(random 150);
  83. _yPOS = floor(random 150);
  84.  
  85. _wreck = createVehicle [_type, [(_dest select 0)+_xPOS,(_dest select 1)+_yPOS,0], [], 0, "CAN_COLLIDE"];
  86. _wreck allowDamage false;
  87. _wreck enableSimulation false;
  88. _wreck setVariable ["trunk_in_use",false,true];
  89.  
  90. _lootArray = ship_loot_array;
  91. _wreck setVariable ["Trunk",[_lootArray,500],true];
  92.  
  93. sleep 3600;
  94.  
  95. [[5,"<br/><t align='center'><t size='6'><img image='textures\shipheader.paa'/></t></t><br/><br/><t size='1.4'><t color='#A5DF00'>Shipwreck</t></t><br/><br/><t size='1'>All the loot is now gone in the endless waters of Altis!</t>"],"life_fnc_broadcast",true,false] spawn life_fnc_MP;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement