Mawel 10 Posted September 10, 2010 (this is my second post in this forum, my first is quite the same but in a one year old thread) i am using the following script for saving the loadout on death and adding it to player on respawn: // By Lq.Snake// Purpose: Preserve unit's gear at time of death // Locality: Client // Execution: In init.sqf, add a line of code that will execute this script. (ie. [] execVM "preserveGear.sqf" #define _DEBUG false if (_DEBUG) then { player sideChat "preserveGear.sqf running..." }; // JIP if (!isDedicated && isNull player) then { waitUntil { !isNull player }; }; if (!isDedicated) then { ls_Preserve_Kit = { if (_DEBUG) then { player sideChat "Inside code" }; _unit = _this select 0; _weaponskilled = weapons _unit; _magazineskilled = magazines _unit; _arrayRuck = _unit call ACE_Sys_Ruck_fnc_RuckMagazines; _weaponOnBack = _unit getVariable "ACE_WeaponOnBack"; if (_DEBUG) then { player sideChat format["%1", _weaponOnBack] }; if (_DEBUG) then { player sideChat format["%1", _weaponskilled] }; removeAllWeapons player; removeAllItems player; waitUntil { alive player }; if (_DEBUG) then { player sideChat "Gearing player..." }; removeAllWeapons player; removeAllItems player; { player addMagazine _x } forEach _magazineskilled; { player addWeapon _x } forEach _weaponskilled; if (player call ACE_Sys_Ruck_fnc_hasRuck) then { {[player, _x] call ACE_Sys_Ruck_fnc_AddMagToRuck} forEach _arrayRuck; }; if (_weaponOnBack != "") then { player setVariable ["ACE_WeaponOnBack", _weaponOnBack]; }; player selectWeapon (primaryWeapon player); }; player addEventHandler ["killed", { _this spawn ls_Preserve_Kit}]; if (_DEBUG) then { player sideChat "preserveGear.sqf: EOF" }; }; it works fine with the acception, that the ruck content doubles on every respawn. it seens that this script doesnt remove the ruck items. i think that after the line where it sais: " ... waitUntil { alive player }; if (_DEBUG) then { player sideChat "Gearing player..." }; ..." there has to come a line which removes everything that was put into the ruck. another possibility is to remove the backpack reference in this script completely, but i dont know wether that will work and how exatly it should be done since my scripting skills are not present. could it be that this script is outdated? Share this post Link to post Share on other sites