Jump to content
Sign in to follow this  
Rodrigo68

Keep your gear when you respawn

Recommended Posts

Sorry if there is a thread for this already but in Domination by Xeno as everyone knows when you die you respawn with the same gear i've searched for a good hour now and cant find it.

can anyone help me out? Oh and please dont say anything obvious like use search or contact the author.

Share this post


Link to post
Share on other sites

Norrins revive scripts are totally customizable. You can set it up to respawn with what you died with or respawn with a full load out.

Also if you PM norrin he is always more then willing to help you out if you want to use any of the custom handlers. see OFPEC's thread

Share this post


Link to post
Share on other sites

I don't know who originated it but in Evolution, it's like this: -

at join, arrays contain default loadouts

pallammo = ["30Rnd_556x45_Stanag", "30Rnd_556x45_Stanag", "30Rnd_556x45_Stanag", "30Rnd_556x45_Stanag", "M136", "pipebomb"];

pweapons = ["M16A4", "M136", "binocular", "NVGoggles"];

at (re)spawn, loadouts are applied to your kit after removealleverything

_player = player;

removeAllWeapons _player;

{player addmagazine _x} forEach pallammo;

{player addweapon _x} forEach pweapons;

player selectweapon (primaryWeapon player);

if you re-arm at the hangar ammocrates, a trigger activates to re-write your loadout arrays

class Item79

{

position[]={9931.549805,121.278351,10389.291016};

repeating=1;

interruptable=1;

age="UNKNOWN";

expCond="animationState player == ""ainvpknlmstpslaywrfldnon""";

expDesactiv="closeDialog 0;if((player distance (getMarkerPos ""ammob1"")) < 20) then {[]execVM ""scripts\m4a1sd.sqf""}";

class Effects

{

};

--m41asd.sqf--

_guns = weapons player;

_qds = ({_x == "M4A1SD"} count _guns);

if (_qds == 1) then // give the player silenced ammo

{

{

if (_x == "30Rnd_556x45_Stanag") then

{

player removeMagazine _x;

player addMagazine "30Rnd_556x45_StanagSD";

};

} forEach magazines player;

reload player;

};

pallammo = magazines player;

pweapons = weapons player;

exit;

I added a thing which detects if you're a medic and reduces your ammo allowance, as well as the SD ammo check above.

Share this post


Link to post
Share on other sites

Create a trigger.

Condition: local player

On Act.: handle = [] execVM "weaponrespawn.sqf"

weaponrespawn.sqf:

_weapons = [];
_magazines = [];

while {true} do {
   waitUntil {!alive player};
   _weapons = weapons player;
   _magazines = magazines player;
   waitUntil {alive player};
   _p = player;
   removeAllWeapons _p;
   {_p addMagazine _x} forEach _magazines;
   {_p addWeapon _x} forEach _weapons;
   _primw = primaryWeapon _p;
   if (_primw != "") then {
       _p selectWeapon _primw;
       _muzzles = getArray(configFile >> "cfgWeapons" >> _primw >> "muzzles");
       _p selectWeapon (_muzzles select 0);
   };
};

Xeno

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  

×