Here's my method for having random clothing parcels spawn in on your server without the need for client downloads.
The clothing parcel I use is the soldier clothing parcel that is already in the game code, we just change the available models to a choice of 7 different soldier skins picked at random when you put the skin on.
First open your server pbo and in server_playerLogin.sqf you need to comment out 3 lines
Find
Change it to
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
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
This will use our code whenever a client changes skin rather than the original clientside code.
Grafzahl solved the problem of the skins coming with additional items here - Random Clothing Parcels
Follow these steps on your dayz_code.pbo to make sure your skins don't give players additional items. You will need to include these in the fixes directory and add them to your init.sqf in the same way as player_wearClothes.sqf was added.
This is all you need to make the soldier parcels functional. If you want these items to spawn in game I suggest you take a look at this thread and follow the steps there http://www.tunngle.net/community/to...tion-or-suppression-in-mpmission/page__st__20
I used the same random function on my loot substitutions so I didn't need to replace one item with the soldier skin.
I haven't noticed any problems running this mod on my server the last few days but I imagine there could be on higher pop servers. There are already issues with the anti teleport script and skin changes and not sure if running the code in the mission file will help that. Can't say I've had any problems so far although I'm still testing the effectiveness of the loot substitutions....
Thanks to everyone more knowledgeable than me who has shared information to show me how make mods like these. I shared my work because without other members of the community doing the same, I would not have learned enough to make my own. Please give credit for other peoples code and do not steal it to pass off as your own. If you make improvements or find bugs please share them.
Xyberviri created the thread listing unbanned classes and did all the hard work to make this possible- http://opendayz.net/index.php?threa...y-arma2_oa_build_102678-ie-without-rmod.8277/
The clothing parcel I use is the soldier clothing parcel that is already in the game code, we just change the available models to a choice of 7 different soldier skins picked at random when you put the skin on.
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.
Grafzahl solved the problem of the skins coming with additional items here - Random Clothing Parcels
Follow these steps on your dayz_code.pbo to make sure your skins don't give players additional items. You will need to include these in the fixes directory and add them to your init.sqf in the same way as player_wearClothes.sqf was added.
This is all you need to make the soldier parcels functional. If you want these items to spawn in game I suggest you take a look at this thread and follow the steps there http://www.tunngle.net/community/to...tion-or-suppression-in-mpmission/page__st__20
I used the same random function on my loot substitutions so I didn't need to replace one item with the soldier skin.
Code:
case "Skin_Sniper1_DZ": { _holderItem = ["Skin_Soldier1_DZ","Skin_Sniper1_DZ","Skin_Sniper1_DZ","Skin_Sniper1_DZ","Skin_Sniper1_DZ"] call BIS_fnc_selectRandom };
I haven't noticed any problems running this mod on my server the last few days but I imagine there could be on higher pop servers. There are already issues with the anti teleport script and skin changes and not sure if running the code in the mission file will help that. Can't say I've had any problems so far although I'm still testing the effectiveness of the loot substitutions....
Thanks to everyone more knowledgeable than me who has shared information to show me how make mods like these. I shared my work because without other members of the community doing the same, I would not have learned enough to make my own. Please give credit for other peoples code and do not steal it to pass off as your own. If you make improvements or find bugs please share them.
Xyberviri created the thread listing unbanned classes and did all the hard work to make this possible- http://opendayz.net/index.php?threa...y-arma2_oa_build_102678-ie-without-rmod.8277/