Advertisement
Guest User

Untitled

a guest
Apr 2nd, 2015
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.87 KB | None | 0 0
  1. private["_playernear","_itemNew","_onLadder","_skin","_body","_okSkin","_result","_bag","_bmags","_bweps","_corpse","_mags","_object","_weps","_newhs","_newkillsB","_newkillsH","_headShots","_killsB","_killsH","_newkills","_name"];
  2. _body = _this select 3;
  3. DZE_ActionInProgress = true;
  4. _onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
  5. if (_onLadder) exitWith {DZE_ActionInProgress = false;cutText ["I can not perform this action while on a ladder!" , "PLAIN DOWN"]};
  6. _playernear = ({isPlayer _x} count (getPos vehicle player nearEntities [["CAManBase"], 8]))-1;
  7. if (_playernear != 0) exitWith {DZE_ActionInProgress = false;cutText [format["You cannot fill while another player is nearby"] , "PLAIN DOWN"]};
  8.  
  9.  
  10. if (vehicle player != player) exitWith {DZE_ActionInProgress = false;cutText ["You can not take clothes while in a vehicle.", "PLAIN DOWN"]};
  11.  
  12. player removeAction s_player_clothes;
  13. s_player_clothes = -1;
  14.  
  15. _skin = (typeOf _body);
  16. _itemNew = _skin;
  17. _isSoldier = (typeOf _body == 'FR_Assault_R');
  18.  
  19. switch (_itemNew) do {
  20. case "Survivor3_DZ": {
  21. _itemNew = "Soldier_Sniper_PMC_DZ";
  22. };
  23.  
  24. };
  25.  
  26. if (!_isSoldier) then {
  27. _itemNew = "Skin_" + _itemNew;
  28. _okSkin = isClass (ConfigFile >> "CfgMagazines" >> _itemNew);
  29. } else {
  30. _okSkin = true;
  31. };
  32. if (_okSkin) then {
  33. player playActionNow "Medic";
  34. sleep 3;
  35. if (!_isSoldier) then {
  36. _result = [player,_itemNew] call BIS_fnc_invAdd;
  37. } else {
  38. [dayz_playerUID,dayz_characterID,_itemNew] spawn player_humanityMorph;
  39. _result = true;
  40. };
  41. if (_result) then {
  42. _mags = magazines _body;
  43. _weps = weapons _body;
  44. _bag = unitBackpack _body;
  45. _corpse = createVehicle ["GraveDZE", position _body, [], 0, "CAN_COLLIDE"];
  46. _name = _body getVariable ["bodyName","unknown"];
  47.  
  48. _corpse setVariable ["bodyName",_name,true];
  49. _corpse setVariable ["permaLoot",true];
  50. {_corpse addMagazineCargoGlobal [_x, 1];} forEach _mags;
  51. {_corpse addWeaponCargoGlobal [_x, 1];} forEach _weps;
  52. if (!isNull _bag) then {
  53. _bmags = getMagazineCargo _bag;
  54. _bweps = getWeaponCargo _bag;
  55. _corpse addBackpackCargoGlobal [(typeOf _bag), 1];
  56. {_corpse addMagazineCargoGlobal [_x, ((_bmags select 1) select _forEachIndex)];} forEach (_bmags select 0);
  57. {_corpse addWeaponCargoGlobal [_x, ((_bweps select 1) select _forEachIndex)];} forEach (_bweps select 0);
  58. };
  59. if (!isNull _body) then {deleteVehicle _body};
  60. cutText ["I put the clothes in my inventory", "PLAIN DOWN"];
  61. } else {
  62. cutText ["I do not have enough room in my inventory.", "PLAIN DOWN"];
  63. player switchMove "";
  64. player playActionNow "stop";
  65. };
  66. } else {
  67. cutText [format["I'm not able to take them off"], "PLAIN DOWN"];
  68. player switchMove "";
  69. player playActionNow "stop";
  70. };
  71. DZE_ActionInProgress = false;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement