Jump to content

Auto Respawn loadouts


MisterT

Recommended Posts

Add this code to your init.sqf in missions files.  If you don't have one than create one.

Remove 

if (!isServer) then {
	waitUntil {!isNull player};
	waitUntil {player == player};
	
	while {true} do {
		_player = player;
		player addEventHandler ["Respawn", {
			if (getPlayerUID player in ["XXXXXXXXXXX"]) then {  \\admin steamdid

				player addMagazine "11Rnd_45ACP_Mag";
				player addMagazine "30Rnd_65x39_caseless_mag";
				player addWeapon "arifle_MX_ACO_F";
				player addWeapon "NVGoggles";
				player addWeapon "ItemRadio";
				player addWeapon "ItemMap";
				player addWeapon "ItemGPS";
				player addWeapon "RangeFinder";
				player addWeapon "hgun_Pistol_heavy_01_F";
				player addBackpack "B_Carryall_cbr";
				player addVest "V_TacVest_camo";
				player addItemToVest "11Rnd_45ACP_Mag";
				player addItemToVest "30Rnd_65x39_caseless_mag";
				player forceAddUniform "U_B_CombatUniform_mcam";
				EPOCH_playerCrypto = 3000;
} else {
player addWeapon "EpochRadio0"; // This is the load out for reg players.
player addWeapon "ItemMap";
player addWeapon "hgun_Pistol_heavy_01_F";
player addMagazine "11Rnd_45ACP_Mag";
EPOCH_playerCrypto = 100;
};

}]; waitUntil {_player != player}; }; };

Here for the people asking how to do starting loadouts.

 

I added 1 for admins 1 for normal users.

 

enjoy

 

Mister T

Link to comment
Share on other sites

just so you know you don't have to keep adding the respawn eventhandler it will eventually slow system to a crawl on client when they die heaps....

if (!isServer) then {
waitUntil {!isNull player};
waitUntil {player == player};
player addEventHandler ["Respawn", {
if (getPlayerUID player in ["XXXXXXXXXXX"]) then {  \\admin steamdid
player addMagazine "11Rnd_45ACP_Mag";
player addMagazine "30Rnd_65x39_caseless_mag";
player addWeapon "arifle_MX_ACO_F";
player addWeapon "NVGoggles";
player addWeapon "ItemRadio";
player addWeapon "ItemMap";
player addWeapon "ItemGPS";
player addWeapon "RangeFinder";
player addWeapon "hgun_Pistol_heavy_01_F";
player addBackpack "B_Carryall_cbr";
player addVest "V_TacVest_camo";
player addItemToVest "11Rnd_45ACP_Mag";
player addItemToVest "30Rnd_65x39_caseless_mag";
player forceAddUniform "U_B_CombatUniform_mcam";
EPOCH_playerCrypto = 3000;
} else {
player addWeapon "EpochRadio0"; // This is the load out for reg players.
player addWeapon "ItemMap";
player addWeapon "hgun_Pistol_heavy_01_F";
player addMagazine "11Rnd_45ACP_Mag";
EPOCH_playerCrypto = 100;
};
}];
};

 

This should work just the same and it only gets added once.

Link to comment
Share on other sites

@ Hardened...         how do you add the crate?       

 

I added the create to my mission file. I'm not sure if this is the optimal way to do it but works without issue:

 

Add below just above "class Markers", change the "MYFOLDER\MYSCRIPTFILE.sqf" for reflect you file location.

 

class Vehicles
{
items=1;
class Item0
{
position[]={23600.539,3.1900001,17999.184};
azimut=130.10001;
id=102;
side="EMPTY";
vehicle="O_supplyCrate_F";
skill=0.60000002;
init="clearMagazineCargoGlobal this;  clearWeaponCargoGlobal this;  clearItemCargoGlobal this; clearBackpackCargoGlobal this; this addAction[""<t color=#D11313'>Grab Starting Loadout</t>"", ""MYFOLDER\MYSCRIPTFILE.sqf"];";
};
};
 
 
Hardened if there is a better way please let me know.
 
On my old wasteland server the MYSCRIPTFILE.sqf would allow me to do different levels of loadouts depending on Steam ID. I'll be looking at this again this weekend (time permitting).
 
Thanks and good luck.
 
*note, if your mission is not in plan text when you come to edit it stop using PBO Manager. I use mikeroupdate and ExtacrtPBO.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...