A3-Conquest.Altis / onPlayerRespawn.sqf
onPlayerRespawn.sqf
Raw
// Pull Loadout from on Death for respawn
// player setUnitLoadout (player getVariable ["Saved_Loadout",[]]);

// Respawn Loadout Traits
_loadoutCombo = uiNamespace getVariable (["BIS_RscRespawnControlsMap_ctrlComboLoadout", "BIS_RscRespawnControlsSpectate_ctrlComboLoadout"] select (uiNamespace getVariable ["BIS_RscRespawnControlsSpectate_shown", false]));
_loadoutDisplayName = _loadoutCombo lbText (lbCurSel _loadoutCombo);

if (_loadoutDisplayName != "") then {hint format ["%1 : LOADOUT", _loadoutDisplayName]};
if (_loadoutDisplayName == "Repair Specialist") then {player setUnitTrait ["engineer",true];};
if (_loadoutDisplayName == "Combat Life Saver") then {player setUnitTrait ["medic",true];};
if (_loadoutDisplayName == "UAV Operator") then {player setUnitTrait ["UAVHacker",true];};
if (_loadoutDisplayName == "Explosive Specialist") then {player setUnitTrait ["explosiveSpecialist",true];};

// Guide how to define channels https://community.bistudio.com/wiki/radioChannelCreate
// Guide how to add channels pre-created to players on respawn https://steamcommunity.com/app/107410/discussions/17/1291816569115441819/
_aegisChannel = missionnamespace getvariable "AEGIS High-Command Channel";
_aegisChannel radioChannelAdd [player];

// Copy Loadout Information
// [] execVM "scripts\exportLoadout.sqf";

// Spectator Settings
if ((paramsArray select 22) == 1) then {
	["Terminate"] call BIS_fnc_EGSpectator;
};

// Arsenal on Respawn
sleep 1;
if ((paramsArray select 20) == 1) then {
	["Open",true] call BIS_fnc_arsenal;
};