Jump to content
49lone82

Respawn with same weapons at death?

Recommended Posts

What script do I have to add/modify to have all players respawn with the gear they had on them at time of death?

?

 

Share this post


Link to post
Share on other sites

This Is All You Have To Do Man

 

First step create a folder in your mission called scripts

inside that file create a .sqf named in loadout.sqf

 

inside loadout.sqf paste this 

//Created By Cross Fire

//Save Load Out Script

hint "Loadout Saved";

while {true} do {


waitUntil {!alive player};

_myWeapons = weapons player;
_myMagazines = magazines player;
_myVest = vest player;
_myBackpack = backpack player;
_myBackpackitems = backpackItems player;
_myVestitems = vestItems player;
_myUniform = uniform player;
_myHeadgear = headgear player;
_myWeaponItems = primaryWeaponItems player;

waitUntil {alive player};

_p = player;
removeAllItems _p;
removeAllWeapons _p;
removeUniform _p;
removeVest _p;
removeBackpack _p;
removeHeadgear _p;

_p addUniform _myUniform;
_p addHeadgear _myHeadgear;
_p addBackpack _myBackpack;
_p addVest _myVest;
{_p addMagazine _x} forEach _myMagazines;
{_p addWeapon _x} forEach _myWeapons;
{_p addItemToBackpack _x} forEach _myBackpackitems;
{_p addItemToVest _x} forEach _myVestitems;
{_p addPrimaryWeaponItem _x} forEach _myweaponItems;
 
hint "Loadout Restored";

};

next step go to your init.sqf and paste the following execute command

Place This In Your init.sqf


//Load Out Script Initialization 
 0 = [] execvm "scripts\loadout.sqf";

Thats all your have to do hope this helped if not then just reply back.

Share this post


Link to post
Share on other sites

Ok the issue is the way your server is set up it not gonna save the gear with this script you would have to have a database set up or another script.

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

×