Jump to content

[Release] Zabns Take Clothes [Updated for 1.0.7]


salival

Recommended Posts

@Aelenia

but if u wanna do it.. using the fn_selfactions provided by vkc... (its more easy) then...

just open the fn_selfactions.sqf by vkc and follow this steps added by salival in take clothes guide:

Spoiler



If you already have a fn_selfActions.sqf

Find these lines

player removeAction s_player_fuelauto;
s_player_fuelauto = -1;
player removeAction s_player_fuelauto2;
s_player_fuelauto2 = -1;
player removeAction s_player_manageDoor;
s_player_manageDoor = -1;

and add directly below:

// Take Clothes by Zabn
player removeAction s_player_clothes;
s_player_clothes = -1;

Find these lines

} else {
	player removeAction s_player_fillgen;
	s_player_fillgen = -1;
};

and add directly below:

_clothesTaken = _cursorTarget getVariable["clothesTaken",false];
_isZombie = _cursorTarget isKindOf "zZombie_base"; // Add this here now since epoch 1.0.6 doesn't initialize this where this will go.

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

 

now in your custom variables.sqf

Spoiler

Find this line:

s_player_manageDoor = -1;

and add directly below:

s_player_clothes = -1; // Zabns take clothes

 

 

Link to comment
Share on other sites

Just now, Aelenia said:

@juandayz

Oh.. :blush: I saw that part of his tut but for whatever reason I thought it means having an outdated version of vkc and just ignored it.

I'll try it out later. Again: Thanks a lot for your help!

oh yes,, your right.. its for an outdate version.. but what i mean you can use those codes for find and merge

Link to comment
Share on other sites

  • 3 months later...

getting this in client rpt.  

Spoiler

if (_isMan and !_isAlive and !_isZombie and !_clothesTaken) then {
_is>
  Error position: <_isZombie and !_clothesTaken) then {
_is>
  Error Undefined variable in expression: _iszombie
File mpmissions\__CUR_MP.Chernarus\dayz_code\compile\fn_selfActions.sqf, line 934
Error in expression <

 

Link to comment
Share on other sites

24 minutes ago, Hooty said:

getting this in client rpt.  

  Hide contents

if (_isMan and !_isAlive and !_isZombie and !_clothesTaken) then {
_is>
  Error position: <_isZombie and !_clothesTaken) then {
_is>
  Error Undefined variable in expression: _iszombie
File mpmissions\__CUR_MP.Chernarus\dayz_code\compile\fn_selfActions.sqf, line 934
Error in expression <

 

https://github.com/oiad/TakeClothes#fn_selfactionssqf

Link to comment
Share on other sites

  • 3 weeks later...

well @salival.. an old friend show me the way.. i dont wanna say his name cuz you gonna get crazy,,, but here is the code for take clothes from ai and from players too.. later you can clean it a little ( my friend way dsnt save the groups if players are in group)..and you can add it latter to the list of ALL YOUR MODS........my friend give you permission  but fix the player wear clothes over players using that skins and fix Ai dsnt attack players on other skin faction....
 

 

 

 

*Allow players to wear clothes from dead ai.

*Allow admins to define what skins can be taken

*Allow admins to add any kind of model from other factions in ESSV3 in (class spawn) (be care, some models have a small inventory and others do not allow backpacks)

*Skins are saved after restart.

*Ai still attack players of his same faction. example a player wearing an east side model.

*That skins are allowed to use "wear clothes" over default item clothes with right click.

*Zabans normal Take Clothes work with that update too.

*Issues- If players are in group.. the group get lost after change for this skins, but they can join again.

 

1-open your custom variables.sqf and at very top paste:  (you can change the list of skins.. this ones was tested and all of they allow carry backpacks and have normal inventorys.

BUT WARNING DO NOT PUT MODELS DEFINED AS TRADERS in server_traders = []; otherway that bots gonna have the option to trade.

PASTE:

Spoiler
  1. /READY FOR TAKE CLOTHES//
  2. Skins_For_TakeClothes = ["GUE_Soldier_Sniper","TK_INS_Soldier_AAT_EP1","TK_INS_Soldier_2_EP1","TK_INS_Soldier_EP1",
  3. "TK_INS_Soldier_4_EP1","TK_INS_Soldier_3_EP1","TK_GUE_Soldier_2_EP1","GUE_Soldier_CO","GUE_Soldier_Crew_DZ",
  4. "TK_Soldier_EP1","RUS_Commander","TK_Soldier_Officer_EP1","RU_Soldier_Officer","MVD_Soldier","RU_Soldier_Pilot","CZ_Soldier_Spec2_Wdl_ACR",
  5. "UKSF_des_demo","Soldier_GL_M16A2_PMC","Soldier_Bodyguard_AA12_PMC_DZ","Winter_SOF_DA1","CZ_Soldier_Spec1_Wdl_ACR","Desert_SOF_DA1b","UKSF_wdl_tl_l"];//thers a few from overpoch.
  6. AllPlayers = AllPlayers + Skins_For_TakeClothes;
  7. //READY FOR TAKE CLOTHES//

 

2-Now you need asign the boths from the variables.sqf list in your missions files. (WAI.DZAI.DZMS.EVENTS..whatever)

A-For WAI for example: \@DayZ_Epoch_Server\addons\dayz_server\WAI\config.sqf

Spoiler

ai_hero_skin= ["MVD_Soldier_GL","TK_Soldier_EP1","TK_Soldier_Officer_EP1","RU_Soldier_Officer"];

ai_bandit_skin =["GUE_Soldier_Sniper","TK_Aziz_EP1","GUE_Soldier_Crew_DZ","GUE_Soldier_CO"];

ai_special_skin             = ["RUS_Commander"];

 

2-B- For DZAI for example:\@DayZ_Epoch_Server\addons\dayz_server\DZAI\init\DZAI_config.sqf

Spoiler

DZAI_BanditTypes =["TK_Aziz_EP1","TK_INS_Soldier_3_EP1","TK_INS_Soldier_EP1","TK_INS_Soldier_AAT_EP1"];

 

3-Open your custom compiles.sqf and made this call into !dedicated section:

Spoiler

player_wearClothes = compile preprocessFileLineNumbers "dayz_code\compile\player_wearClothes.sqf";

 

4-into mpmissions\your isntance\dayz_code\compile\  create player_wearClothes.sqf and paste this code inside:

Spoiler

if (dayz_lastClothesChange + 5 > diag_tickTime) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
dayz_lastClothesChange = diag_tickTime;
 
// Make sure no other players are nearby
_playerNear = {isPlayer _x} count (([player] call FNC_GetPos) nearEntities ["CAManBase",12]) > 1;
if (_playerNear) exitWith {localize "STR_EPOCH_PLAYER_84" call dayz_rollingMessages;};
 
if (_this in DZE_RestrictSkins) exitWith { format[localize "str_epoch_player_315",_this] call dayz_rollingMessages; };
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
dayz_actionInProgress = true;
/*
_item call player_wearClothes;
Added Female skin changes - DayZ Epoch - vbawol
*/
private ["_item","_onLadder","_hasclothesitem","_config","_text","_isFemale","_myModel","_humanity","_isBandit","_isHero",
"_itemNew","_model","_skinToArray","_finalArray","_skinToModel","_morphHandle"];
 
_item = _this;
call gear_ui_init;
 
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
if (_onLadder) exitWith {localize "str_player_21" call dayz_rollingMessages; dayz_actionInProgress = false;};
 
_hasclothesitem = _this in magazines player;
_config = configFile >> "CfgMagazines";
_text = getText (_config >> _item >> "displayName");
 
if (!_hasclothesitem) exitWith {format[localize "str_player_31",_text,localize "str_player_31_wear"] call dayz_rollingMessages; dayz_actionInProgress = false;};
 
if (vehicle player != player) exitWith {localize "str_player_fail_wear1" call dayz_rollingMessages; dayz_actionInProgress = false;};
//if (!isNull (unitBackpack player)) exitWith {dayz_actionInProgress = false; localize "STR_EPOCH_ACTIONS_9" call dayz_rollingMessages;};
if ("CSGAS" in (magazines player)) exitWith {dayz_actionInProgress = false; localize "STR_EPOCH_ACTIONS_10" call dayz_rollingMessages;};
 
_myModel = (typeOf player);
_humanity = player getVariable ["humanity",0];
_isBandit = _humanity < -2000;
_isHero = _humanity > 5000;
_itemNew = "Skin_" + _myModel;
_morphHandle = nil;
 
if ( (isClass(_config >> _itemNew)) or  (_myModel in Skins_For_TakeClothes)) 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) or (_currentSex != _newSex) && (typeOf player in Skins_For_TakeClothes) && (_newSex == "male")) 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 {
                if !(_myModel in Skins_For_TakeClothes) then {
                    player addMagazine _itemNew;                   
                    }else{
                    player addMagazine "Skin_Survivor2_DZ";
                    };
                    _morphHandle = [dayz_playerUID,dayz_characterID,_model] spawn player_humanityMorph;
                };
            } else {
                localize "str_player_fail_wear3" call dayz_rollingMessages;
            };
        } else {
            localize "str_epoch_player_86" call dayz_rollingMessages;
        };
    };
}else{
"something went wrong..." call dayz_rollingMessages;
};
 
if (isNil "_morphHandle") then {
    // Don't set if humanity morph is still in progress (done at bottom of humanityMorph)
    dayz_actionInProgress = false;
};

 

5-change your takeClothes.sqf by this one.

Spoiler

private ["_body","_Body_Clothes","_playerNear","_ItemBody_Clothes","_default_Epoch_Clothes","_CurrentPlayerSkin","_playerOutput","_result","_group","_oldGroup","_leader"];
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
_body = _this select 3;
_Body_Clothes = typeOf _body;
if (isNull _body) exitWith {format["%1 its not a supported skin",cursorTarget] call dayz_rollingMessages;};
 
_playerNear = {isPlayer _x} count (([_body] call FNC_GetPos) nearEntities ["CAManBase", 10]) > 1;
if (_playerNear) exitWith {localize "str_pickup_limit_5" call dayz_rollingMessages;};
 
dayz_actionInProgress = true;
player removeAction s_player_clothes;
s_player_clothes = -1;
 
//Defines Output For take clothes
_ItemBody_Clothes = _Body_Clothes;
switch (_ItemBody_Clothes) do {case "Survivor3_DZ": {_Body_Clothes = "Survivor2_DZ";};case "Bandit1_DZ": {_Body_Clothes = "Survivor2_DZ";};};
_ItemBody_Clothes = "Skin_" + _ItemBody_Clothes;
_default_Epoch_Clothes = isClass (configFile >> "CfgMagazines" >> _ItemBody_Clothes);
//Define OutPut for WearClothes
_CurrentPlayerSkin = (typeOf player);
_playerOutput = "Skin_" + _CurrentPlayerSkin;
 
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;};
 
if (_Body_Clothes in Skins_For_TakeClothes) then {
if (_CurrentPlayerSkin in Skins_For_TakeClothes) then {
_result = [player,"Skin_Survivor2_DZ"] call BIS_fnc_invAdd;
}else{
_result = [player,_playerOutput] call BIS_fnc_invAdd;
};
}else{
_result = [player,_ItemBody_Clothes] call BIS_fnc_invAdd;
};
 
if !(_result) exitWith {"You didn't have enough room in your inventory" call dayz_rollingMessages;dayz_actionInProgress = false;};
 
_body setVariable["clothesTaken",true,true];
 
///////////////////////////////////////////////////////WEAR CLOTHES////////////////////////////////////////////////////////////
 
if (_Body_Clothes in Skins_For_TakeClothes) then {
  
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;};
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;};
  
_group = createGroup west;
_oldGroup = group player;
_leader = (player == leader _oldGroup);
 
[dayz_playerUID,dayz_characterID,_Body_Clothes] call player_humanityMorph;
/*
if (!isNil "dayz_groupInit" && count (units _oldGroup) > 0) then {
        [player] joinSilent _oldGroup;
        if (_leader) then {
            PVDZ_Server_UpdateGroup = [-1,player];
            publicVariableServer "PVDZ_Server_UpdateGroup";
        };
    }else{
    [player] joinSilent _group;
    }; 
*/ 
[player] joinSilent _group;
 
format["Your new outfit is %1. Your old clothes was added to your inventory",_Body_Clothes] call dayz_rollingMessages;
 
}else{
///////////////////////////////////////////////////////TAKE CLOTHES////////////////////////////////////////////////////////////
player playActionNow "Medic";
format["One %1 has been added to your inventory!",_Body_Clothes] call dayz_rollingMessages;
};
dayz_actionInProgress = false;

 

6-Open your ESSV3 folder spawn/main.sqf

find:

Spoiler

if !(PVCDZ_plr_Login2 select 4) exitWith {

    #include "functions\finish.sqf"

    #include "functions\cleanup.sqf"

BELOW PASTE:

Spoiler

f (typeOf player in Skins_For_TakeClothes) then {

    _group = createGroup west;

    [player] joinSilent _group;

};

 

FIND:

Spoiler

_handle = [dayz_playerUID,dayz_characterID,_model] spawn player_humanityMorph;

            uiSleep 0.2;

 

below paste:

Spoiler

if (typeOf player in Skins_For_TakeClothes) then {

            _group = createGroup west;

            [player] joinSilent _group;

            };

 

Link to comment
Share on other sites

  • 2 months later...

Hey, I followed the wiki instructions

 

Created "scripts" folder to mpmissions

created "dayz_code" folder to mpmissions and  "init" and "compile" folders under it.

Added following files from the github download:
 

DayZ Epoch Server\MPMissions\DayZ_Epoch_11.Chernarus\scripts\takeClothes.sqf

DayZ Epoch Server\MPMissions\DayZ_Epoch_11.Chernarus\dayz_code\compile\fn_selfActions.sqf

DayZ Epoch Server\MPMissions\DayZ_Epoch_11.Chernarus\dayz_code\init\compiles.sqf

DayZ Epoch Server\MPMissions\DayZ_Epoch_11.Chernarus\dayz_code\init\variables.sqf

 

edited init.sqf to:


 

initialized = false;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\variables.sqf";
call compile preprocessFileLineNumbers "dayz_code\init\variables.sqf";
progressLoadingScreen 0.05;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\publicEH.sqf";
progressLoadingScreen 0.1;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\setup_functions_med.sqf";
progressLoadingScreen 0.15;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf";
call compile preprocessFileLineNumbers "dayz_code\init\compiles.sqf";
progressLoadingScreen 0.25;
call compile preprocessFileLineNumbers "server_traders.sqf";
call compile preprocessFileLineNumbers "logistic\init.sqf";
call compile preprocessFileLineNumbers "\z\addons\dayz_code\system\mission\chernarus11.sqf"; //Add trader city objects locally on every machine early
initialized = true;

The server loads just fine, no RPT errors or problems connecting/playing, but nobody gets the option to take clothes from corpses.

I'm running latest infistar antihack. Do I need to whitelist this addon somewhere?

Link to comment
Share on other sites

2 hours ago, Stefeman said:

Hey, I followed the wiki instructions

 

Created "scripts" folder to mpmissions

created "dayz_code" folder to mpmissions and  "init" and "compile" folders under it.

Added following files from the github download:
 


DayZ Epoch Server\MPMissions\DayZ_Epoch_11.Chernarus\scripts\takeClothes.sqf

DayZ Epoch Server\MPMissions\DayZ_Epoch_11.Chernarus\dayz_code\compile\fn_selfActions.sqf

DayZ Epoch Server\MPMissions\DayZ_Epoch_11.Chernarus\dayz_code\init\compiles.sqf

DayZ Epoch Server\MPMissions\DayZ_Epoch_11.Chernarus\dayz_code\init\variables.sqf

 

edited init.sqf to:


 


initialized = false;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\variables.sqf";
call compile preprocessFileLineNumbers "dayz_code\init\variables.sqf";
progressLoadingScreen 0.05;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\publicEH.sqf";
progressLoadingScreen 0.1;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\setup_functions_med.sqf";
progressLoadingScreen 0.15;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf";
call compile preprocessFileLineNumbers "dayz_code\init\compiles.sqf";
progressLoadingScreen 0.25;
call compile preprocessFileLineNumbers "server_traders.sqf";
call compile preprocessFileLineNumbers "logistic\init.sqf";
call compile preprocessFileLineNumbers "\z\addons\dayz_code\system\mission\chernarus11.sqf"; //Add trader city objects locally on every machine early
initialized = true;

The server loads just fine, no RPT errors or problems connecting/playing, but nobody gets the option to take clothes from corpses.

I'm running latest infistar antihack. Do I need to whitelist this addon somewhere?

Hi,

if this is a fresh server, I'm not sure.. It should work straight out of the box.

If you're not getting the option, it's normally a fn_selfActions issue.

Try without infistar and see if that does it.

Link to comment
Share on other sites

try this in selfactions.sqf

Replace the relevant code of take clothes with this:

Find this in your selfactions:

Quote

if (_isMan && {!_isAlive} && {!(_cursorTarget isKindOf "zZombie_base")} && {!(_cursorTarget getVariable["clothesTaken",false])}) then {
		if (s_player_clothes < 0) then {
				s_player_clothes = player addAction [format["<t color='#0059FF'>%1</t>",localize "STR_CL_TC_TAKE_CLOTHES"],"scripts\takeClothes.sqf",_cursorTarget,0, false,true];
			};
	} else {
		player removeAction s_player_clothes;
		s_player_clothes = -1;
	};

and replace with this:

Quote

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

Make sure you have the takeclothes.sqf inside scripts folder

Works for me

Link to comment
Share on other sites

18 minutes ago, totis said:

try this in selfactions.sqf

Replace the relevant code of take clothes with this:

Find this in your selfactions:

and replace with this:

Make sure you have the takeclothes.sqf inside scripts folder

Works for me

That won't work since he won't have _clothesTaken.

@Stefemanwithout seeing your files or client/server rpts it's hard to know.

You should also start fresh without the 1.0.6.1 files/hotfix files.

Link to comment
Share on other sites

2 hours ago, Stefeman said:

Your server install is not correct. There are tons of config errors in your rpt. Stuff like this:

20:03:58 Warning Message: No entry 'bin\config.bin/CfgMagazines.ItemKeyKit'.

Also, don't use EMS. That mission system was abandoned by its creator a very long time ago. It is essentially a carbon copy of an older version of DZMS.

Link to comment
Share on other sites

9 hours ago, JasonTM said:

Your server install is not correct. There are tons of config errors in your rpt. Stuff like this:


20:03:58 Warning Message: No entry 'bin\config.bin/CfgMagazines.ItemKeyKit'.

Also, don't use EMS. That mission system was abandoned by its creator a very long time ago. It is essentially a carbon copy of an older version of DZMS.

Disregarding those issues, my server runs just fine.

Can I pay you to have a closer look about why the Take Clothes is not working. (I run a non-profit server for a group of 10 friends).

I can pay via Paypal/Skrill/BTC/ETH or via anything you wish. I could really use help from someone who knows this better.

My server is a Windows Server 2012 R2 and has remote desktop access. the gamefiles are in a folder at desktop.

Link to comment
Share on other sites

17 hours ago, Stefeman said:

Disregarding those issues, my server runs just fine.

Can I pay you to have a closer look about why the Take Clothes is not working. (I run a non-profit server for a group of 10 friends).

I can pay via Paypal/Skrill/BTC/ETH or via anything you wish. I could really use help from someone who knows this better.

My server is a Windows Server 2012 R2 and has remote desktop access. the gamefiles are in a folder at desktop.

You cannot just disregard those config errors. They will cause conflicts in other places.

I also notice in your rpt that you have config errors regarding the Overwatch mod.

20:03:59 Warning Message: Error: creating weapon vil_USP with scope=private

I can see that you are not loading the Overwatch mod and that you are using the 1.0.6.1 config system/batch file here:

== arma2oaserver.exe  -port=2302 "-config=instance_11_Chernarus\config.cfg" "-cfg=instance_11_Chernarus\basic.cfg" "-profiles=instance_11_Chernarus" -name=instance_11_Chernarus "-mod=@DayZ_Epoch;@DayZ_Epoch_Server;"

You really need to dump this server install and start with a clean, error free install.

I have made video tutorials on how to do this.

 

Link to comment
Share on other sites

  • 10 months later...
5 hours ago, kuulpahe said:

Script.log say it its normal or its error to kick peeps or whats happened?


24.01.2019 01:56:44: jonas (ip) id - #15 "#line 1 "mpmissions\__CUR_MP.Chernarus\dayz_code\init\compiles.sqf"
if (isServer) then {
diag_log "Loading custom server compile"

 

It's normal, i'm guessing your scripts.txt filters for `compile`

You could whitelist it with:

!"diag_log \"Loading custom server compile"

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...