Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- _item spawn player_wearClothes;
- Added Female skin changes - DayZ Epoch - vbawol
- Removed backpack check and remove/add backpack after skinswitch (if needed) by HALV
- */
- private ["_item","_onLadder","_hasclothesitem","_config","_text","_myModel","_itemNew","_currentSex","_newSex","_model","_playerNear"];
- if(DZE_ActionInProgress) exitWith { cutText [(localize "str_epoch_player_83") , "PLAIN DOWN"] };
- DZE_ActionInProgress = true;
- _item = _this;
- call gear_ui_init;
- _onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
- if (_onLadder) exitWith {DZE_ActionInProgress = false; cutText [(localize "str_player_21") , "PLAIN DOWN"]};
- _hasclothesitem = _this in magazines player;
- _config = configFile >> "CfgMagazines";
- _text = getText (_config >> _item >> "displayName");
- if (!_hasclothesitem) exitWith { DZE_ActionInProgress = false; cutText [format[(localize "str_player_31"),_text,"wear"] , "PLAIN DOWN"]};
- if (vehicle player != player) exitWith { DZE_ActionInProgress = false; cutText [(localize "str_epoch_player_85"), "PLAIN DOWN"]};
- //if (!isNull (unitBackpack player)) exitWith { DZE_ActionInProgress = false; cutText ["\n\nUnable to change clothes while wearing backpack.", "PLAIN DOWN"] };
- if ("CSGAS" in (magazines player)) exitWith { DZE_ActionInProgress = false; cutText ["\n\nUnable to change clothes while carrying a filled chainsaw.", "PLAIN DOWN"] };
- _myModel = (typeOf player);
- _itemNew = "Skin_" + _myModel;
- //diag_log ("Debug Clothes: model In: " + str(_itemNew) + " Out: " + str(_item));
- 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");
- //diag_log ("Debug Clothes: sex In: " + str(_currentSex) + " Out: " + str(_newSex));
- if(_currentSex == _newSex) then {
- // Get model name from config
- _model = getText (configFile >> "CfgSurvival" >> "Skins" >> _item >> "playerModel");
- if (_model != _myModel) then {
- if(([player,_item] call BIS_fnc_invRemove) == 1) then {
- player addMagazine _itemNew;
- _dayz_myBackpack = unitBackpack player;
- _Backpack = (typeOf _dayz_myBackpack);
- _WeCargo = "";
- _MaCargo = "";
- if (_Backpack !="") then {
- _WeCargo = getWeaponCargo Unitbackpack player;
- _MaCargo = getMagazineCargo Unitbackpack player;
- diag_log format["HALV_EXCHANGE: Got cargo & removed Backpack, ready to switch (%1) %8 (%2) %3 %4 %5 %6 %7",dayz_playerName,_model,_currentSex,_dayz_myBackpack,_Backpack,_WeCargo,_MaCargo,_myModel];
- removeBackpack player;
- };
- [dayz_playerUID,dayz_characterID,_model] spawn player_humanityMorph;
- if (_Backpack !="") then {
- titleText [format["Switching Backpack pack, pls wait ..."], "PLAIN DOWN"];titlefadeout 3;
- sleep 3;
- player addBackpack _Backpack;
- //Weapons
- _WeTypes = [];
- _WeCount = [];
- if (count _WeCargo > 0) then {_WeTypes = _WeCargo select 0;_WeCount = _WeCargo select 1;};
- _countr = 0;
- {(Unitbackpack player) addWeaponCargoGlobal [_x,(_WeCount select _countr)];_countr = _countr + 1;} forEach _WeTypes;
- //Magazines
- _MaTypes = [];
- _MaCount = [];
- if (count _MaCargo > 0) then {_MaTypes = _MaCargo select 0;_MaCount = _MaCargo select 1;};
- _countr = 0;
- {(Unitbackpack player) addmagazinecargoGlobal [_x,(_MaCount select _countr)];_countr = _countr + 1;} forEach _MaTypes;
- _WeCargo1 = getWeaponCargo (Unitbackpack player);
- _MaCargo1 = getMagazineCargo (Unitbackpack player);
- diag_log format["HALV_EXCHANGE: Done - Backpack stuff changed to next bag and added to player (%1) %8 (%2) %3 %4 %5 %6 %7",dayz_playerName,_model,_currentSex,_dayz_myBackpack,_Backpack,_WeCargo,_MaCargo,_myModel];
- };
- };
- };
- } else {
- cutText [(localize "str_epoch_player_86"), "PLAIN DOWN"];
- };
- };
- };
- DZE_ActionInProgress = false;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement