Custom Skins (Serverside)

To expand on what I did, I did this:

First open your server pbo and in server_playerLogin.sqf you need to comment out 3 lines

Find

Code:
if (!(_model in ["SurvivorW2_DZ","Survivor2_DZ","Survivor3_DZ","Sniper1_DZ","Soldier1_DZ","Camo1_DZ","Bandit1_DZ","Rocket_DZ"])) then {
_model = "Survivor2_DZ";
};

Change it to

Code:
    //if (!(_model in ["SurvivorW2_DZ","Survivor2_DZ","Sniper1_DZ","Soldier1_DZ","Camo1_DZ","BanditW1_DZ","Bandit1_DZ","SurvivorW2_DZ"])) then {
    //    _model = "Survivor2_DZ";
    //};


Next we need to take some code from the client and move it to the mission file for our modification to work. Open up your dayz_code.pbo and find player_wearClothes.sqf copy this file to a "fixes" folder inside your server's mission.pbo


In this file change the case statement for the Soldier clothing (lines 40 -43 for me) to the following


Code:
case "Skin_Soldier1_DZ": {
 
        _model = ["Ins_Soldier_Base","RU_Soldier_Base","GUE_Soldier_Base","CDF_Soldier_Base","Soldier1_DZ","MVD_Soldier_Base","RUS_Soldier_Base"] call BIS_fnc_selectRandom;
    };


You can add or remove models from the random selection here, I used Xyberviri's list to find models which were not banned. Unfortunately I could only find 6 with inventory's of the correct number of slots, but I may have missed some...

In your mission init.sqf add the following under the end of the if ((!isServer) && (player != player)) section


Code:
player_wearClothes = compile preprocessFileLineNumbers "fixes\player_wearClothes.sqf";

This will use our code whenever a client changes skin rather than the original clientside code.
 
I just tried using THIS code in the server_playerLogin.sqf file:


Code:
switch (_playerID) do {
        case "000000000": { _model = "FR_R"; };
        case "000000000": { _model = "GUE_Soldier_2";};
        default {};
};

and I replaced the code with my UID and US_Soldier_EP1 and it works like a charm!

For anyone else that is having problems with custom assigned skins, try this!
 
Back
Top