Results 1 to 2 of 2

Thread: Script Breaking on Mission Restart

  1. #1

    Script Breaking on Mission Restart

    Hey everyone,

    I wrote a quick little script for my squad so we could do some custom load outs so we didn't have to go to the boxes at the start of every mission. It works great except for the fact that if we die and restart it won't load the loadouts anymore. To get it to work we have to restart the entire server for it to finally work again.

    Is there something I need to add in order for it to wait? I'm not really sure what's going on with it, but below is the script. Any help would be greatly appreciated.

    The load out is done through the init line of the player.

    Code:
    //Defining variables DO NOT TOUCH
    //
    _unit = _this select 0;
    _loadout = _this select 1;
    
    //Remove weapons and items for every unit
    //
    removeAllWeapons _unit; //no need to put into the case, removes weapons and items automatically
    removeAllitems _unit;
    removebackpack _unit;
    ace_sys_wounds_no_medical_gear = true;
    
    //Place loadouts inbetween {} for each unit
    //
    switch (_loadout) do
    {
    case "s2":
    	{
    //Gear
    	_unit addmagazine "IR_Strobe_Target";
    	_unit addmagazine "ACE_Knicklicht_IR";
    	_unit addweapon "NVGoggles";
    	_unit addweapon "ACE_MAP";
    	_unit addweapon "ACE_DAGR";
    	_unit addweapon "acre_prc148";
    	_unit addweapon "ItemCompass";
    	_unit addweapon "Binocular";
    	_unit addweapon "ACE_Earplugs";
    //Ruck
    	_unit addweapon "ACE_Rucksack_MOLLE_Green_Medic";
    	[_unit, "ACE_30Rnd_556x45_S_Stanag", 6] call ACE_fnc_PackMagazine;
    	[_unit, "ACE_WireCutter", 1] call ACE_fnc_PackWeapon;
    	[_unit, "ACE_KeyCuffs", 1] call ACE_fnc_PackWeapon;	
    	[_unit, "ACE_Medkit", 12] call ACE_fnc_PackMagazine;
    	[_unit, "ACE_Bandage", 12] call ACE_fnc_PackMagazine;
    	[_unit, "ACE_Epinephrine", 15] call ACE_fnc_PackMagazine;
    	[_unit, "ACE_Morphine", 15] call ACE_fnc_PackMagazine;
    	[_unit, "ACE_LargeBandage", 12] call ACE_fnc_PackMagazine;
    	[_unit, "SmokeShellYellow", 1] call ACE_fnc_PackMagazine;
    //WEAPONS
    	_unit addWeapon "ACE_SOC_M4A1_GL_EOTECH";
    	_unit setVariable ["ACE_weapononback", "ACE_M4SPR_SD"];
    	{_unit addMagazine "ACE_1Rnd_HE_M203"} forEach [1,2,3,4,5,6];
    	{_unit addMagazine "ACE_30Rnd_556x45_S_Stanag"} forEach [1,2,3,4,5,6,7,8,9,10,11];
    	};
    	
    case "s1":
    	{
    //Gear
    	_unit addmagazine "IR_Strobe_Target";
    	_unit addmagazine "ACE_Knicklicht_IR";
    	_unit addweapon "NVGoggles";
    	_unit addweapon "ACE_MAP";
    	_unit addweapon "ACE_DAGR";
    	_unit addweapon "acre_prc148";
    	_unit addweapon "ItemCompass";
    	_unit addweapon "ACE_Earplugs";
    //Ruck
    	_unit addweapon "ACE_Backpack_US";
    	[_unit, "ACE_30Rnd_556x45_S_Stanag", 5] call ACE_fnc_PackMagazine;
    	[_unit, "ACE_20Rnd_762x51_S_M110", 5] call ACE_fnc_PackMagazine;
    	[_unit, "ACE_KeyCuffs", 1] call ACE_fnc_PackWeapon;
    	[_unit, "100Rnd_762x51_M240", 2] call ACE_fnc_PackMagazine;
    	[_unit, "ACE_Medkit", 2] call ACE_fnc_PackMagazine;
    	[_unit, "ACE_Bandage", 2] call ACE_fnc_PackMagazine;
    	[_unit, "ACE_Epinephrine", 2] call ACE_fnc_PackMagazine;
    	[_unit, "ACE_Morphine", 2] call ACE_fnc_PackMagazine;
    	[_unit, "SmokeShell", 2] call ACE_fnc_PackMagazine;
    	[_unit, "SmokeShellYellow", 1] call ACE_fnc_PackMagazine;
    	[_unit, "Pipebomb", 2] call ACE_fnc_PackMagazine;
    //WEAPONS
    	_unit addWeapon "SCAR_L_CQC_Holo";
    	{_unit addMagazine "ACE_30Rnd_556x45_S_Stanag"} forEach [1,2,3,4,5];
    	_unit setVariable ["ACE_weapononback", "M110_NVG_EP1"];
    	{_unit addMagazine "ACE_20Rnd_762x51_S_M110"} forEach [1,2,3,4,5];
    	};

  2. #2

Similar Threads

  1. Respawn Deserted Vehicles script and Clone AI Players on Restart
    By mycatsaid in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 1
    Last Post: Dec 27 2011, 17:50
  2. Single mission restart
    By Fusion_Marduc in forum ARMA 2 & OA - USER MISSIONS
    Replies: 1
    Last Post: Sep 17 2010, 07:51
  3. Breaking a Loop when another Script activates
    By metalhead897 in forum OFP : MISSION EDITING & SCRIPTING
    Replies: 3
    Last Post: Jan 1 2007, 23:27
  4. Server restart script?
    By Vegabond in forum MULTIPLAYER
    Replies: 3
    Last Post: Feb 1 2003, 00:39
  5. Cant restart the game with #restart command
    By Tokamak in forum TROUBLESHOOTING
    Replies: 2
    Last Post: Dec 1 2001, 01:58

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •