Jump to content
Sign in to follow this  
Aralvar

Respawn with gear had on death

Recommended Posts

I've searched and searched and searched for this script but I can only seem to find scripts for Arma 1 that don't seem to work for Arma 2, at least not for me (and yes, I've renamed the sqs areas to sqf where needed so that it is supposed to work with Arma 2). All I want is some script, that is configurable, that lets me choose what a player respawns with on death. Like right now, I would like players to respawn with their weapons and maybe some misc items, but no ammunition that they had. Is anyone aware of a script like this that works with Arma 2?

Again, I'm sorry for all my questions recently.

Share this post


Link to post
Share on other sites

ACE has option or module for respawning with the same gear i think.

Share this post


Link to post
Share on other sites

This worked for me for ArmA2

// respawnGear.sqf by Xeno
// Add this to your init.sqf
// dummy = [true,true] execVM "respawnGear.sqf";

private ["_weapons", "_magazines","_deadbody", "_p", "_primw", "_muzzles"];

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

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  

×