Jump to content
  • 0

1.0.6 Is there a way to "take clothes" (skins)?


Threal

Question

Hey Guys,

I have tried to install the "Take Clothes"-script (Zabns Take Clothes 2.0) but it doesn't work for me in 1.0.6.
Some lines are missing in my "fn_selfActions.sqf".

Anyway.. I want the players to loot skins from AI at missions. I use DZMS.

The "Take-Clothes"-script would be the best so players are also able to take clothes from other players
or is there any way for players/AI to drop their skin after they died.

This would have the same effect as well.

I appreciate your help. Thank you.

 

Link to comment
Share on other sites

11 answers to this question

Recommended Posts

  • 0

WAI has a variable to allow AI to drop skins: 

ai_add_skin					= false;			// adds unit skin to inventory on death
Zabns Takeclothes script works great for me.

Since he's no longer around (Last seen 2014) I've updated his TakeClothes script and put it on my github with changes required for 1.0.6 including the install instructions.

https://github.com/oiad/TakeClothes

Link to comment
Share on other sites

  • 0
44 minutes ago, salival said:

WAI has a variable to allow AI to drop skins: 


ai_add_skin					= false;			// adds unit skin to inventory on death

Zabns Takeclothes script works great for me.

Since he's no longer around (Last seen 2014) I've updated his TakeClothes script and put it on my github with changes required for 1.0.6 including the install instructions.

https://github.com/oiad/TakeClothes

Error in expression <s_player_clothes = -1;

_skin = (typeOf _body);

_itemNew = _skin;

switch (_ite>
  Error position: <_body);

_itemNew = _skin;

switch (_ite>
  Error Undefined variable in expression: _body
File mpmissions\__CUR_MP.namalsk\custom\takeClothes.sqf, line 18

Action doesn't get added to player, with this error in client rpt and not working if executing the code locally

Link to comment
Share on other sites

  • 0
21 minutes ago, Brian Soanes said:

Error in expression <s_player_clothes = -1;

_skin = (typeOf _body);

_itemNew = _skin;

switch (_ite>
  Error position: <_body);

_itemNew = _skin;

switch (_ite>
  Error Undefined variable in expression: _body
File mpmissions\__CUR_MP.namalsk\custom\takeClothes.sqf, line 18

Action doesn't get added to player, with this error in client rpt and not working if executing the code locally

I cannot replicate that on my server, it works fine for me. I have tried on an AI unit and my dead player body

*EDIT* @Brian SoanesI was missing an }; in the install instructions, I have updated the README.md

Cheers for the headsup.

Link to comment
Share on other sites

  • 0

Step 6 can be found in 2 places in fn_selfActions.sqf. Does it go after both or just one of them?

Line 749

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

Line 1159

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

 

Same question for step 7 found at lines 923 and 1145.

Link to comment
Share on other sites

  • 0

@Jim90 step 6:

s_player_information = -1;
	player removeAction s_player_fillgen;
	s_player_fillgen = -1;
	player removeAction s_player_upgrade_build;
	s_player_upgrade_build = -1;
	player removeAction s_player_maint_build;
	s_player_maint_build = -1;
	player removeAction s_player_downgrade_build;
	s_player_downgrade_build = -1;
	player removeAction s_player_towing;
	s_player_towing = -1;
	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;
	
// Take Clothes by Zabn
    player removeAction s_player_clothes;
    s_player_clothes = -1;

step 7:

_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;
};


//Towing with tow truck
	/*
	if(_typeOfCursorTarget == "TOW_DZE") then {
		if (s_player_towing < 0) then {
			if(!(_cursorTarget getVariable ["DZEinTow", false])) then {
				s_player_towing = player addAction [localize "STR_EPOCH_ACTIONS_ATTACH" "\z\addons\dayz_code\actions\tow_AttachStraps.sqf",_cursorTarget, 0, false, true];				
			} else {
				s_player_towing = player addAction [localize "STR_EPOCH_ACTIONS_DETACH", "\z\addons\dayz_code\actions\tow_DetachStraps.sqf",_cursorTarget, 0, false, true];				
			};
		};
	} else {
		player removeAction s_player_towing;
		s_player_towing = -1;
	};

 

@salival a lil suggestion.

maybe :

if (_isMan and !_isAlive && !_isZombie && !_clothesTaken) then {

can be changed by:

if (_isMan and !_isAlive && !_isZombie && !_clothesTaken  &&  !_isPZombie ) then {

to prevent players spawned as zeds can be use the zabans script.

Link to comment
Share on other sites

  • 0
Quote

@salival a lil suggestion.

maybe :


if (_isMan and !_isAlive && !_isZombie && !_clothesTaken) then {

can be changed by:


if (_isMan and !_isAlive && !_isZombie && !_clothesTaken  &&  !_isPZombie ) then {

to prevent players spawned as zeds can be use the zabans script.

We are all ready inside the main script in fn_selfActions that has this check, line 234ish:

if (!isNull _cursorTarget && !_inVehicle && !_isPZombie && (player distance _cursorTarget < _allowedDistance) && _canDo) then {

@Jim90I have updated the install instructions to be clearer.

Link to comment
Share on other sites

  • 0
28 minutes ago, salival said:

We are all ready inside the main script in fn_selfActions that has this check, line 234ish:


if (!isNull _cursorTarget && !_inVehicle && !_isPZombie && (player distance _cursorTarget < _allowedDistance) && _canDo) then {

@Jim90I have updated the install instructions to be clearer.

check in zabans script  the !_invehicle variable is already defined:

if (vehicle player != player) exitWith { "You may not take clothes while in a vehicle" call dayz_rollingMessages; };

 

any way great work salival! +100 points :smile:

Link to comment
Share on other sites

  • 0
4 minutes ago, juandayz said:

check in zabans script  the !_invehicle variable already defined:

if (vehicle player != player) exitWith { "You may not take clothes while in a vehicle" call dayz_rollingMessages; };

 

any way great work salival! +100 points :smile:

Just looking at it, too, We can also remove the ladder check from the script since that section in fn_selfActions also checks if they are on a ladder.

Good catch @juandayz

Link to comment
Share on other sites

  • 0

if you want to have it add the skin their body on death simple make a custom player_death.sqf

and add this below deathHandled = true;

Spoiler

 

[] spawn {
    private["_skin","_okSkin","_result","_bp","_body"];
    _body = player;
    _skin = (typeOf _body);
    _skin = "Skin_" + _skin;
    _okSkin = isClass (configFile >> "CfgMagazines" >> _skin);

    if(_okSkin) then {
         _result = [player,_skin] call BIS_fnc_invAdd;
        if(!_result) then {
            _bp = unitBackpack player;
            _bp addMagazineCargoGlobal[_skin,1];
        };
    };
};

 

Credits to @f3cuk for this

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...