Thank u so much! this work perfectly.
i tryied to use only the eventhandler by recall my previous sqf but didnt work, now i need only to create a single gear sqf for each unit, player. the only problem is the Carrier Lite, i cant remove it.
id = ["rifleman2", this] call compile preprocessFileLineNumbers "gear.sqf"; this addEventHandler ["Respawn","_this execvm 'gear.sqf'"];
gear.sqf
private ["_type", "_unit"];
_type = _this select 0;
_unit = _this select 1;
removeallweapons _unit;
removeAllAssignedItems _unit;
removebackpack _unit;
removeVest _unit;
removeUniform _unit;
removeHeadGear _unit;
_unit addWeapon "ItemMap";
_unit addWeapon "ItemCompass";
_unit addItem "NVGoggles";
switch (_type) do
{
case "rifleman":
{
_unit addUniform "U_C_Commoner1_1";
_unit addHeadgear "H_Cap_red";
};
case "rifleman2":
{
_unit addUniform "U_C_Commoner1_1";
_unit addHeadgear "H_Cap_blu";
};
case "rifleman3":
{
_unit addUniform "U_C_Commoner1_1";
_unit addHeadgear "H_Cap_brn_SERO";
};
case "rifleman4":
{
_unit addUniform "U_C_Commoner1_1";
_unit addHeadgear "H_MilCap_ocamo";
};
case "pellegrino":
{
_unit addUniform "U_C_Poloshirt_tricolour";
_unit addHeadgear "H_Cap_red";
};
case "pellegrino2":
{
_unit addUniform "U_C_Poloshirt_tricolour";
_unit addHeadgear "H_Cap_blu";
};
case "pellegrino3":
{
_unit addUniform "U_C_Poloshirt_tricolour";
_unit addHeadgear "H_Cap_brn_SERO";
};
case "pellegrino4":
{
_unit addUniform "U_C_Poloshirt_tricolour";
_unit addHeadgear "H_MilCap_ocamo";
};
case "pupino":
{
_unit addUniform "U_C_Poloshirt_burgundy";
_unit addHeadgear "H_Cap_red";
};
case "pupino2":
{
_unit addUniform "U_C_Poloshirt_burgundy";
_unit addHeadgear "H_Cap_blu";
};
case "pupino3":
{
_unit addUniform "U_C_Poloshirt_burgundy";
_unit addHeadgear "H_Cap_brn_SERO";
};
case "pupino4":
{
_unit addUniform "U_C_Poloshirt_burgundy";
_unit addHeadgear "H_MilCap_ocamo";
};
};