Jump to content

[Release] Restrict certain skins from being worn


Recommended Posts

I run PvE servers. As such, I've given the AI bandit skins that cover their face. The players on my servers aren't permitted to wear those skins. I asked on the forum if there was a way to prevent users from putting certain skins on and of course the community came out and created a way!

 

I give all credit to f3cuk and Zupa, as they actually came up with the code. I'm just presenting it here in an easier to follow format, and because this is where mods go! :)

 

1. Pull your player_wearClothes.sqf from your client side dayz_code and put it in your custom folder. If by some chance, this is the first custom content you've added to your server, in the folder where the init.sqf and description.ext, create a folder called custom\clothes.

 

2. Open your player_wearClothes.sqf and find this line:

_item = _this;

Immediately below that, add this:

if(_item in ["Skin_Bandit1_DZ","Skin_Bandit2_DZ","Skin_BanditW1_DZ","Skin_BanditW2_DZ","Skin_GUE_Soldier_MG_DZ","Skin_GUE_Soldier_Crew_DZ","Skin_GUE_Soldier_CO_DZ","Skin_GUE_Soldier_2_DZ","Skin_Ins_Soldier_GL_DZ"]) exitWith { DZE_ActionInProgress = false; cutText["You are not allowed to wear that skin.","PLAIN DOWN"]; };

Replace the Skin_Bandit1_DZ, etc with the list of the skins you don't want players to be able to put on. Don't forget to put Skin_ at the beginning of the skin name. Save the file.

 

3. Open your custom compiles.sqf () and insert this line at the end:

player_wearClothes = compile preprocessFileLineNumbers "custom\clothes\player_wearClothes.sqf";
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...