Jump to content

Custom Loadouts for Admins and Regular Players


MisterT

Recommended Posts

OK, got everything in however:

 

1. I had to put the admin file in the root of the pbo, otherwise I was getting an error that it wasn't found

2. Nothing is happening when a player comes into the clone room or leaves it through a drain, no load outs are being given.

 

Here are my files if you want to peek:

https://drive.google.com/file/d/0B_HUuS7AY7bQNEY5MzN2aFhnTVU/view?usp=sharing

Link to comment
Share on other sites

OK, got everything in however:

 

1. I had to put the admin file in the root of the pbo, otherwise I was getting an error that it wasn't found

2. Nothing is happening when a player comes into the clone room or leaves it through a drain, no load outs are being given.

 

Here are my files if you want to peek:

https://drive.google.com/file/d/0B_HUuS7AY7bQNEY5MzN2aFhnTVU/view?usp=sharing

Your sensor code was in the wrong place in your mission file:

https://www.dropbox.com/s/5o8nqizegwgrpgq/mission.sqm?dl=0

Link to comment
Share on other sites

Digging into it more, based on what you posted here, I don't see anywhere that onPlayerRespawn.sqf is called. I am guessing that is why it's hitting everyone?

 

onPlayerRespawn.sqf is a system file which gets called automatically when a player respawns. The only reason everyone on the server would be given the loadout is if the sensor code in your mission file is wrong.

Link to comment
Share on other sites

Sorry I've got it wrong:

 

This is how I currently have it set up (it changed recently) I have the trigger setup to give the uniform to my headless clients but it stopped working for players a few updates ago:

 

In your mission file alter the sensor to this:

			position[]={23599.836,3.1900001,18000.484};
			a=50;
			b=50;
			activationBy="ANY";
			repeating=1;
			interruptable=1;
			age="UNKNOWN";
			name="cloneroomsafezone";
			expCond = "";
			expActiv="";
			expDesactiv="";
			class Effects
			{
			};
In onPlayerRespawn.sqf put this:

if (!isServer and !hasInterface) then 
{
newPlayer = true;
};

if((player distance cloneroomsafezone) < 25) then 
{ 
     // Supply Starting Loadout [] 
     execVM "StartingLoadout.sqf"; 
     systemchat("Auto Wardrobe Activated...");
};
Then in StartingLoadout.sqf have your loadout script.

 

This means that whenever a player logs in, if they are within 25m of the cloneroom centre point they it will run the loadout script.  If you have checks in your loadout script to only work for new players then it will only work for fresh spawns.

 

This is the loadout script I use:

waitUntil {alive vehicle player}; 
waitUntil {typeOF player != "VirtualMan_EPOCH"};

if (EPOCH_playerEnergy < 20 && hasInterface && newPlayer) then
{
	uiSleep 5;
	hint "Standard Loadout Supplied";
	clearWeaponCargo player;
	clearMagazineCargo player;
	player addWeapon "ItemMap";
	player addItemToVest "FAK";
	player addItemToVest "FAK";
	player addItemToVest "scam_epoch";
	player addItemToVest "scam_epoch";
	player addItemToVest "ItemSodaRbull";
	player addItemToVest "ItemSodaRbull";
	EPOCH_playerEnergy = 500;					
		   
	_modelMale = (typeOF player == "Epoch_Male_F");
	_modelFemale = (typeOF player == "Epoch_Female_F");	
			
	if (_modelFemale) then 
	{
		player forceAddUniform "U_BasicBodyFemale";
	};
	if (_modelMale) then 
	{
		player forceAddUniform "U_C_Poor_1";	
	};
	newPlayer = false;
}
else
{
	hint "Standard Loadout Already Supplied";
}; 
Link to comment
Share on other sites

ah, thank you! and the onplayerrespawn.sqf should be in the root of the pbo, correct? I actually moved the player loadout file to custom\ and changed the path in the sensor. Just want to make sure it won't look for it wherever the loadout file is.

Link to comment
Share on other sites

That fixed it, now it's working like a champ. Standard players are getting their loading. Now my admin section isn't working though. I have gone through it about 5 times but no luck. I don't see where i missed anything, it seems to be adding the admin list because it's not loading them with the default loadout, it's leaving admin's in their underwear, but I am also not seeing the "admin load-out already supplied message" either.

 

https://drive.google.com/file/d/0B_HUuS7AY7bQOWM2Rkp0ajNSMVk/view?usp=sharing

 

waitUntil {alive vehicle player}; 
waitUntil {typeOF player != "VirtualMan_EPOCH"};
 
if ((getPlayerUID player) in admin_list) then 
{
if (EPOCH_playerEnergy < 20 && hasInterface && newPlayer) then
{
uiSleep 5;
hint "Admin Loadout Supplied";
 
clearWeaponCargo player;
clearMagazineCargo player;
removeBackpackGlobal player;
 
_modelMale = (typeOF player == "Epoch_Male_F");
_modelFemale = (typeOF player == "Epoch_Female_F");
 
if (_modelFemale) then {
player forceAddUniform "U_ghillie1_uniform";
player addWeapon "srifle_DMR_05_hex_F";
player addPrimaryWeaponItem "10Rnd_93x64_DMR_05_Mag";
player addPrimaryWeaponItem "muzzle_snds_93mmg_tan";
player addPrimaryWeaponItem "bipod_01_F_snd";
player addPrimaryWeaponItem "optic_AMS_snd";
player addPrimaryWeaponItem "acc_flashlight";
player addVest "V_39_EPOCH";
player addItemToVest "10Rnd_93x64_DMR_05_Mag";
player addItemToVest "10Rnd_93x64_DMR_05_Mag";
player addItemToVest "10Rnd_93x64_DMR_05_Mag";
player addItemToVest "10Rnd_93x64_DMR_05_Mag";
player addItemToVest "10Rnd_93x64_DMR_05_Mag";
player addItemToVest "10Rnd_93x64_DMR_05_Mag";
player addItemToVest "10Rnd_93x64_DMR_05_Mag";
player addItemToVest "10Rnd_93x64_DMR_05_Mag";
};
if (_modelMale) then {
player forceAddUniform "U_O_FullGhillie_sard";
player addWeapon "srifle_DMR_02_sniper_F";
player addPrimaryWeaponItem "10Rnd_338_Mag";
player addPrimaryWeaponItem "muzzle_snds_338_sand";
player addPrimaryWeaponItem "bipod_01_F_snd";
player addPrimaryWeaponItem "optic_AMS_snd";
player addPrimaryWeaponItem "acc_flashlight";
player addVest "V_39_EPOCH";
player addItemToVest "10Rnd_338_Mag";
player addItemToVest "10Rnd_338_Mag";
player addItemToVest "10Rnd_338_Mag";
player addItemToVest "10Rnd_338_Mag";
player addItemToVest "10Rnd_338_Mag";
player addItemToVest "10Rnd_338_Mag";
player addItemToVest "10Rnd_338_Mag";
player addItemToVest "10Rnd_338_Mag";
};
player addWeapon "MultiGun";
player addWeapon "launch_RPG32_F";
player addWeapon "NVG_EPOCH";
player addWeapon "EpochRadio0";
player addWeapon "ItemMap";
player addWeapon "ItemGPS";
player addWeapon "ItemWatch";
player addWeapon "ItemCompass";
player addWeapon "RangeFinder";
player addWeapon "H_19_EPOCH";
player addBackpack "B_Carryall_cbr";
player addItemToVest "Repair_EPOCH";
player addItemToVest "Defib_EPOCH";
player addItemToVest "Heal_EPOCH";
player addItemToVest "optic_Nightstalker";
player addItemToUniform "FoodWalkNSons";
player addItemToUniform "FoodWalkNSons";
player addItemToUniform "FoodWalkNSons";
player addItemToUniform "acc_pointer_IR";
player addItemToUniform "FAK";
player addItemToUniform "FAK";
player addItemToUniform "FAK";
player addItemToUniform "FAK";
player addItemToUniform "FAK";
player addItemToUniform "FAK";
player addItemToUniform "meatballs_epoch";
player addItemToUniform "meatballs_epoch";
player addItemToUniform "meatballs_epoch";
player addItemToBackpack "RPG32_F";
player addItemToBackpack "RPG32_F";
player addItemToBackpack "EnergyPackLg";
EPOCH_playerCrypto = 7500;
EPOCH_playerEnergy = 2500;
}
else
{
hint "Admin Load out Already Supplied";
};
}
else
{
if (EPOCH_playerEnergy < 20 and hasInterface) then
{
uiSleep 5;
hint "Standard Loadout Supplied";
clearWeaponCargo player;
clearMagazineCargo player;
player addWeapon "ItemMap";
player addItemToVest "FAK";
player addItemToVest "FAK";
player addItemToVest "scam_epoch";
player addItemToVest "scam_epoch";
player addItemToVest "ItemSodaRbull";
player addItemToVest "ItemSodaRbull";
EPOCH_playerEnergy = 500;
  
_modelMale = (typeOF player == "Epoch_Male_F");
_modelFemale = (typeOF player == "Epoch_Female_F");
 
if (_modelFemale) then 
{
player forceAddUniform "U_BasicBodyFemale";
};
if (_modelMale) then 
{
player forceAddUniform "U_C_Poor_1";
};
newPlayer = false;
}
else
{
hint "Standard Load out Already Supplied";
}; 
};

 

 

Link to comment
Share on other sites

Tried putting it there as well, didn't work. And when I did I got a script error that it couldn't find the file.

It must be an issue with how the server is configured that's stopping that from finding the file, is it a hosted server?

You may just have to put your steam6id check into the loadout script if it can't be resolved like that or place the admin.sqf in your mission file and import it from there.

Link to comment
Share on other sites

So, like this?

 

waitUntil {alive vehicle player}; 
waitUntil {typeOF player != "VirtualMan_EPOCH"};
 
if ( getPlayerUID player in ["765xxx3787788","76561xxx8974301","76561xxx991638"] ) then {
{
if (EPOCH_playerEnergy < 20 && hasInterface && newPlayer) then
{
uiSleep 5;
hint "Admin Loadout Supplied";
 
clearWeaponCargo player;
clearMagazineCargo player;
removeBackpackGlobal player;
 
_modelMale = (typeOF player == "Epoch_Male_F");
_modelFemale = (typeOF player == "Epoch_Female_F");
 
if (_modelFemale) then {
player forceAddUniform "U_ghillie1_uniform";
player addWeapon "srifle_DMR_05_hex_F";
Link to comment
Share on other sites

Ok, I tried what i just posted above and I am still getting the exact same behavior. I think the admin logical is working which is why it's not skipping me on to default loadout. It's failing somewhere after it. Any ideas?

Link to comment
Share on other sites

Ok, I tried what i just posted above and I am still getting the exact same behavior. I think the admin logical is working which is why it's not skipping me on to default loadout. It's failing somewhere after it. Any ideas?

In onPlayerRespawn change it to:

 

newPlayer = true;

if((player distance cloneroomsafezone) < 25) then 
{ 
     // Supply Starting Loadout [] 
     execVM "StartingLoadout.sqf"; 
     systemchat("Auto Wardrobe Activated...");
};
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
×
×
  • Create New...