Jump to content
Sign in to follow this  
=101AD=Richard

Domination weapon save

Recommended Posts

In domination I added the backpacks to the mission but how can you have it so they save when you die, I know this script is for weapons save

// by Xeno
#include "x_setup.sqf"

if (primaryWeapon player == "" || primaryWeapon player == " ") exitWith {"You need a primary weapon to save the layout !!!" call XfGlobalChat};

_d_custom_layout = [weapons player,magazines player];

d_custom_layout = _d_custom_layout;

__pSetVar ["d_custom_backpack", if (count __pGetVar(d_player_backpack) > 0) then {
[__pGetVar(d_player_backpack) select 0, __pGetVar(d_player_backpack) select 1]
} else {
[]
}];

#ifdef __ACE__
d_custom_ruckbkw = __pGetVar(ACE_weapononback);
d_custom_ruckmag = __pGetVar(ACE_RuckMagContents);
d_custom_ruckwep = __pGetVar(ACE_RuckWepContents);
#endif

"Weapons and magazines layout saved. You will respawn with this layout, means all magazines that you currently have." call XfGlobalChat;

Share this post


Link to post
Share on other sites

Ok I found this as well which is where weapons save in domination, IO cant make sense of this. Ive tried and ive looked through so many files for domination. I want the stock OA backpacks to be able to save when you die in Domination respawn

waitUntil {alive player};
#ifndef __ACE__
if (!isNil {__pGetVar(d_p_ev_hd)}) then {d_phd_invulnerable = true};
#else
__pSetVar ["ace_w_allow_dam", false];
#endif
#ifdef __OA__
removeBackpack player;
#endif
_p = player;
if (x_weapon_respawn) then {
removeAllItems _p;
removeAllWeapons _p;
#define __addmx _p addMagazine _x
#define __addwx _p addWeapon _x
#ifndef __REVIVE__
if (count d_custom_layout > 0) then {
	{__addmx} forEach (d_custom_layout select 1);
	{__addwx} forEach (d_custom_layout select 0);
} else {
	{__addmx} forEach _magazines;
	{__addwx} forEach _weapons;
	{if !(_p hasWeapon _x) then {_p addWeapon _x}} forEach _items;
	if (count d_backpack_helper > 0) then {
		{__addmx} forEach (d_backpack_helper select 0);
		{__addwx} forEach (d_backpack_helper select 1);
		d_backpack_helper = [];
	};
};
#else
{__addmx} forEach _magazines;
{__addwx} forEach _weapons;
{if !(_p hasWeapon _x) then {_p addWeapon _x}} forEach _items;
if (count d_backpack_helper > 0) then {
	{__addmx} forEach (d_backpack_helper select 0);
	{__addwx} forEach (d_backpack_helper select 1);
	d_backpack_helper = [];
};
#endif
if (WithBackpack) then {
	if (count __pGetVar(d_custom_backpack) > 0) then {
		__pSetVar ["d_player_backpack", [__pGetVar(d_custom_backpack) select 0, __pGetVar(d_custom_backpack) select 1]];
	};
};
#ifdef __ACE__
if (!isNil "d_custom_ruckbkw") then {
	if ((typeName d_custom_ruckbkw) == "STRING") then {_backwep = d_custom_ruckbkw};
};
if (!isNil "d_custom_ruckmag") then {
	if ((typeName d_custom_ruckmag) == "ARRAY") then {_ruckmags = d_custom_ruckmag};
};
if (!isNil "d_custom_ruckwep") then {
	if ((typeName d_custom_ruckwep) == "ARRAY") then {_ruckweapons = d_custom_ruckwep};
};
if (__pGetVar(d_earwear)) then {
	if !(_p hasWeapon "ACE_Earplugs") then {_p addWeapon "ACE_Earplugs"}
};
#endif
_primw = primaryWeapon _p;
if (_primw != "") then {
	_p selectWeapon _primw;
	_muzzles = getArray(configFile>>"cfgWeapons" >> _primw >> "muzzles");
	_p selectWeapon (_muzzles select 0);
};
#ifdef __OA__
if (_ubackp != "") then {
	_p addBackpack _ubackp;
};
#endif
};
"RadialBlur" ppEffectAdjust [0.0, 0.0, 0.0, 0.0];
"RadialBlur" ppEffectCommit 0;
"RadialBlur" ppEffectEnable false;
#ifdef __ACE__
if (_hasruck) then {
if (!isNil "_ruckmags") then {__pSetVar ["ACE_RuckMagContents", _ruckmags]};
if (!isNil "_ruckweapons") then {__pSetVar ["ACE_RuckWepContents", _ruckweapons]};
};
if (!isNil "_backwep") then {if((typeName _backwep) == "STRING") then {__pSetVar ["ACE_weapononback", _backwep]}};
ACE_MvmtFV = 0;ACE_FireFV = 0;ACE_WoundFV = 0;ACE_FV = 0;
ACE_Heartbeat = [0,20];ACE_Blackout = 0;ACE_Breathing = 0;
#endif


Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×