[Help/Discussion] Zabns Take Clothes

Hi ebay, I'm now getting the flickering as well and it happens quite quickly so is difficult to select/catch the menu.

this happened to me before but, just seemed to settle after time without any changes.

I'm wondering if it may have something to do with this in your instructions for this part:
Find this:
Code (Text):
player removeAction s_player_studybody;
s_player_studybody = -1;

Add right below:
Code (Text):
player removeAction s_player_clothes;
s_player_clothes = -1;

This block of code actually appears twice in fn_selfactions:
player removeAction s_player_studybody;
s_player_studybody = -1;

So mine looks like this at line 441:
// Study Body
if (_player_studybody) then {
if (s_player_studybody < 0) then {
s_player_studybody = player addAction [localize "str_action_studybody", "\z\addons\dayz_code\actions\study_body.sqf",_cursorTarget, 0, false, true, "",""];
};
} else {
player removeAction s_player_studybody;
s_player_studybody = -1;
player removeAction s_player_clothes;
s_player_clothes = -1;
};

and at line 900 looks like this:
player removeAction s_player_studybody;
s_player_studybody = -1;
player removeAction s_player_clothes;
s_player_clothes = -1;

I have it under both, should it be only one of them?

Thanks
 
Hello Everyone,

I have this script working great with Overpoch 1.0.5.1 however I would like to have the following skins available for removal, could someone assist with this?

"gsc_military_helmet_wdl",
"gsc_military_helmet_wdl_AT",
"gsc_military_helmet_grey_AT",
"gsc_military_helmet_wdlSNP",
"gsc_military_helmet_greySNP",
"gsc_military_helmet_grey",
"gsc_military_head_grey",
"gsc_military_head_greySNP",
"gsc_military_head_wdlSNP",
"gsc_military_head_wdl",
"gsc_military_head_wdl_AT",
"gsc_military_head_grey_AT",
"gsc_scientist1",
"gsc_scientist1_head",
"gsc_scientist2",
"gsc_scientist2_head",
"gsc_eco_stalker_mask_fred",
"gsc_eco_stalker_head_fred",
"gsc_eco_stalker_mask_camo",
"gsc_eco_stalker_head_camo1",
"gsc_cloth_loner_head",
"gsc_eco_stalker_mask_duty"
,"gsc_eco_stalker_head_duty",
"gsc_eco_stalker_mask_neutral",
"gsc_eco_stalker_head_neutral",
"nof_fsk_tl","nof_fsk_marksman",
"nof_fsk_grenadier","nof_fsk_heavy",
"nof_fsk_corpsman","MVD_Soldier",
"SBH_Alpha_Soldier1",
"SBH_Alpha_Soldier2",
"SBH_Alpha_Soldier3",
"SBH_Alpha_Soldier4",
"SBH_Alpha_Soldier5",
"SBH_Alpha_Soldier6",
"SBH_Alpha_Soldier7",
"SBH_Alpha_Soldier8",
"SBH_Alpha_Soldier9",
"SBH_Alpha_Soldier10",
"SBH_Alpha_Soldier11",
"SBH_Alpha_Soldier12",
"Winter_OPFOR1",
"Winter_OPFOR2",
"Winter_OPFOR3",
"Winter_OPFOR4",
"Winter_OPFOR5",
"Winter_OPFOR6",
"Winter_OPFOR7",
"Winter_OPFOR8",
"Winter_OPFOR9",
"Winter_OPFOR10",
"EWinter_OPFOR1",
"EWinter_OPFOR2",
"EWinter_OPFOR3",
"EWinter_OPFOR4",
"EWinter_OPFOR5",
"EWinter_OPFOR6",
"EWinter_OPFOR7",
"EWinter_OPFOR8",
"EWinter_OPFOR9",
"EWinter_OPFOR10",
"USMC_SoldierS_Spotter",
"USMC_SoldierS_Sniper",
"USMC_Soldier_Pilot",
"USMC_Soldier_Crew",
"USMC_LHD_Crew_White",
"USMC_LHD_Crew_Blue",
"USMC_LHD_Crew_Brown",
"USMC_LHD_Crew_Green",
"USMC_LHD_Crew_Red",
"USMC_LHD_Crew_Purple",
"USMC_LHD_Crew_Yellow"
 
Hi ebay, after uploading that updated file, I started having some weird problems on my server....

Players kept getting ejected from normal spawn/mission vehicles (character ID 0) and then the vehicle would lock. The player's game would then freeze and they had to shut arma2oa down in task manager. This continued to happen through 3 restart cycles of 3 hours each. There was an average of 12 players on during this time. I am on 1051/112555.

I'm not sure if it's related but, this was the only change I made yesterday. So, I have reverted back to your original file (still with the extra block removed from the post above) and everything seems to have gone back to normal.

I'm not confident the test if sufficient enough though as I only have had up to 6 players on this morning since the rollback so, I'll repost again as my numbers pick up during the day.

Is there anything you think of that could relate my experience to the new file?

EDIT: Scratch the above ebay. Sorry I think it was down to infiSTAR which I forgot was the only other thing I had updated. Since moving onto the next version of infiSTAR everything started working as normal again!
Sorry for doubting your update....! o_O
 
Last edited:
Does anyone have this working properly on dayz vanilla 1.8.1 ? I can't seem to get it to work. Have everything placed properly, and tried some of the fixes on the previous pages, but still doesn't give me the option when im at a dead body.

thanks
 
I read the posts above me, but when I install on my Epoch 1.0.5.1 it flickers. The above solutions did not fix for me. Weird.
 
Hi guys, got a problem. Everything works, but the option "take clothes" blinks. So it dissapears and reapears.. Very annyoing. any fix?
 
Even though OP directions tell you to do it, you do not need to add this near the bottom of fn_selfActions.sqf:
Code:
player removeAction s_player_studybody;
   s_player_studybody = -1;

That is most likely causing the flickering because it is being removed as soon as it is added.

Just make sure in variables.sqf you add this to dayz_resetSelfActions = {:
s_player_clothes = -1;

Thanks for your help,
but it didn't fix the problem for me. I'll send parts of my selfactions to you:

Code:
    // Study Body
    if (_player_studybody) then {
        if (s_player_studybody < 0) then {
            s_player_studybody = player addAction [localize "str_action_studybody", "\z\addons\dayz_code\actions\study_body.sqf",_cursorTarget, 0, false, true, "",""];
        };
    } else {
                player removeAction s_player_clothes;
                s_player_clothes = -1;
    };

Code:
    //Sleep
    if(_isTent && _ownerID == dayz_characterID) then {
        if ((s_player_sleep < 0) && (player distance _cursorTarget < 3)) then {
            s_player_sleep = player addAction [localize "str_actions_self_sleep", "\z\addons\dayz_code\actions\player_sleep.sqf",_cursorTarget, 0, false, true, "",""];
        };
    } else {
        player removeAction s_player_sleep;
        s_player_sleep = -1;
    };

                _clothesTaken = _cursorTarget getVariable["clothesTaken",false];

    // Take clothes by Zabn
    if (_isMan and !_isAlive and !_isZombie and !_clothesTaken) then {
        if (s_player_clothes < 0) then {
            s_player_clothes = player addAction [("<t color='#0096ff'>")+("Take Clothes")+("</t>"), "Scripts\player_takeClothes_v2.sqf",[_cursorTarget], -10, false, true, "",""];
        };
    } else {
        player removeAction s_player_clothes;
        s_player_clothes = -1;
        };

Code:
  // Take Clothes by Zabn
        player removeAction s_player_clothes;
      s_player_clothes = -1;
    };
 
Hi,

Why are not all skins available? I want to add Overwatch skins to be able to be taken. (running overpoch server)

Thanks.
 
Got the same issue here. Want to add Overpoch skins and the script is rejecting them. Obviously they need to be added to the script somehow. Just not sure how to do it. Help?
 
Something I've been meaning to add into this script is a portion for skins that have no parcels for them. Gonna show a rough draft I haven't tested yet...

This is a rough draft that is untested! Maybe someone will try it out or improve on my addition or something. If I get the time I'll test it out myself.

My changes should work like this.
1. Added a female check on body (probably need to add one for the player somewhere doh!)
2. should go through the script regularly if its a regular parcel skin that can be obtained (Skin_)
3. It switches over to my portion if parcel fails where it will attempt to give you the skin you are wearing and put on the skin of the body.

Code:
// By Zabn 2014
private["_itemNew","_isFemale","_PlayeritemNew","_PlayerokSkin","_Playerskin","_PlayeritemNewName","_result2","_onLadder","_skin","_body","_modVariant","_okSkin","_clothesTaken","_itemNewName","_result","_animState","_takeClothesUsageTime","_started","_finished","_takeClothesUseTime"];

if (!isNil "DZE_ActionInProgress") then { // check if this is dayz epoch
    if (DZE_ActionInProgress) exitWith {}; // Do not allow if any script is running.
};

_body = _this select 3;
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
if (_onLadder) exitWith {cutText ["You can't perform this action while on a ladder!" , "PLAIN DOWN"]};

if (vehicle player != player) exitWith {cutText ["You may not take clothes while in a vehicle", "PLAIN DOWN"]};

player removeAction s_player_clothes;
s_player_clothes = -1;

_skin = (typeOf _body);
// get skin of player
_Playerskin = (typeOf player);
_itemNew = _skin;
//
_PlayeritemNew = _Playerskin;
// lets exit script if player is already wearing the skin he is trying to steal...
if (_skin == _Playerskin) exitwith {cutText [format["You are already wearing this skin!"], "PLAIN DOWN"];};

switch (_itemNew) do {
    case "Survivor3_DZ": {
        _itemNew = "Survivor2_DZ";
    };
    case "Bandit1_DZ": {
        _itemNew = "Survivor2_DZ";
    };
};
// switching humanity models that have no parcel for giving back parcels on non supported skins,
// add aditional above and below if additional skin parcels exist.
switch (_PlayeritemNew) do {
    case "Survivor3_DZ": {
        _PlayeritemNew = "Survivor2_DZ";
    };
    case "Bandit1_DZ": {
        _PlayeritemNew = "Survivor2_DZ";
    };
};
// female check on player
_isFemale = ((_Playerskin == "SurvivorW2_DZ") || (_Playerskin == "BanditW1_DZ"));
_itemNew = "Skin_" + _itemNew;
// Adding parcel name value
_PlayeritemNew = "Skin_" + _PlayeritemNew;
_okSkin = isClass (configFile >> "CfgMagazines" >> _itemNew);
// checking new name against configs
_PlayerokSkin = isClass (configFile >> "CfgMagazines" >> _PlayeritemNew);

_takeClothesUseTime = 6;

r_interrupt = false; 
r_doLoop = true; 
_takeClothesUsageTime = time;
_animState = animationState player;
_started = false;
_finished = false;
// if body skin has parcel, or player is not a female.
if((_okSkin) || (!_isFemale)) then {
    _clothesTaken = _body getVariable["clothesTaken",false];
    if(!_clothesTaken) then {
        while {r_doLoop} do {
            private ["_isMedic"];
           
            _clothesTaken = _body getVariable["clothesTaken",false];
            _animState = animationState player;
            _isMedic = ["medic",_animState] call fnc_inString;
            if(_clothesTaken) then { 
                r_doLoop = false; 
            };
            if (_isMedic) then {
                _started = true;
            };
            if(!_isMedic && !r_interrupt && (time - _takeClothesUsageTime) < _takeClothesUseTime) then {
                player playActionNow "Medic"; 
                _isMedic = true;
            };
            if (_started && !_isMedic && (time - _takeClothesUsageTime) > _takeClothesUseTime) then {
                r_doLoop = false; 
                _finished = true;
            };
            if (r_interrupt) then {
                r_doLoop = false; 
            };
            sleep 0.1;
        };
        r_doLoop = false; 
        if(_finished) then {
            // If skin has parcel. Add parcel to body.
            if (_okSkin) then {
            _itemNewName = getText (configFile >> "CfgMagazines" >> _itemNew >> "displayName");
            _result = [player,_itemNew] call BIS_fnc_invAdd;
            if (_result) then {
                _body setVariable["clothesTaken",true,true];
                cutText [format["One %1 has been added to your inventory!",_itemNewName], "PLAIN DOWN"];
            } else {
               
            };
            } else {
                // If no parcel can be obtained from body, humanitymorph to directly wear skin.
                // Checking if current player skin can be moved to inventory and player not female.
                if (_PlayerokSkin && !_isFemale) then {
                _PlayeritemNewName = getText (configFile >> "CfgMagazines" >> _PlayeritemNew >> "displayName");
                _result2 = [player,_PlayeritemNew] call BIS_fnc_invAdd;
                    // If parcel can be made from currently worn skin, added to inventory and humanitymorph to new skin.
                    if (_result2) then {
                        cutText [format["You have packed your %1 up and decided to try on your new clothes instead!",_PlayeritemNewName], "PLAIN DOWN"];
                        sleep 0.5;
                        _body setVariable["clothesTaken",true,true];
                        // maybe add something that changes model of body to regular survivor so players don't try multiple uses?
                        [dayz_playerUID,dayz_characterID,_skin] spawn player_humanityMorph;
                    } else {
                        cutText [format["You didn't have enough room to store a %1 :(",_itemNewName], "PLAIN DOWN"];
                    };
                } else {
                        // If parcel from players worn skin cannot be found, humanity morph and lose skin player was wearing.
                        cutText [format["You lost your %1 you were wearing, but you atleast put on your new clothes!",_Playerskin], "PLAIN DOWN"];
                        sleep 0.5;
                        _body setVariable["clothesTaken",true,true];
                        // maybe add something that changes model of body to what player was wearing?
                        [dayz_playerUID,dayz_characterID,_skin] spawn player_humanityMorph;
                };
            };
        } else {
            if(_clothesTaken) then { 
                player switchMove "";
                player playActionNow "stop";
                cutText ["This Skin has already been taken!", "PLAIN DOWN"];
            } else {
                r_interrupt = false;
                player switchMove "";
                player playActionNow "stop";
                cutText [format["You have interrupted taking clothes!"], "PLAIN DOWN"]; //display text at bottom center of screen on interrupt
            };
        };
    } else {
        cutText ["This Skin has already been taken!", "PLAIN DOWN"];
    };
} else {
    cutText [format["Currently %1 is not supported by the steal skin script.",_skin], "PLAIN DOWN"];
};

Might be a little less realistic this way but at least the skins are obtainable. I might see if I am able to change the skin on a dead body and add a portion to swap skins if there is no parcel to be taken.
 
Last edited:
Still wondering how to add the Overpoch skins to this. Tried pointing it to the mission config file and that didn't work either.
 
hi guys ... the script works very good... but with my new missions ive got a problem...
some skins are not supported... i tried to disable it but it not works, i ve get still the option to take the clothes :(


Code:
// By Zabn 2014
private["_isEpoch","_itemNew","_onLadder","_skin","_body","_okSkin","_clothesTaken","_itemNewName","_result","_animState","_takeClothesUsageTime","_started","_finished","_takeClothesUseTime"];

if (!isNil "DZE_ActionInProgress") then { // check if this is dayz epoch
    if (DZE_ActionInProgress) exitWith {}; // Do not allow if any script is running.
};

_body = (_this select 3) select 0;
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
if (_onLadder) exitWith {cutText ["You can't perform this action while on a ladder!" , "PLAIN DOWN"]};

if (vehicle player != player) exitWith {cutText ["You may not take clothes while in a vehicle", "PLAIN DOWN"]};

player removeAction s_player_clothes;
s_player_clothes = -1;

_skin = (typeOf _body);

_itemNew = _skin;

switch (_itemNew) do {
    case "Survivor3_DZ": {
        _itemNew = "Survivor2_DZ";
    };
    case "Bandit1_DZ": {
        _itemNew = "Survivor2_DZ";
    };
    case "FR_AC": {
    _itemNew = "disabled";
    };
    case "FR_AR": {
    _itemNew = "disabled";
    };
    case "FR_Corpsman": {
    _itemNew = "disabled";
    };
    case "FR_GL": {
    _itemNew = "disabled";
    };
    case "<FR_Marksman>": {
    _itemNew = "disabled";
    };
    case "<FR_R>": {
    _itemNew = "disabled";
    };
    case "FR_Sapper": {
    _itemNew = "disabled";
    };
    case "FR_TL": {
    _itemNew = "disabled";
    };
};

_itemNew = "Skin_" + _itemNew;
_okSkin = isClass (configFile >> "CfgMagazines" >> _itemNew);

_takeClothesUseTime = 6;

r_interrupt = false;
r_doLoop = true;
_takeClothesUsageTime = time;
_animState = animationState player;
_started = false;
_finished = false;

if(_okSkin) then {
    _clothesTaken = _body getVariable["clothesTaken",false];
    if(!_clothesTaken) then {
        while {r_doLoop} do {
            private ["_isMedic"];
           
            _clothesTaken = _body getVariable["clothesTaken",false];
            _animState = animationState player;
            _isMedic = ["medic",_animState] call fnc_inString;
            if(_clothesTaken) then {
                r_doLoop = false;
            };
            if (_isMedic) then {
                _started = true;
            };
            if(!_isMedic && !r_interrupt && (time - _takeClothesUsageTime) < _takeClothesUseTime) then {
                player playActionNow "Medic";
                _isMedic = true;
            };
            if (_started && !_isMedic && (time - _takeClothesUsageTime) > _takeClothesUseTime) then {
                r_doLoop = false;
                _finished = true;
            };
            if (r_interrupt) then {
                r_doLoop = false;
            };
            sleep 0.1;
        };
        r_doLoop = false;

        if(_finished) then {
            _itemNewName = getText (configFile >> "CfgMagazines" >> _itemNew >> "displayName");
            _result = [player,_itemNew] call BIS_fnc_invAdd;
            if (_result) then {
                _body setVariable["clothesTaken",true,true];
                cutText [format["One %1 has been added to your inventory!",_itemNewName], "PLAIN DOWN"];
            } else {
                cutText [format["You didn't have enough room to store a %1 :(",_itemNewName], "PLAIN DOWN"];
            };
        } else {
            if(_clothesTaken) then {
                player switchMove "";
                player playActionNow "stop";
                cutText ["This Skin has already been taken!", "PLAIN DOWN"];
            } else {
                r_interrupt = false;
                player switchMove "";
                player playActionNow "stop";
                cutText [format["You have interrupted taking clothes!"], "PLAIN DOWN"]; //display text at bottom center of screen on interrupt
            };
        };
    } else {
        cutText ["This Skin has already been taken!", "PLAIN DOWN"];
    };
} else {
    cutText [format["Currently %1 is not supported by the steal skin script.",_skin], "PLAIN DOWN"];
};

someone a idea?
 
This part right here is what decides which skins you can use. And your overwatch problem comes from the fact this configfile is an epoch file, and it doesn't include any information about overwatch.
Code:
_okSkin = isClass (configFile >> "CfgMagazines" >> _skin);
To allow players to take ANY skin then set this line
Code:
if(_okSkin) then {
and change it to
Code:
if(true) then {

And if you just want to disable the takeclothes then you can either comment out the addaction lines in your fn_selfactions.sqf or you change
_okSkin = isClass (configFile >> "CfgMagazines" >> _skin);
and replace it with _okskin = false;

(this also will allow you to use the Overwatch skins in OverPuke I would assume).
 
Last edited:
Back
Top