Advertisement
Guest User

Untitled

a guest
Jan 18th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.38 KB | None | 0 0
  1. private ["_body","_Body_Clothes","_playerNear","_ItemBody_Clothes","_default_Epoch_Clothes","_CurrentPlayerSkin","_playerOutput","_result","_group","_oldGroup","_leader"];
  2. if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
  3. _body = _this select 3;
  4. _Body_Clothes = typeOf _body;
  5. if (isNull _body) exitWith {format["%1 its not a supported skin",cursorTarget] call dayz_rollingMessages;};
  6.  
  7. _playerNear = {isPlayer _x} count (([_body] call FNC_GetPos) nearEntities ["CAManBase", 10]) > 1;
  8. if (_playerNear) exitWith {localize "str_pickup_limit_5" call dayz_rollingMessages;};
  9.  
  10. dayz_actionInProgress = true;
  11. player removeAction s_player_clothes;
  12. s_player_clothes = -1;
  13.  
  14. //Defines Output For take clothes
  15. _ItemBody_Clothes = _Body_Clothes;
  16. switch (_ItemBody_Clothes) do {case "Survivor3_DZ": {_Body_Clothes = "Survivor2_DZ";};case "Bandit1_DZ": {_Body_Clothes = "Survivor2_DZ";};};
  17. _ItemBody_Clothes = "Skin_" + _ItemBody_Clothes;
  18. _default_Epoch_Clothes = isClass (configFile >> "CfgMagazines" >> _ItemBody_Clothes);
  19. //Define OutPut for WearClothes
  20. _CurrentPlayerSkin = (typeOf player);
  21. _playerOutput = "Skin_" + _CurrentPlayerSkin;
  22.  
  23. if ((!_default_Epoch_Clothes) && !(_Body_Clothes in Skins_For_TakeClothes)) exitWith {format["Skin %1 is not supported",_Body_Clothes] call dayz_rollingMessages;dayz_actionInProgress = false;};
  24.  
  25. if (_Body_Clothes in Skins_For_TakeClothes) then {
  26. if (_CurrentPlayerSkin in Skins_For_TakeClothes) then {
  27. _result = [player,"Skin_Survivor2_DZ"] call BIS_fnc_invAdd;
  28. }else{
  29. _result = [player,_playerOutput] call BIS_fnc_invAdd;
  30. };
  31. }else{
  32. _result = [player,_ItemBody_Clothes] call BIS_fnc_invAdd;
  33. };
  34.  
  35. if !(_result) exitWith {"You didn't have enough room in your inventory" call dayz_rollingMessages;dayz_actionInProgress = false;};
  36.  
  37. _body setVariable["clothesTaken",true,true];
  38.  
  39.  
  40.  
  41.  
  42. ///////////////////////////////////////////////////////WEAR CLOTHES////////////////////////////////////////////////////////////
  43.  
  44. if (_Body_Clothes in Skins_For_TakeClothes) then {
  45.  
  46.  
  47. if ((_CurrentPlayerSkin == _Body_Clothes) && (typeOf player in Skins_For_TakeClothes)) exitWith {_body setVariable["clothesTaken",false,false];format["You alredy are using a %1 skin",_Body_Clothes] call dayz_rollingMessages;dayz_actionInProgress = false;};
  48. if (typeOf player in DayZ_Female) exitWith {_body setVariable["clothesTaken",false,false];format["Skin %1 does not allow female characters",_Body_Clothes] call dayz_rollingMessages;dayz_actionInProgress = false;};
  49.  
  50.  
  51.  
  52. _group = createGroup west;
  53. _oldGroup = group player;
  54. _leader = (player == leader _oldGroup);
  55.  
  56. [dayz_playerUID,dayz_characterID,_Body_Clothes] call player_humanityMorph;
  57. /*
  58. if (!isNil "dayz_groupInit" && count (units _oldGroup) > 0) then {
  59. [player] joinSilent _oldGroup;
  60. if (_leader) then {
  61. PVDZ_Server_UpdateGroup = [-1,player];
  62. publicVariableServer "PVDZ_Server_UpdateGroup";
  63. };
  64. }else{
  65. [player] joinSilent _group;
  66. };
  67. */
  68. [player] joinSilent _group;
  69.  
  70. format["Your new outfit is %1. Your old clothes was added to your inventory",_Body_Clothes] call dayz_rollingMessages;
  71.  
  72. }else{
  73. ///////////////////////////////////////////////////////TAKE CLOTHES////////////////////////////////////////////////////////////
  74. player playActionNow "Medic";
  75. format["One %1 has been added to your inventory!",_Body_Clothes] call dayz_rollingMessages;
  76. };
  77. dayz_actionInProgress = false;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement