Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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"];
- DZ_Wreck = ["SKODAWreck","HMMWVWreck","UralWreck","datsun01Wreck","hiluxWreck","LadaWreck","datsun02Wreck","UAZWreck","PowerGenerator_EP1"];
- DZ_Heli_Wreck =["Mi8Wreck"];
- DZ_Building = [""];
- DZ_Rubbish = ["Land_Misc_Garb_Heap_EP1","Fort_Barricade_EP1","Rubbish2","Rubbish5","Fort_Barricade","Garbage_container","Garbage_can"];
- DZ_Tyre = ["Misc_TyreHeap"];
- DZ_Wreck_Searching = "Rozebiras vrak vozidla %3, třeba v něm budou nějaké náhradní díly. Pokus %1 ze %2.";
- DZ_Rubbish_Searching = "Prohledáváš odpadky, může v nich být něco použielného. Pokus %1 ze %2.";
- DZ_Building_Searching = "Rozebíráš stavbu %3, chvíli to zabere. Pokus %1 ze %2.";
- DZ_Tyre_Searching = "Prohledáváš pneumatiky, snad se najde nějaké kompletní kolo. Pokus %1 ze %2.";
- DZ_Wreck_Parts = ["PartEngine","PartGeneric","PartFueltank","PartGlass","ItemJerrycan","ItemTankTrap","ItemPole","ItemGenerator","ItemHotwireKit","ItemMixOil"];
- DZ_HeliWreck_Parts = ["ItemTankTrap","PartVRotor","PartFueltank","PartGeneric","PartEngine","PartGlass"];
- DZ_Tyre_Parts = ["PartWheel"];
- DZ_Rubbis_Medical = ["ItemPainkiller","ItemMorphine","ItemBandage","ItemPainkiller","ItemBloodbag","ItemAntibiotic","ItemEpinephrine","ItemHeatPack"];
- 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"];
- DZ_Rubbish_Items = ["ItemJerrycan","PartGeneric","ItemSandbag","ItemJerrycanEmpty","ItemWaterbottle","FoodCanPasta","ItemSodaCoke","ItemSodaPepsi","FoodCanUnlabeled","FoodPistachio","ItemSodaMdew"];
- 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"];
- 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"];
- _obj = _this select 3;
- _objType = typeOf _obj;
- _objPos = getPosATL _obj;
- _objectID = _obj getVariable ["ObjectID","0"];
- _objectUID = _obj getVariable ["ObjectUID","0"];
- _nameVehicle = getText(configFile >> "CfgVehicles" >> _objType >> "displayName");
- _isWreck = _objType in DZ_Wreck;
- _isRubbish = _objType in DZ_Rubbish;
- _isBuilding = _objType in DZ_Building;
- _isTyre = _objType in DZ_Tyre;
- _isOK = true;
- _dis = 20;
- _sfx = "repair";
- _radius = 1;
- _limit = 3;
- _proceed = false;
- _Current_Text ="";
- _loot = [];
- _max_count = 1;
- _counter = 0;
- if (_objPos select 2 < 0) then {
- _objPos set [2,0];
- };
- if (_isWreck) then {
- _limit = 3;
- _Current_Text = DZ_Wreck_Searching;
- _loot = DZ_Wreck_Parts + DZ_Tyre_Parts;
- _max_count = 2;
- _dis = 20;
- };
- if (_isTyre) then {
- _limit = 4;
- _Current_Text = DZ_Tyre_Searching;
- _loot = DZ_Tyre_Parts;
- _max_count = 3;
- _dis = 10;
- };
- if (_isRubbish) then {
- _limit = 3;
- _Current_Text = DZ_Rubbish_Searching;
- _loot = DZ_Rubbish_Items + DZ_Rubbis_Medical + DZ_Rubbish_Mag;
- _max_count = 2;
- _dis = 10;
- };
- while {_isOK} do {
- if(!isNull(_obj)) then {
- _proceed = true;
- };
- [1,1] call dayz_HungerThirst;
- player playActionNow "Medic";
- [player,_dis,true,(getPosATL player)] spawn player_alertZombies;
- r_interrupt = false;
- _animState = animationState player;
- r_doLoop = true;
- _started = false;
- _finished = false;
- while {r_doLoop} do {
- _animState = animationState player;
- _isMedic = ["medic",_animState] call fnc_inString;
- if (_isMedic) then {
- _started = true;
- };
- if (_started && !_isMedic) then {
- r_doLoop = false;
- _finished = true;
- _sfx = "repair";
- [player,_sfx,0,false,_dis] call dayz_zombieSpeak;
- };
- if (r_interrupt) then {
- r_doLoop = false;
- };
- sleep 0.1;
- };
- if(!_finished) exitWith {
- _isOk = false;
- _proceed = false;
- };
- if(_finished) then {
- _counter = _counter + 1;
- };
- cutText [format[_Current_Text, _counter,_limit,_nameVehicle], "PLAIN DOWN"];
- if(_counter == _limit) exitWith {
- _isOk = false;
- _proceed = true;
- };
- };
- if(_proceed) then {
- if(!isNull(_obj)) then {
- sleep 1;
- _pocet = 1 + (floor(random _max_count));
- _item = _loot call BIS_fnc_selectRandom;;
- sleep 0.1;
- titleText ["Podařilo získat %1 predmetu", _pocet,"PLAIN DOWN"]; titleFadeOut 5;
- deleteVehicle _obj;
- _refund = createVehicle ["WeaponHolder", _objPos, [], _radius, "CAN_COLLIDE"];
- {
- _refund addMagazineCargoGlobal [_item,1];
- } count _pocet;
- _refund setposATL _objPos;
- player reveal _refund;
- player action ["Gear", _item];
- } else {
- titleText ["Cíl již nejspíš neexistuje.","PLAIN DOWN"]; titleFadeOut 5;
- };
- } else {
- titleText ["Nedokoncil jsi akci.","PLAIN DOWN"]; titleFadeOut 5;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement