Jump to content
Sign in to follow this  
R4IDER

Gearbox Kit Selection Problem

Recommended Posts

Hi,

I am currently putting together our clans mission template for arma 3. The gear selection is working perfectly however to other players you appear be be running around in your underwear even though if you look down you can see your own uniform. If you reconnect to the server you then see the players uniform its as if the server is out of sync some how anyway, I have created a feedback tracker for this problem because I think that it is an issue with the game rather than my gear selection script but just to rule that out I thought I would post it here for people to run their eyes over to see if there is anything that could be causing this to happen.

When a player spawns into the server I am running this in their initialization.

null = [this] execVM "scripts\remove_gear.sqf"; this addEventHandler ["respawn", {_this exec "scripts\remove_gear.sqf"}];

Here is the code from remove_gear.sqf.

_unit = _this select 0;
sleep 1;
removeallweapons _unit;
removegoggles _unit;
removeheadgear _unit;
removevest _unit;
removeuniform _unit;
removeallassigneditems _unit;
removebackpack _unit;
_unit addweapon "ItemMap";

This is the code I have on my gearbox initialization.

box = [this] execVM "scripts\gearbox.sqf";

Here is the code from gearbox.sqf.

// Start Gear Box
_gearBox = _this select 0;

// Empty Gear Box
ClearWeaponCargo _gearBox;
ClearMagazineCargo _gearBox;

//No Damage
_gearBox allowdamage false;

// Provide Kit Selections
_gearBox addAction [ "Plt > PL","scripts\gear.sqf",("pl")];
_gearBox addAction [ "Forward Air Controller","scripts\gear.sqf",("fc")];
_gearBox addAction [ "Squad > SL/TL","scripts\gear.sqf",("sl")];
_gearBox addAction [ "Squad > Rifleman","scripts\gear.sqf",("r")];
_gearBox addAction [ "Squad > Grenadier","scripts\gear.sqf",("gr")];
_gearBox addAction [ "Squad > Asst. Gunner","scripts\gear.sqf",("ag")];
_gearBox addAction [ "Squad > Automatic Rifleman","scripts\gear.sqf",("ar")];
_gearBox addAction [ "Echo > Pilot","scripts\gear.sqf",("pilot")];

// Add Gear To Box
// Resources [ammo]
_gearBox addMagazineCargo ["200Rnd_65x39_cased_Box_Tracer",250];
_gearBox addMagazineCargo ["30Rnd_65x39_caseless_mag",250];
_gearBox addMagazineCargo ["30Rnd_65x39_caseless_mag_Tracer",250];
_gearBox addMagazineCargo ["RPG32_F",250];
_gearBox addMagazineCargo ["RPG32_HE_F",250];
_gearBox addMagazineCargo ["9Rnd_45ACP_Mag",250];
_gearBox addMagazineCargo ["30Rnd_45ACP_Mag_SMG_01",250];
_gearBox addMagazineCargo ["1Rnd_HE_Grenade_shell",250];
_gearBox addMagazineCargo ["1Rnd_SmokeRed_Grenade_shell",250];
_gearBox addMagazineCargo ["1Rnd_Smoke_Grenade_shell",250];
_gearBox addMagazineCargo ["SmokeShell",250];
_gearBox addMagazineCargo ["SmokeShellRed",250];
_gearBox addMagazineCargo ["SmokeShellGreen",250];
_gearBox addMagazineCargo ["SmokeShellYellow",250];
_gearBox addMagazineCargo ["HandGrenade",250];
_gearBox addMagazineCargo ["DemoCharge_Remote_mag",250];

// Resources [items]
_gearBox additemcargo ["FirstAidKit", 80];
_gearBox additemcargo ["ToolKit", 20];
_gearBox additemcargo ["MineDetector", 10];
_gearBox additemcargo ["acc_flashlight", 19];

// Resources [baackpacks]
// _gearBox addbackpackcargo ["B_Parachute", 100];

Finally here is the code from gear.sqf.

_unitrole = toLower (_this select 3);
_unit = _this select 1;

removeallweapons _unit;
removegoggles _unit;
removeheadgear _unit;
removevest _unit;
removeuniform _unit;
removeallassigneditems _unit;
removebackpack _unit;
_unit addweapon "ItemMap";

// Resources [items]
_nvg = "NVGoggles";
_gps = "ItemGPS";
_bino = "Binocular";
_map = "ItemMap";
_medkit = "Medikit";
_bandage = "FirstAidKit";
_toolkit = "ToolKit";
_compass = "ItemCompass";
_minedectector = "MineDetector";
_laser = "Laserdesignator";
_laserbatteries = "Laserbatteries";
_rangefinder = "Rangefinder";
_uavterminal = "B_UAVTERMINAL";
_democharge = "DemoCharge_Remote_Mag";

// Resources [weapons]
_ar = "LMG_Mk200_F";
_rGL = "arifle_MX_GL_F";
_r = "arifle_MX_F";
_pilot = "SMG_01_F";
_pistol = "hgun_ACPC2_F";
_at = "launch_RPG32_F";

// Resources [ammo]
_armag = "200Rnd_65x39_cased_Box_Tracer";
_rmag = "30Rnd_65x39_caseless_mag";
_rmagtracer = "30Rnd_65x39_caseless_mag_Tracer";
_atmag = "RPG32_F";
_athe = "RPG32_HE_F";
_pistolmag = "9Rnd_45ACP_Mag";
_smgmag = "30Rnd_45ACP_Mag_SMG_01";

// Resources [grenade]
_HEShell = "1Rnd_HE_Grenade_shell";
_smokeshellR = "1Rnd_SmokeRed_Grenade_shell";
_smokeshellW = "1Rnd_Smoke_Grenade_shell";
_hsmokegrenadeW = "SmokeShell";
_hsmokegrenadeR = "SmokeShellRed";
_hsmokegrenadeG = "SmokeShellGreen";
_hsmokegrenadeY = "SmokeShellYellow";
_hgrenade = "HandGrenade";
_minihgrenade = "MiniGrenade";

// Resources [attachments]
_ir = "acc_pointer_IR";
_fl = "acc_flashlight";
_reddot = "optic_Aco";
_greendot = "optic_ACO_grn";
_rco = "optic_Hamr";
_aco = "optic_Arco";
_halo = "optic_Holosight";
_mrco = "optic_MRCO";
_silencer762 = "muzzle_snds_B";
_silencer65 = "muzzle_snds_H";
_silencer56 = "muzzle_snds_M";
_silencerLMG = "muzzle_snds_H_MG";
_silencer9 = "muzzle_snds_L";

// Resources [backpacks]
_uavbackpack = "B_UAV_01_backpack_F";
_squadlbackpack = "B_Kitbag_mcamo";
_riflebackpack = "B_AssaultPack_mcamo";
_grenadierpack = "B_AssaultPack_mcamo";
_assistantbackpack = "B_Kitbag_mcamo";
_pilotbackpack = "B_FieldPack_Base";
_parachute = "B_Parachute";

// Resources [radios]
//_343radio = "ACRE_PRC343";
//_148radio = "ACRE_PRC148";
//_119radio = "ACRE_PRC119";
//_152radio = "ACRE_PRC152";

// Resources [clothing]

//Platoon Leader
_plhelm = "H_HelmetB_paint";
_pluniform = "U_B_CombatUniform_mcam_vest";
_plvest = "V_PlateCarrier1_blk";

//Forward Air Controller
_fchelm = "H_HelmetB_paint";
_fcuniform = "U_B_CombatUniform_mcam_vest";
_fcvest = "V_Chestrig_khk";

//Squad Leader
_slhelm = "H_HelmetB_paint";
_sluniform = "U_B_CombatUniform_mcam_vest";
_slvest = "V_PlateCarrierGL_rgr";

//Rifleman
_rmhelm = "H_HelmetB";
_rmuniform = "U_B_CombatUniform_mcam";
_rmvest = "V_PlateCarrier2_rgr";

//Grenadier
_grhelm = "H_HelmetB_paint";
_gruniform = "U_B_CombatUniform_mcam";
_grvest = "V_PlateCarrierGL_rgr";

//Assistant Gunner
_aghelm = "H_HelmetB_paint";
_aguniform = "U_B_CombatUniform_mcam";
_agvest = "V_PlateCarrier1_rgr";

//Automatic Rifleman
_arhelm = "H_HelmetB";
_aruniform = "U_B_CombatUniform_mcam_tshirt";
_arvest = "V_PlateCarrier2_rgr";

//Pilot
_pilothelm = "H_PilotHelmetHeli_B";
_pilotuniform = "U_B_PilotCoveralls";
_pilotvest = "V_TacVest_oli";

// Other
_blackshades = "G_Shades_Black";

sleep 1;

switch (_unitrole) do{

case "pl": // Platoon Leader
{
_unit adduniform _pluniform;
removeallcontainers _unit;
_unit addheadgear _plhelm;
_unit addbackpack _uavbackpack;

_unit addvest _plvest;
{_unit additem _bandage} foreach [1];
_unit addmagazines [_Rmag ,7];
_unit addmagazines [_pistolmag ,1];
_unit addmagazines [_hgrenade ,2];
_unit additem _uavterminal;
_unit addmagazines [_hsmokegrenadeR ,2];
_unit addmagazines [_hsmokegrenadeG ,2];

_unit addweapon _r;
_unit addprimaryweaponitem _ir;
_unit addprimaryweaponitem _mrco;
_unit addweapon _pistol;

_unit addweapon "ItemCompass";
_unit addweapon "ItemWatch";
//_unit additem _119radio;
//_unit additem _148radio;
_unit additem _nvg;
_unit assignitem _nvg;
_unit additem _gps;
_unit assignitem _gps;
_unit addweapon _rangefinder;
_unit assignitem _rangefinder;

};

case "fc": // Forward Air Controller
{
_unit adduniform _fcuniform;
removeallcontainers _unit;
_unit addheadgear _fchelm;

_unit addvest _fcvest;
_unit addmagazines [_Rmag ,11];
_unit addmagazines [_pistolmag ,1];

_unit addweapon _r;
_unit addprimaryweaponitem _ir;
_unit addprimaryweaponitem _mrco;
_unit addweapon _pistol;

_unit addweapon "ItemCompass";
_unit addweapon "ItemWatch";
//_unit additem _343radio;
//_unit additem _148radio;
_unit additem _nvg;
_unit assignitem _nvg;
_unit additem _gps;
_unit assignitem _gps;
_unit addweapon _rangefinder;
_unit assignitem _rangefinder;

};

case "sl": // Squad Leader
{
_unit adduniform _sluniform;
removeallcontainers _unit;
_unit addheadgear _slhelm;

_unit addbackpack _squadlbackpack;
{_unit additem _bandage} foreach [1];
_unit addmagazines [_smokeshellR ,3];
_unit addmagazines [_smokeshellW ,3];
_unit addmagazines [_hsmokegrenadeR ,2];
_unit addmagazines [_hsmokegrenadeG ,2];
_unit addmagazines [_hsmokegrenadeY ,2];
_unit addmagazines [_Rmag ,3];

_unit addvest _slvest;
_unit addmagazines [_Rmag ,11];
_unit addmagazines [_HEShell ,4];
_unit addmagazines [_hgrenade ,2];
_unit addmagazines [_pistolmag ,1];

_unit addweapon _rgl;
_unit addprimaryweaponitem _ir;
_unit addprimaryweaponitem _mrco;
_unit addweapon _pistol;

_unit addweapon "ItemCompass";
_unit addweapon "ItemWatch";
//_unit additem _343radio;
//_unit additem _148radio;
_unit additem _nvg;
_unit assignitem _nvg;
_unit additem _gps;
_unit assignitem _gps;
_unit addweapon _rangefinder;
_unit assignitem _rangefinder;

};

case "r": // Rifleman
{
_unit adduniform _rmuniform;
removeallcontainers _unit;
_unit addheadgear _rmhelm;

_unit addbackpack _riflebackpack;
{_unit additem _bandage} foreach [1];
_unit addmagazines [_atmag ,1];
_unit addmagazines [_athe ,1];

_unit addvest _rmvest;
_unit addmagazines [_Rmag ,11];
_unit addmagazines [_hgrenade ,2];
_unit addmagazines [_pistolmag ,1];

_unit addweapon _r;
_unit addprimaryweaponitem _ir;
_unit addprimaryweaponitem _mrco;
_unit addweapon _pistol;
_unit addweapon _at;

_unit addweapon "ItemCompass";
_unit addweapon "ItemWatch";
//_unit additem _343radio;
_unit additem _nvg;
_unit assignitem _nvg;
_unit removeitem _gps;

};

case "gr": // Grenadier
{
_unit adduniform _gruniform;
removeallcontainers _unit;
_unit addheadgear _grhelm;

_unit addbackpack _grenadierpack;
{_unit additem _bandage} foreach [1];
_unit addmagazines [_atmag ,1];
_unit addmagazines [_athe ,1];

_unit addvest _grvest;
_unit addmagazines [_Rmag ,10];
_unit addmagazines [_HEShell ,5];
_unit addmagazines [_hgrenade ,3];
_unit addmagazines [_pistolmag ,1];

_unit addweapon _rgl;
_unit addprimaryweaponitem _ir;
_unit addprimaryweaponitem _mrco;
_unit addweapon _pistol;

_unit addweapon "ItemCompass";
_unit addweapon "ItemWatch";
//_unit additem _343radio;
_unit additem _nvg;
_unit assignitem _nvg;
_unit removeitem _gps;

};

case "ag": // Assistant Gunner
{
_unit adduniform _aguniform;
removeallcontainers _unit;
_unit addheadgear _aghelm;

_unit addbackpack _assistantbackpack;
_unit additem _medkit;
{_unit additem _bandage} foreach [1,2,3,4,5];
_unit addmagazines [_Rmag ,3];
_unit addmagazines [_armag ,1];

_unit addvest _agvest;
_unit addmagazines [_Rmag ,11];

_unit addweapon _r;
_unit addprimaryweaponitem _ir;
_unit addprimaryweaponitem _mrco;

_unit addweapon "ItemCompass";
_unit addweapon "ItemWatch";
//_unit additem _343radio;
_unit additem _nvg;
_unit assignitem _nvg;
_unit removeitem _gps;

};

case "ar": // Automatic Rifleman
{
_unit adduniform _aruniform;
removeallcontainers _unit;

_unit addvest _arvest;
_unit addmagazines [_armag ,2];

_unit addweapon _ar;
_unit addprimaryweaponitem _ir;
_unit addprimaryweaponitem _halo;

_unit addweapon "ItemCompass";
_unit addweapon "ItemWatch";
//_unit additem _343radio;
_unit addheadgear _arhelm;
_unit addgoggles _blackshades;
_unit additem _nvg;
_unit assignitem _nvg;
_unit removeitem _gps;

_unit addmagazines [_armag ,1];
{_unit additem _bandage} foreach [1];

};

case "pilot": // Pilot
{
_unit adduniform _pilotuniform;
_unit addheadgear _pilothelm;

_unit addmagazines [_smgmag ,2];
_unit addmagazines [_pistolmag ,1];

_unit addweapon _pilot;
_unit addprimaryweaponitem _ir;
_unit addweapon _pistol;

_unit addbackpack _parachute;

_unit addweapon "ItemCompass";
_unit addweapon "ItemWatch";
//_unit additem _152radio;
_unit additem _nvg;
_unit assignitem _nvg;
_unit additem _gps;
_unit assignitem _gps;

};

};

A link to the entire template can be found here www.relaxedwebdesign.co.uk/GOL@37_Template.Altis.zip

If I can't work out how to fix this issue then I am going to have to revert to just using the uniform that you spawn in with but I have changed some of the uniforms around a little so I would like to get the above working so if you can see any errors please let me know.

---------- Post added at 17:37 ---------- Previous post was at 17:01 ----------

After some research it appears this error is caused by using removeallcontainers on a clothing item. From the wiki page removeallcontainers should just prevent players from using clothing to store ammo.

http://feedback.arma3.com/view.php?id=14389

Edited by R4IDER

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×