Jump to content
  • 0

Random skins at respawn.


Knight

Question

Hello.

 

I've been trying to set up random clothes when a player respawn in the server.

 

I've edited the server_playerLogin.sqf at compiles folder on my server.pbo, but it didn't work, so I made some research and found out something related to the Gender Selection.

 

I found some things at playermonitor related at gender selection, and some functions setting skins, so I changed it there, but I'm still respawning with default skin when clicking at "Male" or "Female".

 

Also I've heard about rscTittles.hpp and I don't know a idea where this file is located...

 

I need to deactivate or disable the gender selection to make it works.

 

Does anyone know how do I do that?

 

Thanks.

 

@EDIT -

 

Nevermind, got it working. I added some conditions at the .sqf file on the server.pbo and it works perfectly.

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Sure, why not? That's why we are here after all. ;)

 

Well, after some time editing a bunch of code related to the respawn it worked. But I don't know if it was necessary to change all the things I have, or just the last change (the one I did and then the system worked).

 

So I checked it again, and I am 99% you won't have to do anything outside the server_playerLogin.sqf.

 

Open that file, that is located at your compiles folder on your dayz_server.pbo and find this:

} else {
    _isInfected = _primary select 3;
    _model = _primary select 4;
    _hiveVer = _primary select 5;
   // add here.....

 

As soon as you find it, you add this right below.

if ((_model == "Survivor2_DZ") or (_model == "Survivor1_DZ")) then {
_model = ["Haris_Press_EP1_DZ", "Pilot_EP1_DZ", "Functionary1_EP1_DZ", "Rocker3_DZ", "Rocker1_DZ", "Rocker2_DZ", "Rocker4_DZ"] call MY_fnc_rollDICE;
};
if (_model == "SurvivorW2_DZ") then {
_model = ["SurvivorW2_DZ", "SurvivorW3_DZ", "SurvivorWcombat_DZ", "SurvivorWdesert_DZ", "SurvivorWurban_DZ", "SurvivorWpink_DZ"] call MY_fnc_rollDICE;
};

The first condition is male and second is female, but for some reason the female is not working (respawn with male skin).That's omething I am trying to figure out. If I find out, I'll post here again.

 

Now, right below this code you just added, you'll see this:

if (isNil "_model") then {
    _model = "Survivor2_DZ";
} else {
if (_model == "") then {
    _model = "Survivor2_DZ";
    };
};

 

Now delete it and replace with this:

if (isNil "_model") then {
    _model = ["Haris_Press_EP1_DZ", "Pilot_EP1_DZ", "Functionary1_EP1_DZ", "Rocker3_DZ", "Rocker1_DZ", "Rocker2_DZ", "Rocker4_DZ"] call MY_fnc_rollDICE;
} else {
if (_model == "") then {
    _model = ["Haris_Press_EP1_DZ", "Pilot_EP1_DZ", "Functionary1_EP1_DZ", "Rocker3_DZ", "Rocker1_DZ", "Rocker2_DZ", "Rocker4_DZ"] call MY_fnc_rollDICE;
    };
};

 

Now to finish, go to the first line of the file (private-line), and right below it add this:

MY_fnc_rollDICE = {
_this select (floor random (count _this)) 
};

 

That's all I guess.

 

I hope it'll help you.

 

See ya.

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...