Advertisement
adolf01

Untitled

Jun 9th, 2016
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 6.04 KB | None | 0 0
  1. private ["_item","_dis","_sfx","_obj","_objType","_isWreck","_isRubbish","_objPos","_radius","_objectID","_objectUID","_limit","_loot","_max_count","_proceed","_started","_finished","_animState","_isMedic","_isOk","_counter","_pocet","_refund","_nameVehicle","_isBuilding","_isTyre","_Current_Text"];
  2.  
  3. DZ_Wreck = ["SKODAWreck","HMMWVWreck","UralWreck","datsun01Wreck","hiluxWreck","LadaWreck","datsun02Wreck","UAZWreck","PowerGenerator_EP1"];
  4. DZ_Heli_Wreck =["Mi8Wreck"];
  5. DZ_Building = [""];
  6. DZ_Rubbish = ["Land_Misc_Garb_Heap_EP1","Fort_Barricade_EP1","Rubbish2","Rubbish5","Fort_Barricade","Garbage_container","Garbage_can"];
  7. DZ_Tyre = ["Misc_TyreHeap"];
  8.  
  9.  
  10. DZ_Wreck_Searching = "Rozebiras vrak vozidla %3, třeba v něm budou nějaké náhradní díly. Pokus %1 ze %2.";
  11. DZ_Rubbish_Searching = "Prohledáváš odpadky, může v nich být něco použielného. Pokus %1 ze %2.";
  12. DZ_Building_Searching = "Rozebíráš stavbu %3, chvíli to zabere. Pokus %1 ze %2.";
  13. DZ_Tyre_Searching = "Prohledáváš pneumatiky, snad se najde nějaké kompletní kolo. Pokus %1 ze %2.";
  14.  
  15.  
  16.  
  17. DZ_Wreck_Parts = ["PartEngine","PartGeneric","PartFueltank","PartGlass","ItemJerrycan","ItemTankTrap","ItemPole","ItemGenerator","ItemHotwireKit","ItemMixOil"];
  18. DZ_HeliWreck_Parts = ["ItemTankTrap","PartVRotor","PartFueltank","PartGeneric","PartEngine","PartGlass"];
  19. DZ_Tyre_Parts = ["PartWheel"];
  20. DZ_Rubbis_Medical = ["ItemPainkiller","ItemMorphine","ItemBandage","ItemPainkiller","ItemBloodbag","ItemAntibiotic","ItemEpinephrine","ItemHeatPack"];
  21. DR_Rubbish_Mag = ["6Rnd_45ACP","7Rnd_45ACP_1911","8Rnd_9x18_Makarov","8Rnd_9x18_MakarovSD","15Rnd_9x19_M9","15Rnd_9x19_M9SD","17Rnd_9x19_glock17","17Rnd_9x19_glock17","17Rnd_9x19_glock17"];
  22. DZ_Rubbish_Items = ["ItemJerrycan","PartGeneric","ItemSandbag","ItemJerrycanEmpty","ItemWaterbottle","FoodCanPasta","ItemSodaCoke","ItemSodaPepsi","FoodCanUnlabeled","FoodPistachio","ItemSodaMdew"];
  23. DZ_Building_Parts = ["bulk_empty","bulk_ItemTankTrap","bulk_ItemWire","CinderBlocks","ItemBurlap","ItemCanvas","ItemComboLock","ItemCorrugated","ItemFireBarrel_Kit","ItemFuelBarrelEmpty","ItemGenerator","ItemHotwireKit","ItemJerrycan","ItemLockbox","ItemPole","ItemSandbag","ItemTankTrap","ItemTent","ItemTentDomed","ItemTentDomed2","ItemTentOld","ItemWire","MortarBucket","outhouse_kit","park_bench_kit","PartGeneric","PartPlankPack","PartPlywoodPack","PartWoodLumber","PartWoodPile","PartWoodPlywood","rusty_gate_kit","sandbag_nest_kit","stick_fence_kit","sun_shade_kit","workbench_kit"];
  24. DZ_Building_Items = ["cinder_door_kit","cinder_garage_kit","cinder_wall_kit","deer_stand_kit","desert_large_net_kit","desert_net_kit","forest_large_net_kit","forest_net_kit","fuel_pump_kit","ItemSandbagExLarge","ItemSandbagExLarge5x","ItemSandbagLarge","ItemWoodFloor","ItemWoodFloorHalf","ItemWoodFloorQuarter","ItemWoodLadder","ItemWoodStairs","ItemVault","ItemWoodStairsSupport","ItemWoodWall","ItemWoodWallDoor","ItemWoodWallDoorLg","ItemWoodWallGarageDoor","ItemWoodWallGarageDoorLocked","ItemWoodWallLg","ItemWoodWallThird","ItemWoodWallWindow","ItemWoodWallWindowLg","ItemWoodWallWithDoor","ItemWoodWallwithDoorLg","ItemWoodWallWithDoorLgLocked","ItemWoodWallWithDoorLocked","storage_shed_kit","wooden_shed_kit","wood_ramp_kit","wood_shack_kit","light_pole_kit","m240_nest_kit","metal_floor_kit","metal_panel_kit"];
  25.  
  26.  
  27.  
  28. _obj = _this select 3;
  29.  
  30. _objType = typeOf _obj;
  31. _objPos = getPosATL _obj;
  32. _objectID   = _obj getVariable ["ObjectID","0"];
  33. _objectUID  = _obj getVariable ["ObjectUID","0"];
  34. _nameVehicle = getText(configFile >> "CfgVehicles" >> _objType >> "displayName");
  35.  
  36. _isWreck = _objType in DZ_Wreck;
  37. _isRubbish = _objType in DZ_Rubbish;
  38. _isBuilding = _objType in DZ_Building;
  39. _isTyre = _objType in DZ_Tyre;
  40.  
  41. _isOK = true;
  42. _dis = 20;
  43. _sfx = "repair";
  44. _radius = 1;
  45. _limit = 3;
  46. _proceed = false;
  47. _Current_Text ="";
  48. _loot = [];
  49. _max_count = 1;
  50. _counter = 0;
  51.  
  52.  
  53.  
  54. if (_objPos select 2 < 0) then {
  55.     _objPos set [2,0];
  56.     };
  57.  
  58. if (_isWreck) then {
  59. _limit = 3;
  60. _Current_Text = DZ_Wreck_Searching;
  61. _loot = DZ_Wreck_Parts + DZ_Tyre_Parts;
  62. _max_count = 2;
  63. _dis = 20;
  64. }; 
  65.    
  66. if (_isTyre) then {
  67. _limit = 4;
  68. _Current_Text = DZ_Tyre_Searching;
  69. _loot = DZ_Tyre_Parts;
  70. _max_count = 3;
  71. _dis = 10;
  72. };
  73.  
  74. if (_isRubbish) then {
  75. _limit = 3;
  76. _Current_Text = DZ_Rubbish_Searching;
  77. _loot = DZ_Rubbish_Items + DZ_Rubbis_Medical + DZ_Rubbish_Mag;
  78. _max_count = 2;
  79. _dis = 10;
  80. }; 
  81.    
  82.    
  83. while {_isOK} do {
  84.     if(!isNull(_obj)) then {
  85.         _proceed = true;
  86.     };
  87.     [1,1] call dayz_HungerThirst;
  88.     player playActionNow "Medic";
  89.     [player,_dis,true,(getPosATL player)] spawn player_alertZombies;
  90.    
  91.    
  92.     r_interrupt = false;
  93.     _animState = animationState player;
  94.     r_doLoop = true;
  95.     _started = false;
  96.     _finished = false;
  97.    
  98.    
  99.     while {r_doLoop} do {
  100.         _animState = animationState player;
  101.         _isMedic = ["medic",_animState] call fnc_inString;
  102.         if (_isMedic) then {
  103.             _started = true;
  104.         };
  105.         if (_started && !_isMedic) then {
  106.             r_doLoop = false;
  107.             _finished = true;
  108.             _sfx = "repair";
  109.             [player,_sfx,0,false,_dis] call dayz_zombieSpeak;
  110.         };
  111.         if (r_interrupt) then {
  112.             r_doLoop = false;
  113.         };
  114.  
  115.         sleep 0.1;
  116.  
  117.     };
  118.     if(!_finished) exitWith {
  119.         _isOk = false;
  120.         _proceed = false;
  121.     };
  122.     if(_finished) then {
  123.         _counter = _counter + 1;
  124.     };
  125.  
  126.     cutText [format[_Current_Text, _counter,_limit,_nameVehicle], "PLAIN DOWN"];
  127.  
  128.     if(_counter == _limit) exitWith {
  129.         _isOk = false;
  130.         _proceed = true;
  131.     };
  132. };
  133.  
  134.  
  135.  
  136. if(_proceed) then {
  137.  
  138.     if(!isNull(_obj)) then {
  139.         sleep 1;
  140.         _pocet = 1 + (floor(random _max_count));
  141.         _item = _loot call BIS_fnc_selectRandom;;
  142.         sleep 0.1; 
  143.         titleText ["Podařilo získat %1 predmetu", _pocet,"PLAIN DOWN"]; titleFadeOut 5;
  144.         deleteVehicle _obj;
  145.         _refund = createVehicle ["WeaponHolder", _objPos, [], _radius, "CAN_COLLIDE"];
  146.        
  147.         {
  148.         _refund addMagazineCargoGlobal [_item,1];
  149.         } count _pocet;
  150.        
  151.         _refund setposATL _objPos;
  152.         player reveal _refund;
  153.         player action ["Gear", _item];
  154.     } else {
  155.     titleText ["Cíl již nejspíš neexistuje.","PLAIN DOWN"]; titleFadeOut 5;
  156.     };
  157. } else {
  158. titleText ["Nedokoncil jsi akci.","PLAIN DOWN"]; titleFadeOut 5;
  159. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement