CustomUniforms

CustomUniforms

« posted: Nov 21, 2021, 11:53 AM »
Hello my friends,
I've been trying for 2 days several combinations to try to work the customuniforms, because I want to put more items in the custom uniform, backpack, headgear and vest. But I really can't understand, my programming level is very low.

At first I'm testing only for _1riUIDs then I'll put it for other clans like 1RI.
Here's the code I modified but it's not working.

Code: [Select]

// @file Version: 1.0
// @file Name: customUniforms.sqf
// @file Author: wiking.at
// Allow custom uniforms for clan's regulary playing on our server

if (isServer) exitWith{};

// Membros 1RI
_1riUIDs =[
// Put player UIDs here
"xxxxxxxxxxxxxxxxx", //Gen.NeO
"xxxxxxxxxxxxxxxxx", //Razec
"xxxxxxxxxxxxxxxxx", //Cleverthon
"xxxxxxxxxxxxxxxxx", //Fabiano
"xxxxxxxxxxxxxxxxx", //Neto
"xxxxxxxxxxxxxxxxx" //Falcao
];

_undeadUIDs =[
// Put player UIDs here
"xxxxxxxxxxxxxxxxx", //Alex
"xxxxxxxxxxxxxxxxx", //Aspira
"xxxxxxxxxxxxxxxxx", //Bigcatra
"xxxxxxxxxxxxxxxxx", //Fanty
"xxxxxxxxxxxxxxxxx", //Giva
"xxxxxxxxxxxxxxxxx", //HAL
"xxxxxxxxxxxxxxxxx", //Itto
"xxxxxxxxxxxxxxxxx", //Mago
"xxxxxxxxxxxxxxxxx", //Pabones
"xxxxxxxxxxxxxxxxx", //Saraiva
"xxxxxxxxxxxxxxxxx" //Ventila
];

_reczUIDs =[
// Put player UIDs here
"xxxxxxxxxxxxxxxx", //Carlos
"xxxxxxxxxxxxxxxx", //Lucas
"xxxxxxxxxxxxxxxx", //José
"xxxxxxxxxxxxxxxx", //cartola vermelha
"xxxxxxxxxxxxxxxx" //mano
];



// Check if Player is in Indi and 1RI
if (playerSide == independent && (getPlayerUID player in _1riUIDs))  then
 {
[] spawn  // Uniform
{
while {true} do
{
waitUntil {uniform player == "U_I_CombatUniform"};
player setObjectTextureGlobal [0,"addons\customuniforms\textures\u_1ri.jpg"];

//If player is wearing Kitbag (MTP)
if ((backpack player) == "B_Kitbag_mcamo") then
{
backpackContainer player setObjectTextureGlobal [0,"addons\customuniforms\textures\b_1ri.jpg"];
};

//If player is wearing Defender Helmet (HEX)
if ((headgear player) == "H_HelmetLeaderO_ocamo") then
{
player setObjectTextureGlobal [0,"addons\customuniforms\textures\h_1ri.jpg"];
};

//If player is wearing GA Carrier GL Rig (Digital)
if ((vest player) == "V_PlateCarrierIAGL_dgtl") then
{
vestContainer player setObjectTextureGlobal [0,"addons\customuniforms\textures\v_1ri.jpg"];
};

//backpackContainer player setObjectTextureGlobal [0,"#(rgb,8,8,3)color(0.16,0.16,0.16,1)"]; //change backpack color to dark black - disabled because there it is really black or nearly white with arma colors
waitUntil {uniform player != "U_I_CombatUniform"};  //If player changes Uniform go to the top of the while loop
};
};
};

if (playerSide == independent && (getPlayerUID player in _undeadUIDs))  then
 {
[] spawn  // Uniform
{
while {true} do
{
waitUntil {uniform player == "U_I_CombatUniform"};
player setObjectTextureGlobal [0,"addons\customuniforms\textures\u_undead.jpg"];
waitUntil {uniform player != "U_I_CombatUniform"};  //If player changes Uniform go to the top of the while loop
};
};
};

if (playerSide == independent && (getPlayerUID player in _reczUIDs))  then
 {
[] spawn  // Uniform
{
while {true} do
{
waitUntil {uniform player == "U_I_CombatUniform"};
player setObjectTextureGlobal [0,"addons\customuniforms\textures\u_recz.jpg"];
waitUntil {uniform player != "U_I_CombatUniform"};  //If player changes Uniform go to the top of the while loop
};
};
};



Re: CustomUniforms

« Reply #1 posted: Nov 28, 2021, 07:21 AM »
Hello my friends, I would like to understand why I can make the customuniforms script apply a texture to a backpack and uniform but I can't apply it to a vest. already changed the programming putting conditionals to avoid that in life, if you change the uniform, don't change what you already have. I find the .paa of the vest right but I can't give a setobjecttextureglobal.



Code: [Select]
// Check if Player is in Indi and 1RI
if (playerSide == independent && (getPlayerUID player in _1riUIDs))  then
 {
[] spawn  // Uniform
{
while {true} do
{
// uniforme
waitUntil {uniform player == "U_I_CombatUniform"};
player setObjectTextureGlobal [0,"addons\customuniforms\textures\u_1ri.jpg"];

// capacete
if ((headgear player) == "H_MilCap_dgtl") then
{
sleep 0.5;
player addHeadgear "H_Watchcap_blk";
};

// mochila
if ((backpack player) == "B_ViperHarness_blk_F") then
{
sleep 0.5;
backpackContainer player setObjectTextureGlobal [0,"addons\customuniforms\textures\b_1ri.jpg"];
}
else
{
sleep 0.5;
player addBackpack "B_ViperHarness_blk_F";
backpackContainer player setObjectTextureGlobal [0,"addons\customuniforms\textures\b_1ri.jpg"];
};

// colete
if ((vest player) == "V_PlateCarrier2_blk") then
{
sleep 0.5;
vestContainer player setObjectTextureGlobal [0,"addons\customuniforms\textures\v_1ri.jpg"];
}
else
{
sleep 0.5;
player addVest "V_PlateCarrier2_blk";
vestContainer player setObjectTextureGlobal [0,"addons\customuniforms\textures\v_1ri.jpg"];
};

//If player changes Uniform go to the top of the while loop
waitUntil {uniform player != "U_I_CombatUniform"}; 
};
};
};