if (not (local player)) exitwith {};

//enable later
if (Spymade == 1) exitwith {};

_player = player;

EGG_spyactive = 0;

//if (Player distance fahne > 10) then {exitwith "Your spy uniform is at the main ammo crate"};

EGG_EVO_pallammo = ["16Rnd_9x21_Mag","16Rnd_9x21_Mag","16Rnd_9x21_Mag","16Rnd_9x21_Mag","16Rnd_9x21_Mag","APERSMine_Range_Mag","ClaymoreDirectionalMine_Remote_Mag","SLAMDirectionalMine_Wire_Mag","APERSTripMine_Wire_Mag","APERSTripMine_Wire_Mag","SmokeShellOrange","SmokeShellOrange","Chemlight_red","Chemlight_red","Chemlight_red","Chemlight_red","Chemlight_red","Chemlight_red"];// The players default load out
EGG_EVO_pweapons = ["hgun_P07_snds_F","Binocular"]; // The players default load out
EGG_EVO_pitems = ["FirstAidKit","FirstAidKit"];
EGG_EVO_paitems = ["ItemWatch","ItemCompass","ItemMap"];

removeAllWeapons _player;
removebackpack player;
removeheadgear player;
removeallassigneditems player;
removevest player;
sleep 2;
player addvest "V_TacVest_oli";
{_player addmagazine _x} forEach EGG_EVO_pallammo;
sleep 1;
{_player addweapon _x} forEach EGG_EVO_pweapons;
{_player additem _x} forEach EGG_EVO_pitems;
{_player additem _x; _player assignitem _x} forEach EGG_EVO_paitems;

//if (gitsnades == 1) then {_player addmagazine "EB_knife";_player addmagazine "EB_knife";_player addmagazine "EB_knife";_player addmagazine "EB_knife"};

if (count weapons _player > 5) then
{
  private['_type', '_muzzles'];

  _type = ((weapons _player) select 5);
  // check for multiple muzzles (eg: GL)
  _muzzles = getArray(configFile >> "cfgWeapons" >> _type >> "muzzles");

  if (count _muzzles > 1) then
  {
    _player selectWeapon (_muzzles select 0);
  }
  else
  {
    _player selectWeapon _type;
  };
};

//_player selectweapon (handgun _player);

sleep 3;
_loadout=[player] execVM "actions\fnc_save_loadout.sqf";

EGG_spyactive = 1;
Spymade = 1;
_monitor = [] execVM "actions\spy\hidden.sqf"; 
