Advertisement
Guest User

server_cardrop.sqf

a guest
Jun 1st, 2013
760
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.38 KB | None | 0 0
  1. //_chutetype, _boxtype, _helistart, _crashwreck
  2. private["_chutetype", "_boxtype", "_helistart", "_crashwreck", "_randomizedLoot", "_guaranteedLoot", "_chute", "_chutetype", "_helistart", "_crashwreck", "_box", "_boxtype", "_num", "_weights", "_index", "_aaa", "_itemType", "_lootRadius", "_lootPos", "_pos", "_bam"];
  3.  
  4. _chutetype = _this select 0;
  5. _boxtype = _this select 1;
  6. _helistart = _this select 2;
  7. _crashwreck = _this select 3;
  8. _randomizedLoot = _this select 4;
  9. _guaranteedLoot = _this select 5;
  10.  
  11. _lootRadius = 1;
  12. //_lootTable = ["Military","HeliCrash","MilitarySpecial"] call BIS_fnc_selectRandom;
  13.  
  14. _chute = createVehicle [_chutetype,_helistart,[],0,"CAN_COLLIDE"];
  15. _chute setVariable["Sarge",1];
  16. _chute setPos [(getpos _crashwreck select 0), (getPos _crashwreck select 1), (getPos _crashwreck select 2)-10];
  17.  
  18. _box = createVehicle [_boxtype,_helistart,[],0,"CAN_COLLIDE"];
  19. _box setVariable["Sarge",1];
  20. _box setPos [(getpos _crashwreck select 0), (getPos _crashwreck select 1), (getPos _crashwreck select 2)-10];
  21.  
  22. _box attachto [_chute, [0, 0, 0]];
  23.  
  24. _i = 0;
  25.  
  26.  
  27. while {_i < 45} do {
  28. scopeName "loop1";
  29. if (((getPos _box) select 2) < 1) then {breakOut "loop1"};
  30.  
  31. sleep 0.1;
  32. _i=_i+0.1;
  33. };
  34.  
  35.  
  36. switch (true) do {
  37. case not (alive _box): {detach _box;_box setpos [(getpos _box select 0), (getpos _box select 1), 0];};
  38. case alive _box: {detach _box;_box setpos [(getpos _box select 0), (getpos _box select 1), 0];_bam = _boxtype createVehicle [(getpos _box select 0),(getpos _box select 1),(getpos _box select 2)+0];deletevehicle _box;};
  39. };
  40. _bam setVariable["Sarge",1];
  41. deletevehicle _chute;
  42.  
  43. sleep 2;
  44.  
  45. _pos = [getpos _bam select 0, getpos _bam select 1,0];
  46.  
  47.  
  48. _smoke = createVehicle ["SmokeShellred",_pos,[],0,"CAN_COLLIDE"];
  49. _smoke setVariable["Sarge",1];
  50.  
  51. _flare = "F_40mm_white" createVehicle [getPos _bam select 0, getPos _bam select 1, (getPos _bam select 2) +150];
  52. _flare setVariable["Sarge",1];
  53.  
  54.  
  55.  
  56. _num = round(random _randomizedLoot) + _guaranteedLoot;
  57.  
  58. //_config = configFile >> "CfgBuildingLoot" >> _lootTable;
  59. _itemTypes = [["ItemSodaMdew","magazine"] ,["ItemGPS","weapon"] ,["huntingrifle","weapon"] ,["Skin_Camo1_DZ","magazine"] ,["M16A2","weapon"] ,["AK_74","weapon"] ,["AKS_74_U","weapon"] ,["AK_47_M","weapon"] ,["M4A1","weapon"] ,["Sa58P_EP1","weapon"] ,["Sa58V_EP1","weapon"] ,["DZ_British_ACU","object"] ,["Remington870_lamp","weapon"] ,["MP5A5","weapon"] ,["MedBox0","object"] ,["DZ_ALICE_Pack_EP1","object"] ,["DZ_TK_Assault_Pack_EP1","object"] ,["WeaponHolder_ItemTent","object"] ,["M9","weapon"] ,["UZI_EP1","weapon"] ,["glock17_EP1","weapon"] ,["LeeEnfield","weapon"] ,["Winchester1866","weapon"] ,["WeaponHolder_ItemMachete","object"] ,["ItemCompass","generic"] ,["ItemKnife","generic"] ,["ItemMatchbox","generic"] ,["ItemFlashlightRed","military"] ,["Binocular","weapon"] ,["ItemMap","weapon"] ,["Colt1911","weapon"] ,["revolver_EP1","weapon"] ,["Makarov","weapon"] ,["","food"] ,["","medical"]];
  60. _itemChance = [0.01 ,0.01 ,0.01 ,0.03 ,0.03 ,0.03 ,0.03 ,0.03 ,0.03 ,0.03 ,0.03 ,0.06 ,0.06 ,0.06 ,0.1 ,0.1 ,0.1 ,0.1 ,0.12 ,0.12 ,0.12 ,0.15 ,0.15 ,0.15 ,0.18 ,0.18 ,0.18 ,0.18 ,0.18 ,0.18 ,0.2 ,0.2 ,0.2 ,0.25 ,0.25];
  61.  
  62. _weights = [];
  63. _weights = [_itemType,_itemChance] call fnc_buildWeightedArray;
  64. _cntWeights = count _weights;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement