Remove Clothes from dead bodies!

unkinhead

Member
This would be great if this works!

Sorry i can't validate the code, just wanted to support the thread.

I could test the code on my server.

Im assuming this is what needs to be done:

Edit compiles.sqf in mission to have line:

s_clothes = compile preprocessFileLineNumbers "clothes.sqf";

Place clothes.sqf (first post) in mission file

Edit fn_selfactions, find:
Code:
if (_isMan and !_isAlive and !_isZombie) then {
        if (s_player_studybody < 0) then {
            s_player_studybody = player addAction [localize "str_action_studybody", "study_body.sqf",cursorTarget, 0, false, true, "",""];
        };
    } else {
        player removeAction s_player_studybody;
        s_player_studybody = -1;
    };

Replace it with

Code:
if (_isMan and !_isAlive and !_isZombie) 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, "",""];
};
if (s_clothes < 0) then { _model = typeOf cursorTarget;
if( _model in ["Sniper1_DZ","Camo1_DZ"] ) then { s_clothes = player addAction [("<t color=""#336699"">" + ("Clothes") + "</t>"), "clothes.sqf", cursorTarget, 1, false, true, "",""];
        };
    } else {
        player removeAction s_player_studybody;
        s_player_studybody = -1;
        } else {
            player removeAction s_player_studybody;
            s_player_studybody = -1;
            player removeAction s_clothes;
            s_clothes = -1;
    };

Done?

EDIT: i think i did something with the selfactons.sqf wrong, because it broke study body, and no remove clothes option appeared. So not sure what additions to make to that
 

Manatee Hunter

Valued Member!
I've always wanted to hatchet a man to death and wear his bloodied clothes.

Hope to see this working soon. I believe I've heard of a server that has something like this functional.
 

unkinhead

Member
My code is almost complete. just don't know what is wrong. I've looked at it a billion times, tried it a billion times over. I am at a loss for words. Please someone help me, I've done majority of the work.
Il frequently bump this so someone might see it :)
 

cyrq

Valued Member!
Under the study body action add:

Code:
    //CLOTHES
    if (_isMan and !_isAlive and !_isZombie) then {
    if (s_clothes < 0) then {
            s_clothes = player addAction ["Take Clothes", "clothes\clothes.sqf",cursorTarget, 0, false, true, "",""];
        };
    } else {
        player removeAction s_clothes;
        s_clothes = -1;
    };

Under:

Code:
    player removeAction s_player_studybody;
    s_player_studybody = -1;

Add:

Code:
    player removeAction s_clothes;
    s_clothes = -1;

And its done.
I actually made it possible to take clothes from everyone since the section:
Code:
if( _model in ["Sniper1_DZ","Camo1_DZ"] ) then
somehow didn't work. Dunno why.
If you manage to get it working, i recommend writhing it the other way, like:
If model = Survivor1_DZ etc then don't run it
That way ppl with custom skins wouldn't have to write down every single model to the code.

You also need to comment out your setpos.txt or you'wll be kicked by BE.
The script you wrote works, but when you take the clothes from te body it stands up and falls again.

Hope I've helped :)
 

Manatee Hunter

Valued Member!
for Celle there's so many custom clothes that are lootable as well as unlootable.

Ideally I'd like to be able for players to take clothes off any player or zombie, especially if you kill a clan member and jack his clothes to screw with them... I find that idea rather entertaining

Would it be too much to ask for a guide on how to implement this correctly and how to make changes to add new skin types / what are the limitations
 

Manatee Hunter

Valued Member!
This is what I've done. I'm about to try it out.

I made a clothes.sqf and put it in my scripts folder and I modified my fn_selfActions.sqf (It was previously modified so its in my dayz_code\compile\fn_selfActions.sqf)

Is this what this should look like?

Code:
    /////////////////////////////////////
 
    if (_isMan and !_isAlive and !_isZombie) then {
        if (s_player_studybody < 0) then {
            s_player_studybody = player addAction [localize "str_action_studybody", "study_body.sqf",cursorTarget, 0, false, true, "",""];
        };
    } else {
        player removeAction s_player_studybody;
        s_player_studybody = -1;
    };
    //CLOTHES
    if (_isMan and !_isAlive and !_isZombie) then {
    if (s_clothes < 0) then {
            s_clothes = player addAction ["Take Clothes", "scripts\clothes.sqf",cursorTarget, 0, false, true, "",""];
        };
    } else {
        player removeAction s_clothes;
        s_clothes = -1;
    };

(Using a custom study_body.sqf and its in my main folder)

And further down:

Code:
    player removeAction s_player_studybody;
    s_player_studybody = -1;
    player removeAction s_clothes;
    s_clothes = -1;

Is this the line that I would add all the skins that I want being lootable from others?
if( _model in ["Sniper1_DZ","Camo1_DZ"] ) then { _model = "Skin_" + _model;

A few questions:

1) Will this be abusable and repeatedly looted?

2) Does this attempt to replace your skin immediately then tries to pick up the skin?
- Mostly because some of the skins on celle do not spawn on the map, not exactly sure if they have a package form or if they are simply something I'm able to add through the DB.

3) If it does replace your skin immediately, where does your current one go? - Does it get swapped or enter your bag?
 

Attachments

  • clothes.sqf
    4 KB · Views: 248
  • fn_selfActions.sqf
    24.5 KB · Views: 150

unkinhead

Member
This is what I've done. I'm about to try it out.

I made a clothes.sqf and put it in my scripts folder and I modified my fn_selfActions.sqf (It was previously modified so its in my dayz_code\compile\fn_selfActions.sqf)

Is this what this should look like?

Code:
    /////////////////////////////////////
 
    if (_isMan and !_isAlive and !_isZombie) then {
        if (s_player_studybody < 0) then {
            s_player_studybody = player addAction [localize "str_action_studybody", "study_body.sqf",cursorTarget, 0, false, true, "",""];
        };
    } else {
        player removeAction s_player_studybody;
        s_player_studybody = -1;
    };
    //CLOTHES
    if (_isMan and !_isAlive and !_isZombie) then {
    if (s_clothes < 0) then {
            s_clothes = player addAction ["Take Clothes", "scripts\clothes.sqf",cursorTarget, 0, false, true, "",""];
        };
    } else {
        player removeAction s_clothes;
        s_clothes = -1;
    };

(Using a custom study_body.sqf and its in my main folder)

And further down:

Code:
    player removeAction s_player_studybody;
    s_player_studybody = -1;
    player removeAction s_clothes;
    s_clothes = -1;

Is this the line that I would add all the skins that I want being lootable from others?
if( _model in ["Sniper1_DZ","Camo1_DZ"] ) then { _model = "Skin_" + _model;

A few questions:

1) Will this be abusable and repeatedly looted?

2) Does this attempt to replace your skin immediately then tries to pick up the skin?
- Mostly because some of the skins on celle do not spawn on the map, not exactly sure if they have a package form or if they are simply something I'm able to add through the DB.

3) If it does replace your skin immediately, where does your current one go? - Does it get swapped or enter your bag?


Fairly certain it picks up the skin as an item
 

Manatee Hunter

Valued Member!
Is what I've stated the correct method of implementation?

It worked. Only problem is that me and the other person who did this at some point both of us had game freezes/crash.. Cannot be certain if its because of this or because of the admin hacks (which i've not had problems with earlier when toying with it briefly today)

He shot me. looted the skin off me. I DB ressed myself, we did it agian... He froze for w.e reason, i came back in the game.. and soon after froze as well... Not sure why/what happened.

Basically the only 2 things it can be are this & the admin tool.
 

cyrq

Valued Member!
Uhm.
Why you're trying to add a second studybody funtion???
Just create a separate action/option for the clothes which is not linked to player removeAction s_player_studybody;
 

istealth

Well-Known Member
Under the study body action add:

Code:
    //CLOTHES
    if (_isMan and !_isAlive and !_isZombie) then {
    if (s_clothes < 0) then {
            s_clothes = player addAction ["Take Clothes", "clothes\clothes.sqf",cursorTarget, 0, false, true, "",""];
        };
    } else {
        player removeAction s_clothes;
        s_clothes = -1;
    };

Under:

Code:
    player removeAction s_player_studybody;
    s_player_studybody = -1;

Add:

Code:
    player removeAction s_clothes;
    s_clothes = -1;

And its done.
I actually made it possible to take clothes from everyone since the section:
Code:
if( _model in ["Sniper1_DZ","Camo1_DZ"] ) then
somehow didn't work. Dunno why.
If you manage to get it working, i recommend writhing it the other way, like:
If model = Survivor1_DZ etc then don't run it
That way ppl with custom skins wouldn't have to write down every single model to the code.

You also need to comment out your setpos.txt or you'wll be kicked by BE.
The script you wrote works, but when you take the clothes from te body it stands up and falls again.

Hope I've helped :)
i tried this but i never got an option to take clothes
 

Manatee Hunter

Valued Member!
I hope this helps. I briefly tested the clothing removal on my server... the Fn_Selfactions is heavily modified so don't copy paste it... And the clothes.sqf has Celle clothes not default so don't copy paste that either.
 

Attachments

  • clothes.sqf
    5 KB · Views: 112
  • fn_selfActions.sqf
    24.5 KB · Views: 70

Soul

Valued Member!
the script works fine appart from the strange thing that it despawns the original dead body and spawns a new body standing up that then drops dead...

had to turn of BE because of script restriction #40
if anyone would be able to get that sorted out since i dont find wich line it is :(
 

Attachments

  • scripts.txt
    45.6 KB · Views: 75

lazyink

Valued Member!
Staff member
Just to go thru this, as I seem to have followed the steps, and it still is not functioning.

In my dayz_code\compile\compiles.sqf I have added this line

Code:
    s_clothes =                compile preprocessFileLineNumbers "Scripts\clothes.sqf";


In my dayz_code\compile\fn_selfActions.sqf I have added these lines:

Code:
// START OF CLOTHES
    if (_isMan and !_isAlive and !_isZombie) then {
    if (s_clothes < 0) then {
            s_clothes = player addAction ["Take Clothes", "Scripts\clothes.sqf",cursorTarget, 0, false, true, "",""];
        };
    } else {
        player removeAction s_clothes;
        s_clothes = -1;
    };
    // END OF CLOTHES

&
Code:
// START OF CLOTHES
player removeAction s_clothes;
    s_clothes = -1;
    // END OF CLOTHES

My clothes.sqf is the updated code you provided.




I'm not getting any options in the scroll menu.

Any ideas?
 

unkinhead

Member
Just to go thru this, as I seem to have followed the steps, and it still is not functioning.

In my dayz_code\compile\compiles.sqf I have added this line

Code:
    s_clothes =                compile preprocessFileLineNumbers "Scripts\clothes.sqf";


In my dayz_code\compile\fn_selfActions.sqf I have added these lines:

Code:
// START OF CLOTHES
    if (_isMan and !_isAlive and !_isZombie) then {
    if (s_clothes < 0) then {
            s_clothes = player addAction ["Take Clothes", "Scripts\clothes.sqf",cursorTarget, 0, false, true, "",""];
        };
    } else {
        player removeAction s_clothes;
        s_clothes = -1;
    };
    // END OF CLOTHES

&
Code:
// START OF CLOTHES
player removeAction s_clothes;
    s_clothes = -1;
    // END OF CLOTHES

My clothes.sqf is the updated code you provided.




I'm not getting any options in the scroll menu.

Any ideas?


You need to be editing your mission.pbo not dayzcode.pbo

you need to override self_actions and compiles.sqf to your mission file
 

lazyink

Valued Member!
Staff member
Ah yes, I new there was a simple reason why it wasn't doing anything. Is it ok to put the files into a folder eg. code, rather than at the root of the mission?
 

unkinhead

Member
Yes, most people name the folder your talking about "fixes" which i would suggest, because it will be in a lot of tuts
 
Top