Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private ["_player","_vehicle","_isveh","_finished","_finishedTime","_objectID","_objectUID"];
- _vehicle = cursorTarget;
- _player = player;
- _isveh = typeOf _vehicle in ["PBX","Old_bike_TK_CIV_EP1","MMT_Civ","M2StaticMG","DSHKM_Gue","AGS_TK_EP1","KORD_UN_EP1","SearchLight_Gue","TOW_TriPod_US_EP1","SPG9_TK_GUE_EP1","D30_TK_GUE_EP1","2b14_82mm_GUE","BAF_L2A1_Tripod_W"];
- if !(_isveh && {player distance _vehicle <= 5}) exitWith {dayz_actionInProgress = false;};
- dayz_actionInProgress = true;
- _playerNear = {isPlayer _x} count (([_player] call FNC_GetPos) nearEntities ["CAManBase", 10]) > 1;
- if (_playerNear) exitWith {dayz_actionInProgress = false; localize "str_pickup_limit_5" call dayz_rollingMessages;};
- _player playActionNow "Medic";
- [_player,"repair",0,false,10] call dayz_zombieSpeak;
- [_player,10,true,(getPosATL _player)] spawn player_alertZombies;
- r_interrupt = false;
- r_doLoop = true;
- _finished = false;
- _finishedTime = diag_tickTime+8;
- while {r_doLoop} do {
- if (diag_tickTime >= _finishedTime) then {
- r_doLoop = false;
- _finished = true;
- };
- if (r_interrupt) then {
- r_doLoop = false;
- };
- sleep 0.1;
- };
- if (_finished) then {
- if !(player distance _vehicle <= 5) exitWith {dayz_actionInProgress = false;};
- deleteVehicle _vehicle;
- _objectID = _vehicle getVariable ["ObjectID", "0"];
- _objectUID = _vehicle getVariable ["ObjectUID", "0"];
- [_objectID,_objectUID] call server_deleteObj;
- PVDZ_obj_Destroy = [_objectID,_objectUID,_vehicle];
- publicVariableServer "PVDZ_obj_Destroy";
- if (_vehicle isKindOf "TOW_TriPod_US_EP1") then {
- _player addMagazine ["ItemPole",2];
- _player addMagazine ["PartGeneric",2];
- _player addMagazine "ItemGoldBar";
- }else{
- if (_vehicle isKindOf "SPG9_TK_GUE_EP1") then {
- _player addMagazine ["ItemPole",2];
- _player addMagazine ["PartGeneric",2];
- _player addMagazine "ItemGoldBar";
- }else{
- if (_vehicle isKindOf "D30_TK_GUE_EP1") then {
- _player addMagazine ["ItemPole",2];
- _player addMagazine ["PartGeneric",2];
- _player addMagazine ["ItemRuby",2];
- }else{
- if (_vehicle isKindOf "2b14_82mm_GUE") then {
- _player addMagazine ["ItemPole",2];
- _player addMagazine ["PartGeneric",2];
- _player addMagazine ["ItemRuby",2];
- }else{
- if (_vehicle isKindOf "BAF_L2A1_Tripod_W") then {
- _player addMagazine ["ItemPole",2];
- _player addMagazine ["PartGeneric",2];
- _player addMagazine "ItemRuby";
- }else{
- if (_vehicle isKindOf "DSHKM_Gue") then {
- _player addMagazine ["ItemPole",2];
- _player addMagazine ["PartGeneric",2];
- _player addMagazine "ItemGoldBar";
- }else{
- if (_vehicle isKindOf "M2StaticMG") then {
- _player addMagazine ["ItemPole",2];
- _player addMagazine ["PartGeneric",2];
- _player addMagazine "ItemGoldBar";
- }else{
- if (_vehicle isKindOf "AGS_TK_EP1") then {
- _player addMagazine ["ItemPole",2];
- _player addMagazine ["PartGeneric",2];
- _player addMagazine "ItemRuby";
- }else{
- if (_vehicle isKindOf "KORD_UN_EP1") then {
- _player addMagazine ["ItemPole",2];
- _player addMagazine ["PartGeneric",2];
- _player addMagazine "ItemRuby";
- }else{
- if (_vehicle isKindOf "SearchLight_Gue") then {
- _player addMagazine ["ItemPole",2];
- _player addMagazine ["PartGeneric",2];
- };
- };
- };
- };
- };
- };
- };
- };
- };
- };
- _player addWeapon "ItemToolbox";
- cutText ["\nYou have packed a veh!", "PLAIN DOWN",2];
- dayz_actionInProgress = false;
- } else {
- r_interrupt = false;
- _player switchMove "";
- _player playActionNow "stop";
- dayz_actionInProgress = false;
- cutText ["\n\nCanceled pack veh!", "PLAIN DOWN",2];
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement