Français Solved Comment appliquer une couleur à toutes les voitures du serveur en une seule fois ?

  • Auteur de la discussion Auteur de la discussion AdamC
  • Date de début Date de début

AdamC

User
25/4/20
33
4
2
300
Bonjour où je pourrais mettre ceci pour eviter de le mettre à chaque voiture ?
pour le mettre 1 seule fois pour tout les véhicules du serveur.


textures[] = {
{ "Noir", "civ", {
"#(argb,8,8,3)color(0.05,0.05,0.05,1)"
}, "" },
{ "Blanc", "civ", {
"#(argb,8,8,3)color(1,1,1,1)"
}, "" },
{ "Gris", "civ", {
"#(argb,8,8,3)color(0.0925,0.0925,0.0925,1)"
}, "" },
{ "Sable", "civ", {
"#(argb,8,8,3)color(1.5,1.6,0.9,0.2)"
}, "" },
{ "Rouge", "civ", {
"#(argb,8,8,3)color(1,0,0,1)"
}, "" },
{ "Jaune", "civ", {
"#(argb,8,8,3)color(0.643,0.663,0,1)"
}, "" },
{ "Bleu", "civ", {
"#(argb,8,8,3)color(0.01,0.6,1,0.1)"
}, "" },
{ "Bleu Nuit", "civ", {
"#(argb,8,8,3)color(0,0,0.5,0.1)"
}, "" },
{ "Mauve", "civ", {
"#(argb,8,8,3)color(0.6,0,1,0.01)"
}, "" },
{ "Orange", "civ", {
"#(argb,8,8,3)color(1,0.251,0,1)"
}, "" },
{ "Vert", "civ", {
"#(argb,8,8,3)color(0.5,1,0.5,0.05)"
}, "" },
{ "Rose", "civ", {
"#(argb,8,8,3)color(0.878,0.067,0.373,1)"
}, "" },
{ "Violet", "civ", {
"#(argb,8,8,3)color(0.455,0.004,0.875,1)"
}, "" }
};
};
 
Solution
Sinon si tu veux faire en sorte que tes véhicules cotés civils sois de couleur différente sans passer par une config je te mets un code que tu pourras rajouter dans ton fn_colorvehicle.sqf, bien sûr il faudrait supprimer ceci :
Code:
    private _textures = ((M_CONFIG(getArray,"LifeCfgVehicles",_className,"textures") select _index) param [2,[]]);
    if (_textures isEqualTo []) exitWith {};

    _vehicle setVariable ["Life_VEH_color",_index,true];

    {_vehicle setObjectTextureGlobal [_forEachIndex,_x]} forEach _textures;

et rajouter ceci a la même place :
Code:
if (playerSide isEqualto civilian) then {
   _vehicle setVariable ["Life_VEH_color",_index,true];
    private _texture = "#(rgb,8,8,3)color("+ str (random 1) +","+ str (random...
Non tu peux pas tes obliger de mettre ça
[CODE title="C_Offroad_01_F"] textures[] = {
{ "Red", "civ", {
"\A3\soft_F\Offroad_01\Data\offroad_01_ext_co.paa",
"\A3\soft_F\Offroad_01\Data\offroad_01_ext_co.paa"
}, "" },
{ "Yellow", "civ", {
"\A3\soft_F\Offroad_01\Data\offroad_01_ext_BASE01_CO.paa",
"\A3\soft_F\Offroad_01\Data\offroad_01_ext_BASE01_CO.paa"
}, "" },
{ "White", "civ", {
"\A3\soft_F\Offroad_01\Data\offroad_01_ext_BASE02_CO.paa",
"\A3\soft_F\Offroad_01\Data\offroad_01_ext_BASE02_CO.paa"
}, "" },
{ "Blue", "civ", {
"\A3\soft_F\Offroad_01\Data\offroad_01_ext_BASE03_CO.paa",
"\A3\soft_F\Offroad_01\Data\offroad_01_ext_BASE03_CO.paa"
}, "" },
{ "Dark Red", "civ", {
"\A3\soft_F\Offroad_01\Data\offroad_01_ext_BASE04_CO.paa",
"\A3\soft_F\Offroad_01\Data\offroad_01_ext_BASE04_CO.paa"
}, "" },
{ "Blue / White", "civ", {
"\A3\soft_F\Offroad_01\Data\offroad_01_ext_BASE05_CO.paa",
"\A3\soft_F\Offroad_01\Data\offroad_01_ext_BASE05_CO.paa"
}, "" },
};[/CODE]

[CODE title="C_Hatchback_01_sport_F"]textures[] = {
{ "Beige", "civ", {
"\a3\soft_f_gamma\Hatchback_01\data\hatchback_01_ext_base01_co.paa"
}, "" },
{ "Green", "civ", {
"\a3\soft_f_gamma\Hatchback_01\data\hatchback_01_ext_base02_co.paa"
}, "" },
{ "Blue", "civ", {
"\a3\soft_f_gamma\Hatchback_01\data\hatchback_01_ext_base03_co.paa"
}, "" },
{ "Dark Blue", "civ", {
"\a3\soft_f_gamma\Hatchback_01\data\hatchback_01_ext_base04_co.paa"
}, "" },
{ "Yellow", "civ", {
"\a3\soft_f_gamma\Hatchback_01\data\hatchback_01_ext_base06_co.paa"
}, "" },
{ "White", "civ", {
"\a3\soft_f_gamma\Hatchback_01\data\hatchback_01_ext_base07_co.paa"
}, "" },
{ "Grey", "civ", {
"\a3\soft_f_gamma\Hatchback_01\data\hatchback_01_ext_base08_co.paa"
}, "" },
{ "Black", "civ", {
"\a3\soft_f_gamma\Hatchback_01\data\hatchback_01_ext_base09_co.paa"
}, "" },
};[/CODE]
 
Sinon si tu veux faire en sorte que tes véhicules cotés civils sois de couleur différente sans passer par une config je te mets un code que tu pourras rajouter dans ton fn_colorvehicle.sqf, bien sûr il faudrait supprimer ceci :
Code:
    private _textures = ((M_CONFIG(getArray,"LifeCfgVehicles",_className,"textures") select _index) param [2,[]]);
    if (_textures isEqualTo []) exitWith {};

    _vehicle setVariable ["Life_VEH_color",_index,true];

    {_vehicle setObjectTextureGlobal [_forEachIndex,_x]} forEach _textures;

et rajouter ceci a la même place :
Code:
if (playerSide isEqualto civilian) then {
   _vehicle setVariable ["Life_VEH_color",_index,true];
    private _texture = "#(rgb,8,8,3)color("+ str (random 1) +","+ str (random 1) +","+ str (random 1) +",1)";
    _vehicle setObjectTextureGlobal [0,_texture];

} else {
    private _textures = ((M_CONFIG(getArray,"LifeCfgVehicles",_className,"textures") select _index) param [2,[]]);
    if (_textures isEqualTo []) exitWith {};

    _vehicle setVariable ["Life_VEH_color",_index,true];

    {_vehicle setObjectTextureGlobal [_forEachIndex,_x]} forEach _textures;
};
 
Dernière édition par un modérateur:
Solution