mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-02-09 01:32:53 +03:00
47 lines
1.8 KiB
Plaintext
47 lines
1.8 KiB
Plaintext
/*
|
|
_item spawn player_wearClothes;
|
|
Added Female skin changes - vbawol
|
|
*/
|
|
private["_item","_onLadder","_hasclothesitem","_config","_text","_isFemale","_myModel","_itemNew","_currentSex","_newSex","_model"];
|
|
|
|
_item = _this;
|
|
call gear_ui_init;
|
|
|
|
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
|
|
if (_onLadder) exitWith {cutText [(localize "str_player_21") , "PLAIN DOWN"]};
|
|
|
|
_hasclothesitem = _this in magazines player;
|
|
_config = configFile >> "CfgMagazines";
|
|
_text = getText (_config >> _item >> "displayName");
|
|
|
|
if (!_hasclothesitem) exitWith {cutText [format[(localize "str_player_31"),_text,"wear"] , "PLAIN DOWN"]};
|
|
|
|
if (vehicle player != player) exitWith {cutText ["You may not change clothes while in a vehicle", "PLAIN DOWN"]};
|
|
|
|
// _isFemale = ((typeOf player == "SurvivorW2_DZ")||(typeOf player == "BanditW1_DZ"));
|
|
// if (_isFemale) exitWith {cutText ["Currently Female Characters cannot change to this skin. This will change in a future update.", "PLAIN DOWN"]};
|
|
|
|
_myModel = (typeOf player);
|
|
_itemNew = "Skin_" + _myModel;
|
|
|
|
if ( (isClass(_config >> _itemNew)) ) then {
|
|
if ( (isClass(_config >> _item)) ) then {
|
|
// Current sex of player skin
|
|
|
|
_currentSex = getText (configFile >> "CfgSurvival" >> "Skins" >> _itemNew >> "sex");
|
|
// Sex of new skin
|
|
_newSex = getText (configFile >> "CfgSurvival" >> "Skins" >> _item >> "sex");
|
|
if(_currentSex == _newSex) then {
|
|
// Get model name from config
|
|
_model = getText (configFile >> "CfgSurvival" >> "Skins" >> _item >> "playerModel");
|
|
if (_model != _myModel) then {
|
|
player removeMagazine _item;
|
|
player addMagazine _itemNew;
|
|
[dayz_playerUID,dayz_characterID,_model] spawn player_humanityMorph;
|
|
};
|
|
|
|
} else {
|
|
cutText ["You cannot wear a skin of the opposite sex.", "PLAIN DOWN"];
|
|
};
|
|
};
|
|
}; |