Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private["_playernear","_itemNew","_onLadder","_skin","_body","_okSkin","_result","_bag","_bmags","_bweps","_corpse","_mags","_object","_weps","_newhs","_newkillsB","_newkillsH","_headShots","_killsB","_killsH","_newkills","_name"];
- _body = _this select 3;
- DZE_ActionInProgress = true;
- _onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
- if (_onLadder) exitWith {DZE_ActionInProgress = false;cutText ["I can not perform this action while on a ladder!" , "PLAIN DOWN"]};
- _playernear = ({isPlayer _x} count (getPos vehicle player nearEntities [["CAManBase"], 8]))-1;
- if (_playernear != 0) exitWith {DZE_ActionInProgress = false;cutText [format["You cannot fill while another player is nearby"] , "PLAIN DOWN"]};
- if (vehicle player != player) exitWith {DZE_ActionInProgress = false;cutText ["You can not take clothes while in a vehicle.", "PLAIN DOWN"]};
- player removeAction s_player_clothes;
- s_player_clothes = -1;
- _skin = (typeOf _body);
- _itemNew = _skin;
- _isSoldier = (typeOf _body == 'FR_Assault_R');
- switch (_itemNew) do {
- case "Survivor3_DZ": {
- _itemNew = "Soldier_Sniper_PMC_DZ";
- };
- };
- if (!_isSoldier) then {
- _itemNew = "Skin_" + _itemNew;
- _okSkin = isClass (ConfigFile >> "CfgMagazines" >> _itemNew);
- } else {
- _okSkin = true;
- };
- if (_okSkin) then {
- player playActionNow "Medic";
- sleep 3;
- if (!_isSoldier) then {
- _result = [player,_itemNew] call BIS_fnc_invAdd;
- } else {
- [dayz_playerUID,dayz_characterID,_itemNew] spawn player_humanityMorph;
- _result = true;
- };
- if (_result) then {
- _mags = magazines _body;
- _weps = weapons _body;
- _bag = unitBackpack _body;
- _corpse = createVehicle ["GraveDZE", position _body, [], 0, "CAN_COLLIDE"];
- _name = _body getVariable ["bodyName","unknown"];
- _corpse setVariable ["bodyName",_name,true];
- _corpse setVariable ["permaLoot",true];
- {_corpse addMagazineCargoGlobal [_x, 1];} forEach _mags;
- {_corpse addWeaponCargoGlobal [_x, 1];} forEach _weps;
- if (!isNull _bag) then {
- _bmags = getMagazineCargo _bag;
- _bweps = getWeaponCargo _bag;
- _corpse addBackpackCargoGlobal [(typeOf _bag), 1];
- {_corpse addMagazineCargoGlobal [_x, ((_bmags select 1) select _forEachIndex)];} forEach (_bmags select 0);
- {_corpse addWeaponCargoGlobal [_x, ((_bweps select 1) select _forEachIndex)];} forEach (_bweps select 0);
- };
- if (!isNull _body) then {deleteVehicle _body};
- cutText ["I put the clothes in my inventory", "PLAIN DOWN"];
- } else {
- cutText ["I do not have enough room in my inventory.", "PLAIN DOWN"];
- player switchMove "";
- player playActionNow "stop";
- };
- } else {
- cutText [format["I'm not able to take them off"], "PLAIN DOWN"];
- player switchMove "";
- player playActionNow "stop";
- };
- DZE_ActionInProgress = false;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement