Nutzgo 15 Posted October 13, 2019 Hi, So I'm making a setup for a MP campaign. I have an idea that the players could select their loadout when they respawn. I'm using ACE, so I want my classes to have the ACE trait for their class. E.g. the Engineer gets ACE Engineer, the medic gets ACE Medic, and the AT, rifleman and so on doesn't get these traits. I've made this LoadoutClasses.hpp: Spoiler class CfgRoles { class Assault { displayName = $STR_A3_Role_Assault; icon = "a3\Ui_f\data\GUI\Cfg\RespawnRoles\assault_ca.paa"; }; class Support { displayName = $STR_A3_Role_Support; icon = "a3\Ui_f\data\GUI\Cfg\RespawnRoles\support_ca.paa"; }; class Recon { displayName = $STR_A3_Role_Recon; icon = "a3\Ui_f\data\GUI\Cfg\RespawnRoles\recon_ca.paa"; }; }; class CfgRespawnInventory { class Rifleman { displayName = $STR_A3_ApexProtocol_class_Rifleman; icon = "\A3\ui_f\data\map\VehicleIcons\iconMan_ca.paa"; show = "side group _this == west"; role = "Assault"; weapons[] = { "arifle_SPAR_01_khk_F", "hgun_P07_khk_F", "Rangefinder" }; magazines[] = { "30Rnd_556x45_Stanag_red", "30Rnd_556x45_Stanag_red", "30Rnd_556x45_Stanag_red", "30Rnd_556x45_Stanag_red", "30Rnd_556x45_Stanag_red", "30Rnd_556x45_Stanag_red", "30Rnd_556x45_Stanag_red", "30Rnd_556x45_Stanag_red", "30Rnd_556x45_Stanag_Tracer_Red", "30Rnd_556x45_Stanag_Tracer_Red", "16Rnd_9x21_Mag", "16Rnd_9x21_Mag", "16Rnd_9x21_Mag", "HandGrenade", "HandGrenade", "SmokeShell", "SmokeShell" }; items[] = { "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_morphine", "ACE_morphine", "ACE_morphine", "muzzle_snds_M" }; linkedItems[] = { "V_PlateCarrier2_rgr_noflag_F", "H_HelmetB_TI_tna_F", "optic_ERCO_khk_F", "bipod_01_F_blk", "acc_pointer_IR", "ItemMap", "ItemCompass", "ItemGPS", "tf_anprc152", "ItemWatch" }; uniformClass = "U_B_CTRG_Soldier_F"; }; class Grenadier { displayName = $STR_A3_ApexProtocol_class_Grenadier; icon = "\A3\ui_f\data\map\VehicleIcons\iconMan_ca.paa"; show = "side group _this == west"; role = "Assault"; weapons[] = { "arifle_SPAR_01_GL_khk_F", "hgun_P07_khk_F", "Rangefinder" }; magazines[] = { "30Rnd_556x45_Stanag_red", "30Rnd_556x45_Stanag_red", "30Rnd_556x45_Stanag_red", "30Rnd_556x45_Stanag_red", "30Rnd_556x45_Stanag_red", "30Rnd_556x45_Stanag_red", "30Rnd_556x45_Stanag_red", "30Rnd_556x45_Stanag_red", "30Rnd_556x45_Stanag_Tracer_Red", "30Rnd_556x45_Stanag_Tracer_Red", "1Rnd_HE_Grenade_shell", "1Rnd_HE_Grenade_shell", "1Rnd_HE_Grenade_shell", "1Rnd_HE_Grenade_shell", "1Rnd_HE_Grenade_shell", "1Rnd_HE_Grenade_shell", "16Rnd_9x21_Mag", "16Rnd_9x21_Mag", "16Rnd_9x21_Mag", "HandGrenade", "HandGrenade", "SmokeShell", "SmokeShell" }; items[] = { "muzzle_snds_M", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_morphine", "ACE_morphine", "ACE_morphine", }; linkedItems[] = { "V_PlateCarrier2_rgr_noflag_F", "H_HelmetB_TI_tna_F", "optic_ERCO_khk_F", "acc_pointer_IR",, "ItemMap", "ItemCompass", "ItemGPS", "tf_anprc152", "ItemWatch" }; uniformClass = "U_B_CTRG_Soldier_3_F"; backpack = "B_AssaultPack_rgr"; }; class MachineGunner { displayName = $STR_A3_ApexProtocol_class_Autorifleman; icon = "\A3\ui_f\data\map\VehicleIcons\iconManMG_ca.paa"; show = "side group _this == west"; role = "Assault"; weapons[] = { "arifle_SPAR_02_khk_F", "hgun_P07_khk_F", "Rangefinder" }; magazines[] = { "150Rnd_556x45_Drum_Mag_F", "150Rnd_556x45_Drum_Mag_F", "150Rnd_556x45_Drum_Mag_F", "150Rnd_556x45_Drum_Mag_F", "16Rnd_9x21_Mag", "16Rnd_9x21_Mag", "16Rnd_9x21_Mag", "HandGrenade", "HandGrenade", "SmokeShell", "SmokeShell" }; items[] = { "ACE_epinephrine", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_morphine", "ACE_morphine", "ACE_morphine", "muzzle_snds_M" }; linkedItems[] = { "V_PlateCarrier2_rgr_noflag_F", "H_HelmetB_TI_tna_F", "optic_ERCO_khk_F", "acc_pointer_IR", "bipod_01_F_blk", "ItemMap", "ItemCompass", "ItemGPS", "tf_anprc152", "ItemWatch" }; uniformClass = "U_B_CTRG_Soldier_F"; backpack = "B_AssaultPack_rgr"; }; class Medic { displayName = $STR_A3_ApexProtocol_class_Paramedic; icon = "\A3\ui_f\data\map\VehicleIcons\iconManMedic_ca.paa"; show = "side group _this == west"; role = "Support"; weapons[] = { "arifle_SPAR_01_khk_F", "hgun_P07_khk_F", "Rangefinder" }; magazines[] = { "30Rnd_556x45_Stanag_red", "30Rnd_556x45_Stanag_red", "30Rnd_556x45_Stanag_red", "30Rnd_556x45_Stanag_red", "30Rnd_556x45_Stanag_red", "30Rnd_556x45_Stanag_red", "30Rnd_556x45_Stanag_Tracer_Red", "30Rnd_556x45_Stanag_Tracer_Red", "16Rnd_9x21_Mag", "16Rnd_9x21_Mag", "16Rnd_9x21_Mag", "SmokeShell", "SmokeShell", "SmokeShell", "SmokeShell" }; items[] = { "ACE_morphine", "ACE_morphine", "ACE_morphine", "ACE_morphine", "ACE_morphine", "ACE_morphine", "ACE_morphine", "ACE_morphine", "ACE_morphine", "ACE_morphine", "ACE_morphine", "ACE_morphine", "ACE_morphine", "ACE_morphine", "ACE_morphine", "ACE_morphine", "ACE_epinephrine", "ACE_epinephrine", "ACE_epinephrine", "ACE_epinephrine", "ACE_epinephrine", "ACE_epinephrine", "ACE_epinephrine", "ACE_epinephrine", "ACE_epinephrine", "ACE_epinephrine", "ACE_epinephrine", "ACE_bloodIV_500", "ACE_bloodIV_500", "ACE_bloodIV_500", "ACE_bloodIV_500", "ACE_bloodIV_500", "ACE_bloodIV_500", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "muzzle_snds_M" }; linkedItems[] = { "V_PlateCarrier1_rgr_noflag_F", "H_HelmetB_TI_tna_F", "optic_Holosight_khk_F", "acc_pointer_IR", "ItemMap", "ItemCompass", "ItemGPS", "tf_anprc152", "ItemWatch" }; uniformClass = "U_B_CTRG_Soldier_2_F"; backpack = "B_AssaultPack_rgr"; }; class Engineer { displayName = $STR_A3_ApexProtocol_class_Engineer; icon = "\A3\ui_f\data\map\VehicleIcons\iconManEngineer_ca.paa"; show = "side group _this == west"; role = "Support"; weapons[] = { "arifle_SPAR_01_khk_F", "hgun_P07_khk_F", "Rangefinder" }; magazines[] = { "30Rnd_556x45_Stanag_red", "30Rnd_556x45_Stanag_red", "30Rnd_556x45_Stanag_red", "30Rnd_556x45_Stanag_red", "30Rnd_556x45_Stanag_red", "30Rnd_556x45_Stanag_red", "30Rnd_556x45_Stanag_Tracer_Red", "30Rnd_556x45_Stanag_Tracer_Red", "16Rnd_9x21_Mag", "16Rnd_9x21_Mag", "16Rnd_9x21_Mag", "SmokeShell", "SmokeShell", "DemoCharge_Remote_Mag", "DemoCharge_Remote_Mag", "DemoCharge_Remote_Mag", "DemoCharge_Remote_Mag" }; items[] = { "ACE_epinephrine", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_morphine", "ACE_morphine", "ACE_morphine", "MineDetector", "ToolKit", "ACE_DefusalKit", "ACE_M26_Clacker", "ACE_wirecutter", "muzzle_snds_M", }; linkedItems[] = { "V_PlateCarrier1_rgr_noflag_F", "H_Booniehat_oli", "optic_Holosight_khk_F", "acc_pointer_IR", "ItemMap", "ItemCompass", "ItemGPS", "tf_anprc152", "ItemWatch" }; uniformClass = "U_B_CTRG_Soldier_3_F"; backpack = "B_Kitbag_rgr"; }; class RiflemanAT { displayName = $STR_A3_ApexProtocol_class_ATRifleman; role = "Support"; weapons[] = { "arifle_SPAR_01_khk_F", "hgun_P07_khk_F", "launch_NLAW_F", "Rangefinder" }; magazines[] = { "30Rnd_556x45_Stanag_red", "30Rnd_556x45_Stanag_red", "30Rnd_556x45_Stanag_red", "30Rnd_556x45_Stanag_red", "30Rnd_556x45_Stanag_red", "30Rnd_556x45_Stanag_red", "30Rnd_556x45_Stanag_Tracer_Red", "30Rnd_556x45_Stanag_Tracer_Red", "16Rnd_9x21_Mag", "16Rnd_9x21_Mag", "16Rnd_9x21_Mag", "SmokeShell", "SmokeShell", "NLAW_F", "NLAW_F" }; items[] = { "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_morphine", "ACE_morphine", "ACE_morphine", "muzzle_snds_M", }; linkedItems[] = { "V_PlateCarrier1_rgr_noflag_F", "H_HelmetB_TI_tna_F", "optic_Holosight_khk_F", "acc_pointer_IR", "ItemMap", "ItemCompass", "ItemWatch", "tf_anprc152", "ItemGPS" }; uniformClass = "U_B_CTRG_Soldier_F"; backpack = "B_AssaultPack_rgr"; }; class Scout { displayName = $STR_A3_ApexProtocol_class_Scout; icon = "\A3\ui_f\data\map\VehicleIcons\iconManRecon_ca.paa"; show = "side group _this == west"; role = "Recon"; weapons[] = { "arifle_SPAR_01_GL_khk_F", "hgun_P07_khk_F", "Rangefinder" }; magazines[] = { "30Rnd_556x45_Stanag_red", "30Rnd_556x45_Stanag_red", "30Rnd_556x45_Stanag_red", "30Rnd_556x45_Stanag_red", "30Rnd_556x45_Stanag_red", "30Rnd_556x45_Stanag_red", "30Rnd_556x45_Stanag_Tracer_Red", "30Rnd_556x45_Stanag_Tracer_Red", "1Rnd_HE_Grenade_shell", "1Rnd_HE_Grenade_shell", "1Rnd_HE_Grenade_shell", "1Rnd_HE_Grenade_shell", "16Rnd_9x21_Mag", "16Rnd_9x21_Mag", "16Rnd_9x21_Mag", "MiniGrenade", "MiniGrenade", "SmokeShell", "SmokeShell" }; items[] = { "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_morphine", "ACE_morphine", "ACE_morphine", }; linkedItems[] = { "V_TacVest_oli", "H_Cap_blk", "optic_ERCO_khk_F", "acc_pointer_IR", "muzzle_snds_M", "muzzle_snds_L", "bipod_01_F_blk", "tf_anprc152", "ItemMap", "ItemCompass", "ItemGPS", "ItemWatch" }; uniformClass = "U_B_CTRG_Soldier_2_F"; backpack = "B_AssaultPack_rgr" }; class Sharpshooter { displayName = $STR_A3_ApexProtocol_class_Sharpshooter; role = "Recon"; weapons[] = { "arifle_SPAR_03_khk_F", "hgun_P07_khk_F", "Rangefinder" }; magazines[] = { "20Rnd_762x51_Mag", "20Rnd_762x51_Mag", "20Rnd_762x51_Mag", "20Rnd_762x51_Mag", "20Rnd_762x51_Mag", "20Rnd_762x51_Mag", "16Rnd_9x21_Mag", "16Rnd_9x21_Mag", "16Rnd_9x21_Mag", "MiniGrenade", "MiniGrenade", "SmokeShell", "SmokeShell" }; items[] = { "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_morphine", "ACE_morphine", "ACE_morphine" "optic_LRPS" }; linkedItems[] = { "V_TacVest_oli", "H_Booniehat_oli", "optic_ERCO_khk_F", "acc_pointer_IR", "bipod_01_F_blk", "muzzle_snds_B", "muzzle_snds_L", "tf_anprc152", "ItemMap", "ItemCompass", "ItemGPS", "ItemWatch" }; uniformClass = "U_B_CTRG_Soldier_3_F"; }; class Saboteur { displayName = $STR_A3_ApexProtocol_class_Saboteur; icon = "\A3\ui_f\data\map\VehicleIcons\iconManEngineer_ca.paa"; show = "side group _this == west"; role = "Recon"; weapons[] = { "arifle_SPAR_01_khk_F", "hgun_P07_khk_F", "Rangefinder" }; magazines[] = { "30Rnd_556x45_Stanag_red", "30Rnd_556x45_Stanag_red", "30Rnd_556x45_Stanag_red", "30Rnd_556x45_Stanag_red", "30Rnd_556x45_Stanag_red", "30Rnd_556x45_Stanag_red", "30Rnd_556x45_Stanag_Tracer_Red", "30Rnd_556x45_Stanag_Tracer_Red", "16Rnd_9x21_Mag", "16Rnd_9x21_Mag", "16Rnd_9x21_Mag", "MiniGrenade", "MiniGrenade", "SmokeShell", "SmokeShell", "SLAMDirectionalMine_Wire_Mag", "SLAMDirectionalMine_Wire_Mag", "DemoCharge_Remote_Mag", "DemoCharge_Remote_Mag" }; items[] = { "ACE_epinephrine", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_fieldDressing", "ACE_morphine", "ACE_morphine", "ACE_morphine", "MineDetector", "ToolKit", "ACE_DefusalKit", "ACE_M26_Clacker", "ACE_wirecutter" }; linkedItems[] = { "V_TacVest_oli", "H_Bandanna_khk_hs", "optic_ERCO_khk_F", "muzzle_snds_M", "muzzle_snds_L", "acc_pointer_IR", "tf_anprc152", "ItemMap", "ItemCompass", "ItemGPS", "ItemWatch" }; uniformClass = "U_B_CTRG_Soldier_2_F"; backpack = "B_Kitbag_rgr"; }; }; Now, how can I make the onPlayerRespawn.sqf? I though of something like this: Spoiler if (typeof player == "Engineer") then {player setVariable ["ACE_IsEngineer",1,true]; }; if (typeof player == "Medic") then {player setVariable ["ace_medical_medicclass", 1, true]; }; if (typeof player == "B_Soldier") then {player setVariable ["ace_medical_medicclass", 0, true]; }; But I'm not sure it would work, I'm not sure the code is correct. Could you guys help a poor fellow out? :) Share this post Link to post Share on other sites
Larrow 2820 Posted October 13, 2019 You can get the role selected using THIS. In a respawn EH check what role they chose and apply the correct ACE trait. 2 Share this post Link to post Share on other sites
Nutzgo 15 Posted October 23, 2019 Tried another method! Stuck on another issue now. 1 Share this post Link to post Share on other sites