Advertisement
Guest User

Player_wearClothes.sqf

a guest
Jun 17th, 2014
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.35 KB | None | 0 0
  1. /*
  2. _item spawn player_wearClothes;
  3. Added Female skin changes - DayZ Epoch - vbawol
  4. */
  5. private ["_item","_onLadder","_hasclothesitem","_config","_text","_myModel","_itemNew","_currentSex","_newSex","_model","_playerNear"];
  6.  
  7. if(DZE_ActionInProgress) exitWith { cutText [(localize "str_epoch_player_83") , "PLAIN DOWN"] };
  8. DZE_ActionInProgress = true;
  9.  
  10. _item = _this;
  11. call gear_ui_init;
  12.  
  13. _onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
  14. if (_onLadder) exitWith {DZE_ActionInProgress = false; cutText [(localize "str_player_21") , "PLAIN DOWN"]};
  15.  
  16. _hasclothesitem = _this in magazines player;
  17. _config = configFile >> "CfgMagazines";
  18. _text = getText (_config >> _item >> "displayName");
  19.  
  20. if (!_hasclothesitem) exitWith { DZE_ActionInProgress = false; cutText [format[(localize "str_player_31"),_text,"wear"] , "PLAIN DOWN"]};
  21.  
  22. if (vehicle player != player) exitWith { DZE_ActionInProgress = false; cutText [(localize "str_epoch_player_85"), "PLAIN DOWN"]};
  23.  
  24. if (!isNull (unitBackpack player)) exitWith { DZE_ActionInProgress = false; cutText [(localize "STR_EPOCH_ACTIONS_9"), "PLAIN DOWN"] };
  25.  
  26. if ("CSGAS" in (magazines player)) exitWith { DZE_ActionInProgress = false; cutText [(localize "STR_EPOCH_ACTIONS_10"), "PLAIN DOWN"] };
  27.  
  28. _myModel = (typeOf player);
  29. _itemNew = "Skin_" + _myModel;
  30.  
  31. //diag_log ("Debug Clothes: model In: " + str(_itemNew) + " Out: " + str(_item));
  32.  
  33. if ( (isClass(_config >> _itemNew)) ) then {
  34. if ( (isClass(_config >> _item)) ) then {
  35. // Current sex of player skin
  36.  
  37. _currentSex = getText (MissionConfigFile >> "CfgSurvival" >> "Skins" >> _itemNew >> "sex");
  38. // Sex of new skin
  39. _newSex = getText (MissionConfigFile >> "CfgSurvival" >> "Skins" >> _item >> "sex");
  40. //diag_log ("Debug Clothes: sex In: " + str(_currentSex) + " Out: " + str(_newSex));
  41.  
  42. if(_currentSex == _newSex) then {
  43. // Get model name from config
  44. _model = getText (MissionConfigFile >> "CfgSurvival" >> "Skins" >> _item >> "playerModel");
  45. if (_model != _myModel) then {
  46. if(([player,_item] call BIS_fnc_invRemove) == 1) then {
  47. player addMagazine _itemNew;
  48. [dayz_playerUID,dayz_characterID,_model] spawn player_humanityMorph;
  49. };
  50. };
  51.  
  52. } else {
  53. cutText [(localize "str_epoch_player_86"), "PLAIN DOWN"];
  54. };
  55. };
  56. };
  57. DZE_ActionInProgress = false;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement