Jump to content

Custom Loadouts for Admins and Regular Players


MisterT

Recommended Posts

That is an insanely good idea. Do you mind sharing how you did that?

 

You would need to add checks to the loadout script that was triggered by the sensor otherwise if players got too close to the box outside it would wipe their gear and give them the starting loadout again.

 

This works for applying a loadout on leaving the clone room on Altis. Edit your mission.sqm and in the sensor section add:

class Sensors
{
items=1;
class Item0
{
position[]={23599.836,3.1900001,18000.484};
a=50;
b=50;
activationBy="ANY";
repeating=1;
interruptable=1;
age="UNKNOWN";
name="cloneroomsafezone";
expCond = "(player distance cloneroomsafezone) < 50;";
expActiv="hint ""You are in the clone room"";  inSafeZone = true;";
expDesactiv="execVM ""StartingLoadout.sqf"";";
class Effects
{
};
};
};

Then in your StartingLoadout.sqf in the root of your mission file include checks to ensure it only applies to fresh spawns:

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

if (newPlayer) then
{
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";
};  
 

In your OnPlayerRespawn.sqf (if you don't have one just place it in your mission root) put the following:

newPlayer = true;
Link to comment
Share on other sites

Thanks, works but not with random gear. Have anyone an idea? 


if (newPlayer) then
			{
			hint "Random Loadout Supplied";
			clearWeaponCargo player;
			clearMagazineCargo player;
			player addVest _vest;
			player addWeapon _pistol;
			player addMagazine _mag;
			player addMagazine _item;
			player addMagazine _food;
			player addMagazine _drink;
			player addWeapon "EpochRadio0";
			EPOCH_playerEnergy = 500;
			_PistolANDmag = [["hgun_Pistol_heavy_02_Yorris_F","6Rnd_45ACP_Cylinder"],["hgun_Pistol_heavy_02_F","6Rnd_45ACP_Cylinder"],["hgun_Pistol_heavy_01_MRD_F","11Rnd_45ACP_Mag"],["hgun_Pistol_heavy_01_snds_F","11Rnd_45ACP_Mag"],["hgun_Pistol_heavy_01_F","11Rnd_45ACP_Mag"],["hgun_ACPC2_snds_F","9Rnd_45ACP_Mag"],["hgun_ACPC2_F","9Rnd_45ACP_Mag"],["hgun_Rook40_snds_F","16Rnd_9x21_Mag"],["hgun_Rook40_F","16Rnd_9x21_Mag"],["hgun_P07_snds_F","16Rnd_9x21_Mag"],["hgun_P07_F","16Rnd_9x21_Mag"]] call BIS_fnc_selectRandom;
			_pistol = _PistolANDmag select 0;
			_mag = _PistolANDmag select 1;
			_item = "FAK";
			_food = ["CookedSheep_EPOCH","CookedGoat_EPOCH","CookedChicken_EPOCH","CookedRabbit_EPOCH","ItemTunaCooked","ItemSeaBassCooked","ItemTroutCooked","FoodSnooter","FoodMeeps"] call BIS_fnc_selectRandom;
			_drink = ["ItemSodaRbull","ItemSodaOrangeSherbet","ItemSodaPurple","ItemSodaMocha","ItemSodaBurst","FoodWalkNSons","WhiskeyNoodle"] call BIS_fnc_selectRandom;
			_uniform = ["U_C_Scientist","U_C_Journalist","U_C_WorkerCoveralls","U_C_Poor_1","U_C_Poloshirt_redwhite","U_C_Poloshirt_salmon","U_C_Poloshirt_tricolour","U_C_Poloshirt_burgundy","U_C_Poloshirt_blue","U_C_Poloshirt_stripped"] call BIS_fnc_selectRandom;
			_vest = ["V_16_EPOCH","V_15_EPOCH","V_14_EPOCH","V_13_EPOCH","V_12_EPOCH","V_11_EPOCH","V_10_EPOCH","V_9_EPOCH","V_8_EPOCH","V_7_EPOCH","V_6_EPOCH","V_5_EPOCH","V_4_EPOCH","V_3_EPOCH","V_2_EPOCH","V_1_EPOCH"] call BIS_fnc_selectRandom;
			
			
			_modelMale = (typeOF player == "Epoch_Male_F");
            _modelFemale = (typeOF player == "Epoch_Female_F");	
        
                if (_modelFemale) then {
                     player forceAddUniform "U_BasicBodyFemale";
                         };
                if (_modelMale) then {
                    player forceAddUniform _uniform;
                         };        		      	
			newPlayer = false;		
			}else{
				hint "Random Loadout Already Supplied";
			}; 
Link to comment
Share on other sites

You could try inserting a sleep at the top of the script to allow the game time to teleport you. eg:

Sleep 5;
if (newPlayer) then
            {
            hint "Random Loadout Supplied";
            clearWeaponCargo player;
            clearMagazineCargo player;
            player addVest _vest;

            player addWeapon _pistol;...........

Or you could just get it to give you the loadout when you first spawn in the clone room:

class Sensors
{
items=1;
class Item0
{
position[]={23599.836,3.1900001,18000.484};
a=50;
b=50;
activationBy="ANY";
repeating=1;
interruptable=1;
age="UNKNOWN";
name="cloneroomsafezone";
expCond = "(player distance cloneroomsafezone) < 50;";
expActiv="hint ""You are in the clone room"";  inSafeZone = true; execVM ""StartingLoadout.sqf"";";
expDesactiv="";
class Effects
{
};
};
};
Link to comment
Share on other sites


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

Sleep 3;
if (newPlayer) then
			{
			_PistolANDmag = [["hgun_Pistol_heavy_02_Yorris_F","6Rnd_45ACP_Cylinder"],["hgun_Pistol_heavy_02_F","6Rnd_45ACP_Cylinder"],["hgun_Pistol_heavy_01_MRD_F","11Rnd_45ACP_Mag"],["hgun_Pistol_heavy_01_snds_F","11Rnd_45ACP_Mag"],["hgun_Pistol_heavy_01_F","11Rnd_45ACP_Mag"],["hgun_ACPC2_snds_F","9Rnd_45ACP_Mag"],["hgun_ACPC2_F","9Rnd_45ACP_Mag"],["hgun_Rook40_snds_F","16Rnd_9x21_Mag"],["hgun_Rook40_F","16Rnd_9x21_Mag"],["hgun_P07_snds_F","16Rnd_9x21_Mag"],["hgun_P07_F","16Rnd_9x21_Mag"]] call BIS_fnc_selectRandom;
			_pistol = _PistolANDmag select 0;
			_mag = _PistolANDmag select 1;
			_item = "FAK";
			_food = ["CookedSheep_EPOCH","CookedGoat_EPOCH","CookedChicken_EPOCH","CookedRabbit_EPOCH","ItemTunaCooked","ItemSeaBassCooked","ItemTroutCooked","FoodSnooter","FoodMeeps"] call BIS_fnc_selectRandom;
			_drink = ["ItemSodaRbull","ItemSodaOrangeSherbet","ItemSodaPurple","ItemSodaMocha","ItemSodaBurst","FoodWalkNSons","WhiskeyNoodle"] call BIS_fnc_selectRandom;
			_uniform = ["U_C_Scientist","U_C_Journalist","U_C_WorkerCoveralls","U_C_Poor_1","U_C_Poloshirt_redwhite","U_C_Poloshirt_salmon","U_C_Poloshirt_tricolour","U_C_Poloshirt_burgundy","U_C_Poloshirt_blue","U_C_Poloshirt_stripped"] call BIS_fnc_selectRandom;
			_vest = ["V_16_EPOCH","V_15_EPOCH","V_14_EPOCH","V_13_EPOCH","V_12_EPOCH","V_11_EPOCH","V_10_EPOCH","V_9_EPOCH","V_8_EPOCH","V_7_EPOCH","V_6_EPOCH","V_5_EPOCH","V_4_EPOCH","V_3_EPOCH","V_2_EPOCH","V_1_EPOCH"] call BIS_fnc_selectRandom;
			hint format ["Random Loadout Supplied"];
			clearWeaponCargo player;
			clearMagazineCargo player;
			player addVest _vest;
			player addWeapon _pistol;
			player addMagazine _mag;
			player addMagazine _item;
			player addMagazine _food;
			player addMagazine _drink;
			player addWeapon "EpochRadio0";
			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 _uniform;
                         };        		      	
			newPlayer = false;		
			}else{
				hint "Random Loadout Already Supplied";
			}; 

Works :) Thanks!

Link to comment
Share on other sites

// Admin Loadout
if ( getPlayerUID player in ["xxxxx","xxxxx","xxxxx"] ) then 
{

	hint "Admin Loadout Supplied"; 
	clearWeaponCargo player;
	clearMagazineCargo player;
	removeBackpackGlobal player;
	player forceAddUniform "U_OG_Guerilla2_3";
	player addBackpack "B_Carryall_oucamo";
	player addHeadGear "H_11_EPOCH";
	player addVest "V_26_EPOCH";
	
	player addWeapon "hgun_P07_F";	
	player addWeapon "srifle_EBR_F";	
	player addWeapon "EpochRadio0"; 
	player addWeapon "ItemGPS";
	player addWeapon "ItemMap";
	player addWeapon "ItemWatch";
	player addWeapon "ItemCompass";
	player addWeapon "Rangefinder";
	
	player addPrimaryWeaponItem "optic_tws";
	player addPrimaryWeaponItem "muzzle_snds_B";

	player addHandgunItem "muzzle_snds_L";	
	
	player addItemToVest "FAK";
	player addItemToVest "FAK";
	player addItemToVest "scam_epoch";
	player addItemToVest "scam_epoch";
	player addItemToVest "ItemSodaRbull";
	player addItemToVest "ItemSodaRbull";

	player addMagazines ["30rnd_9x21_mag", 4];
	player addMagazines ["20rnd_762x51_mag", 5];
	player addMagazines ["energypacklg", 2];
	player addMagazines ["handgrenade", 6];
	player addMagazines ["democharge_remote_mag", 4];	
	EPOCH_playerEnergy = 2500;
	EPOCH_playerCrypto = 250;
}
else
{
	// Donator Specific Loadout
	if ((getPlayerUID player in ["xxxxx"] ) && (EPOCH_playerCrypto == 0)) then	{

		hint "Donator Specific Loadout Supplied";
		clearWeaponCargo player;
		clearMagazineCargo player;
		removeBackpackGlobal player;
		player forceAddUniform "U_I_G_Story_Protagonist_F";
		player addBackpack "B_Carryall_mcamo";
		player addHeadGear "H_Watchcap_khk";
		player addVest "V_PlateCarrierH_CTRG";
	
		player addWeapon "hgun_ACPC2_F";	
		player addWeapon "L85A2_UGL_EPOCH";	
		player addWeapon "EpochRadio0"; 
		player addWeapon "ItemGPS";
		player addWeapon "ItemMap";
		player addWeapon "ItemWatch";
		player addWeapon "ItemCompass";
		player addWeapon "Rangefinder";
	
		player addPrimaryWeaponItem "optic_MRCO";
		player addPrimaryWeaponItem "acc_flashlight";

		player addHandgunItem "muzzle_snds_acp";	
	
		player addItemToVest "FAK";
		player addItemToVest "FAK";
		player addItemToVest "scam_epoch";
		player addItemToVest "scam_epoch";
		player addItemToVest "ItemSodaRbull";
		player addItemToVest "ItemSodaRbull";

		player addMagazines ["9Rnd_45ACP_Mag", 3];
		player addMagazines ["30Rnd_556x45_Stanag", 3];
		player addMagazines ["energypacklg", 1];

		EPOCH_playerCrypto = 100;
		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_I_G_Story_Protagonist_F";
		};	
		
}
else
{
	// Donator Tier 4 Loadout
	if ((getPlayerUID player in ["xxxxxxxxx"] ) && (EPOCH_playerCrypto == 0)) then	{
		hint "Donator Tier 4 Loadout Supplied";
		clearWeaponCargo player;
		clearMagazineCargo player;
		player addWeapon "hgun_Pistol_heavy_01_F";
		player addMagazine "11Rnd_45ACP_Mag";
		player addWeapon "EpochRadio0"; 
		player addWeapon "ItemMap";
		player addItemToVest  "FAK";
		player addItemToVest  "scam_epoch";
		player addItemToVest  "ItemSodaRbull";
		player addItemToVest  "11Rnd_45ACP_Mag";
		player addItemToVest  "11Rnd_45ACP_Mag";
		EPOCH_playerCrypto = 100;
		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_OG_Guerilla2_3";	
		};
		
}
	else
{
		// Standard Loadout
		if (EPOCH_playerCrypto == 0) then	{
			hint "Standard Loadout Supplied";
			clearWeaponCargo player;
			clearMagazineCargo player;
			player addWeapon "hgun_Pistol_heavy_01_F";
			player addMagazine "11Rnd_45ACP_Mag";
			player addWeapon "EpochRadio0"; 
			player addWeapon "ItemMap";
			player addItemToVest  "FAK";
			player addItemToVest  "scam_epoch";
			player addItemToVest  "ItemSodaRbull";
			player addItemToVest  "11Rnd_45ACP_Mag";
			player addItemToVest  "11Rnd_45ACP_Mag";
			EPOCH_playerCrypto = 100;
			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";	
			};
			
		};	
	};
}

Hi Guys,

 

Have had my first donator and tried to add the code to the loadfrombox.sqf, however, no loadouts are working now, where they did before, so something is wrong with it. I cannot see the issue for looking... Can anyone help?

 

Many thanks

Link to comment
Share on other sites


Hi Guys,

 

Have had my first donator and tried to add the code to the loadfrombox.sqf, however, no loadouts are working now, where they did before, so something is wrong with it. I cannot see the issue for looking... Can anyone help?

 

Many thanks

 

 

 

You forgot some ;

 

See below

 

 

// Admin Loadout
if ( getPlayerUID player in ["xxxxx","xxxxx","xxxxx"] ) then 
{
 
	hint "Admin Loadout Supplied"; 
	clearWeaponCargo player;
	clearMagazineCargo player;
	removeBackpackGlobal player;
	player forceAddUniform "U_OG_Guerilla2_3";
	player addBackpack "B_Carryall_oucamo";
	player addHeadGear "H_11_EPOCH";
	player addVest "V_26_EPOCH";
	
	player addWeapon "hgun_P07_F";	
	player addWeapon "srifle_EBR_F";	
	player addWeapon "EpochRadio0"; 
	player addWeapon "ItemGPS";
	player addWeapon "ItemMap";
	player addWeapon "ItemWatch";
	player addWeapon "ItemCompass";
	player addWeapon "Rangefinder";
	
	player addPrimaryWeaponItem "optic_tws";
	player addPrimaryWeaponItem "muzzle_snds_B";
 
	player addHandgunItem "muzzle_snds_L";	
	
	player addItemToVest "FAK";
	player addItemToVest "FAK";
	player addItemToVest "scam_epoch";
	player addItemToVest "scam_epoch";
	player addItemToVest "ItemSodaRbull";
	player addItemToVest "ItemSodaRbull";
 
	player addMagazines ["30rnd_9x21_mag", 4];
	player addMagazines ["20rnd_762x51_mag", 5];
	player addMagazines ["energypacklg", 2];
	player addMagazines ["handgrenade", 6];
	player addMagazines ["democharge_remote_mag", 4];	
	EPOCH_playerEnergy = 2500;
	EPOCH_playerCrypto = 250;
};
else
{
	// Donator Specific Loadout
	if ((getPlayerUID player in ["xxxxx"] ) && (EPOCH_playerCrypto == 0)) then	{
 
		hint "Donator Specific Loadout Supplied";
		clearWeaponCargo player;
		clearMagazineCargo player;
		removeBackpackGlobal player;
		player forceAddUniform "U_I_G_Story_Protagonist_F";
		player addBackpack "B_Carryall_mcamo";
		player addHeadGear "H_Watchcap_khk";
		player addVest "V_PlateCarrierH_CTRG";
	
		player addWeapon "hgun_ACPC2_F";	
		player addWeapon "L85A2_UGL_EPOCH";	
		player addWeapon "EpochRadio0"; 
		player addWeapon "ItemGPS";
		player addWeapon "ItemMap";
		player addWeapon "ItemWatch";
		player addWeapon "ItemCompass";
		player addWeapon "Rangefinder";
	
		player addPrimaryWeaponItem "optic_MRCO";
		player addPrimaryWeaponItem "acc_flashlight";
 
		player addHandgunItem "muzzle_snds_acp";	
	
		player addItemToVest "FAK";
		player addItemToVest "FAK";
		player addItemToVest "scam_epoch";
		player addItemToVest "scam_epoch";
		player addItemToVest "ItemSodaRbull";
		player addItemToVest "ItemSodaRbull";
 
		player addMagazines ["9Rnd_45ACP_Mag", 3];
		player addMagazines ["30Rnd_556x45_Stanag", 3];
		player addMagazines ["energypacklg", 1];
 
		EPOCH_playerCrypto = 100;
		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_I_G_Story_Protagonist_F";
		};	
		
};
else
{
	// Donator Tier 4 Loadout
	if ((getPlayerUID player in ["xxxxxxxxx"] ) && (EPOCH_playerCrypto == 0)) then	{
		hint "Donator Tier 4 Loadout Supplied";
		clearWeaponCargo player;
		clearMagazineCargo player;
		player addWeapon "hgun_Pistol_heavy_01_F";
		player addMagazine "11Rnd_45ACP_Mag";
		player addWeapon "EpochRadio0"; 
		player addWeapon "ItemMap";
		player addItemToVest  "FAK";
		player addItemToVest  "scam_epoch";
		player addItemToVest  "ItemSodaRbull";
		player addItemToVest  "11Rnd_45ACP_Mag";
		player addItemToVest  "11Rnd_45ACP_Mag";
		EPOCH_playerCrypto = 100;
		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_OG_Guerilla2_3";	
		};
		
};
	else
{
		// Standard Loadout
		if (EPOCH_playerCrypto == 0) then	{
			hint "Standard Loadout Supplied";
			clearWeaponCargo player;
			clearMagazineCargo player;
			player addWeapon "hgun_Pistol_heavy_01_F";
			player addMagazine "11Rnd_45ACP_Mag";
			player addWeapon "EpochRadio0"; 
			player addWeapon "ItemMap";
			player addItemToVest  "FAK";
			player addItemToVest  "scam_epoch";
			player addItemToVest  "ItemSodaRbull";
			player addItemToVest  "11Rnd_45ACP_Mag";
			player addItemToVest  "11Rnd_45ACP_Mag";
			EPOCH_playerCrypto = 100;
			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";	
			};
			
		};	
	};
};

 

 

See how that works for you

Link to comment
Share on other sites

Maybe someone can help here, I have tried everything with this script and as simple as it sounds and seems its not working. I am not new to scripting either, I have worked with A2 Epoch and DayZ but both Arma 3 Scripting and A3 Epoch are new to me.
 
Question before I state my problem, does everything in your mission execute at once? 
 
My problem is no matter what kind of checks I put for this spawn loadout it always seems to execute the loadout and give you a new set of gear every time you relog no matter where you are on the map.
 
If anyone can help me or point me in the right direction that would be great.
 
Here is what I have so far...
 
*Map - Bornholm
 

(excuse the pulling of different scripts from here and there in this thread, using it to test and get working)

 

*As of now the script executes after every login not just if I am inside the clone room (which has correct coordinates)

 

*Also it states that I have left the clone room as a hint at the beginning of every time I login to the server

 

*The crypto I give with this script also seems to disappear after I relog with it

Mission.sqm (correctly placed sensor)

		class Item4 {
			position[] = {15630.2, 3.0141, 210.321};
			name = "Respawn_1";
			type = "hd_dot";
		};
	};
	class Sensors
	{
		items=1;
		class Item0
		{
			position[]={13813.836,3.1900001,6882.484};
			a=50;
			b=50;
			activationBy="ANY";
			repeating=1;
			interruptable=1;
			age="UNKNOWN";
			name="cloneroomsafezone";
			expCond = "(player distance cloneroomsafezone) < 50;";
			expActiv="hint ""You are in the clone room"";  inSafeZone = true; execVM ""random.sqf"";";
			expDesactiv="hint ""You left the clone room"";  inSafeZone = false;";
			class Effects
			{
			};
		};
	};
};

class Intro {
	addOns[] = {"bornholm"};
	addOnsAuto[] = {"bornholm"};
	randomSeed = 25982387;

 

init.sqf



if (!isDedicated) then {
	[] execVM "esc.sqf";
};

[] execVM "effect.sqf";
 

 

random.sqf

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

sleep 5;
if (isNil "inSafezone") then {
    inSafezone = false;
};
hint format [" Alive %1 | EPOCH_playerCrypto %2 ",EPOCH_playerAliveTime,EPOCH_playerCrypto];
if (newPlayer && (EPOCH_playerCrypto == 0) && (EPOCH_playerAliveTime == 0)) then
{
	waitUntil {
        inSafeZone
    };
	clearWeaponCargo player;
	clearMagazineCargo player;
	_PistolANDmag = [["hgun_Pistol_heavy_02_Yorris_F","6Rnd_45ACP_Cylinder"],["hgun_Pistol_heavy_02_F","6Rnd_45ACP_Cylinder"],["hgun_Pistol_heavy_01_MRD_F","11Rnd_45ACP_Mag"],["hgun_Pistol_heavy_01_snds_F","11Rnd_45ACP_Mag"],["hgun_Pistol_heavy_01_F","11Rnd_45ACP_Mag"],["hgun_ACPC2_snds_F","9Rnd_45ACP_Mag"],["hgun_ACPC2_F","9Rnd_45ACP_Mag"],["hgun_Rook40_snds_F","16Rnd_9x21_Mag"],["hgun_Rook40_F","16Rnd_9x21_Mag"],["hgun_P07_snds_F","16Rnd_9x21_Mag"],["hgun_P07_F","16Rnd_9x21_Mag"]] call BIS_fnc_selectRandom;
	_pistol = _PistolANDmag select 0;
	_mag = _PistolANDmag select 1;
	_item = "FAK";
	_food = ["CookedSheep_EPOCH","CookedGoat_EPOCH","CookedChicken_EPOCH","CookedRabbit_EPOCH","ItemTunaCooked","ItemSeaBassCooked","ItemTroutCooked","FoodSnooter","FoodMeeps"] call BIS_fnc_selectRandom;
	_drink = ["ItemSodaRbull","ItemSodaOrangeSherbet","ItemSodaPurple","ItemSodaMocha","ItemSodaBurst","FoodWalkNSons","WhiskeyNoodle"] call BIS_fnc_selectRandom;
	_uniform = ["U_C_Scientist","U_C_Journalist","U_C_WorkerCoveralls","U_C_Poor_1","U_C_Poloshirt_redwhite","U_C_Poloshirt_salmon","U_C_Poloshirt_tricolour","U_C_Poloshirt_burgundy","U_C_Poloshirt_blue","U_C_Poloshirt_stripped"] call BIS_fnc_selectRandom;
	_vest = ["V_1_EPOCH","V_2_EPOCH","V_3_EPOCH","V_4_EPOCH","V_5_EPOCH","V_16_EPOCH","V_1_EPOCH","V_2_EPOCH","V_3_EPOCH","V_4_EPOCH","V_5_EPOCH"] call BIS_fnc_selectRandom;
	_hat = ["H_39_EPOCH","H_40_EPOCH","H_41_EPOCH","H_42_EPOCH","H_43_EPOCH","H_44_EPOCH","H_45_EPOCH","H_46_EPOCH","H_47_EPOCH","H_48_EPOCH","H_49_EPOCH","H_50_EPOCH","H_51_EPOCH","H_52_EPOCH","H_53_EPOCH","H_54_EPOCH","H_55_EPOCH","H_56_EPOCH","H_57_EPOCH","H_58_EPOCH","H_59_EPOCH","H_60_EPOCH","H_61_EPOCH","H_62_EPOCH","H_63_EPOCH","H_64_EPOCH","H_65_EPOCH","H_66_EPOCH","H_67_EPOCH","H_68_EPOCH","H_69_EPOCH","H_70_EPOCH","H_71_EPOCH","H_72_EPOCH","H_73_EPOCH","H_74_EPOCH","H_75_EPOCH","H_76_EPOCH","H_77_EPOCH","H_78_EPOCH","H_79_EPOCH","H_80_EPOCH","H_81_EPOCH","H_82_EPOCH","H_83_EPOCH","H_84_EPOCH","H_85_EPOCH"] call BIS_fnc_selectRandom;
	sleep 4;
	_player = player;
			
	_player addVest _vest;
	_player addHeadgear _hat;
	_player addWeapon _pistol;
	_player addMagazine _mag;
	_player addMagazine _item;
	_player addMagazine _food;
	_player addMagazine _drink;
	_player addWeapon "EpochRadio0";
	EPOCH_playerCrypto = 5;
	
	cutText [format[" %1 \n %2 \n %3 \n %4 \n %5 \n %6 \n %7",_pistol,_mag,_item,_food,_drink,_uniform,_vest] , "PLAIN DOWN"];
	//hint format [" %1 \n %2 \n %3 \n %4 \n %5 \n %6 \n %7",_pistol,_mag,_item,_food,_drink,_uniform,_vest];
	//hint format [" Alive %1 ",EPOCH_playerAliveTime];
			
			
	_modelMale = (typeOF player == "Epoch_Male_F");
    _modelFemale = (typeOF player == "Epoch_Female_F");	
        
    if (_modelFemale) then {
        player forceAddUniform "U_BasicBodyFemale";
        };
    if (_modelMale) then {
    player forceAddUniform _uniform;
        };        	
	newPlayer = false;
} else {
hint "Standard Loadout Already Supplied";
};  	
		 

 

and my OnPlayerRespawn.sqf just contains

newPlayer = true;

 

 

 

 

EDIT:

It now works as the time alive check (EPOCH_playerAliveTime == 0) stops it from executing again after every login

But it still executes the script and the sensor everytime I login no matter where I am at.

I get the you have left the clone room hint and the standard loadout already supplied hint everytime I login so the script still executes everywhere.

The money also doesn't save that is given in the script either.

 

If anyone has any ideas please share! thanks

Link to comment
Share on other sites


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

Sleep 3;
if (newPlayer) then
			{
			_PistolANDmag = [["hgun_Pistol_heavy_02_Yorris_F","6Rnd_45ACP_Cylinder"],["hgun_Pistol_heavy_02_F","6Rnd_45ACP_Cylinder"],["hgun_Pistol_heavy_01_MRD_F","11Rnd_45ACP_Mag"],["hgun_Pistol_heavy_01_snds_F","11Rnd_45ACP_Mag"],["hgun_Pistol_heavy_01_F","11Rnd_45ACP_Mag"],["hgun_ACPC2_snds_F","9Rnd_45ACP_Mag"],["hgun_ACPC2_F","9Rnd_45ACP_Mag"],["hgun_Rook40_snds_F","16Rnd_9x21_Mag"],["hgun_Rook40_F","16Rnd_9x21_Mag"],["hgun_P07_snds_F","16Rnd_9x21_Mag"],["hgun_P07_F","16Rnd_9x21_Mag"]] call BIS_fnc_selectRandom;
			_pistol = _PistolANDmag select 0;
			_mag = _PistolANDmag select 1;
			_item = "FAK";
			_food = ["CookedSheep_EPOCH","CookedGoat_EPOCH","CookedChicken_EPOCH","CookedRabbit_EPOCH","ItemTunaCooked","ItemSeaBassCooked","ItemTroutCooked","FoodSnooter","FoodMeeps"] call BIS_fnc_selectRandom;
			_drink = ["ItemSodaRbull","ItemSodaOrangeSherbet","ItemSodaPurple","ItemSodaMocha","ItemSodaBurst","FoodWalkNSons","WhiskeyNoodle"] call BIS_fnc_selectRandom;
			_uniform = ["U_C_Scientist","U_C_Journalist","U_C_WorkerCoveralls","U_C_Poor_1","U_C_Poloshirt_redwhite","U_C_Poloshirt_salmon","U_C_Poloshirt_tricolour","U_C_Poloshirt_burgundy","U_C_Poloshirt_blue","U_C_Poloshirt_stripped"] call BIS_fnc_selectRandom;
			_vest = ["V_16_EPOCH","V_15_EPOCH","V_14_EPOCH","V_13_EPOCH","V_12_EPOCH","V_11_EPOCH","V_10_EPOCH","V_9_EPOCH","V_8_EPOCH","V_7_EPOCH","V_6_EPOCH","V_5_EPOCH","V_4_EPOCH","V_3_EPOCH","V_2_EPOCH","V_1_EPOCH"] call BIS_fnc_selectRandom;
			hint format ["Random Loadout Supplied"];
			clearWeaponCargo player;
			clearMagazineCargo player;
			player addVest _vest;
			player addWeapon _pistol;
			player addMagazine _mag;
			player addMagazine _item;
			player addMagazine _food;
			player addMagazine _drink;
			player addWeapon "EpochRadio0";
			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 _uniform;
                         };        		      	
			newPlayer = false;		
			}else{
				hint "Random Loadout Already Supplied";
			}; 

Works :) Thanks!

 

 

 

So does this fully work?  and if so is it a case of creating a file called OnPlayerRespawn.sqf and putting the above code in and then putting it in the @epochhive?  If so how do you call it when someone respawns?

 

Thanks

Link to comment
Share on other sites

So does this fully work?  and if so is it a case of creating a file called OnPlayerRespawn.sqf and putting the above code in and then putting it in the @epochhive?  If so how do you call it when someone respawns?

 

Thanks

 

 

Follow these instructions:

 

 

and just replace the loadout with whatever you want to use.

Link to comment
Share on other sites

so put this code :-

 

class Sensors
{
items=1;
class Item0
{
position[]={23599.836,3.1900001,18000.484};
a=50;
b=50;
activationBy="ANY";
repeating=1;
interruptable=1;
age="UNKNOWN";
name="cloneroomsafezone";
expCond = "(player distance cloneroomsafezone) < 50;";
expActiv="hint ""You are in the clone room"";  inSafeZone = true;";
expDesactiv="execVM ""StartingLoadout.sqf"";";
class Effects
{
};
};
};

 

In the INIt.sqf

 

create a file called StartingLodout.sqf and put the rest of the code in there and compile it all and have fun?

Link to comment
Share on other sites

Hi Darth

 

Thanks for the help.

 

It sort of fixed it, could get the admin load out but not the donator specific one. Thought it might be the player krypto check so I put my own guid into the donator specific secti9on and removed it from the admin one, however, it would not give me the load out.

 

Jaik

Link to comment
Share on other sites

Hi Darth

 

Thanks for the help.

 

It sort of fixed it, could get the admin load out but not the donator specific one. Thought it might be the player krypto check so I put my own guid into the donator specific secti9on and removed it from the admin one, however, it would not give me the load out.

 

Jaik

 

It's your steam64 id you use not guid

Link to comment
Share on other sites

so put this code :-

 

class Sensors

{

items=1;

class Item0

{

position[]={23599.836,3.1900001,18000.484};

a=50;

b=50;

activationBy="ANY";

repeating=1;

interruptable=1;

age="UNKNOWN";

name="cloneroomsafezone";

expCond = "(player distance cloneroomsafezone) < 50;";

expActiv="hint ""You are in the clone room"";  inSafeZone = true;";

expDesactiv="execVM ""StartingLoadout.sqf"";";

class Effects

{

};

};

};

 

In the INIt.sqf

 

create a file called StartingLodout.sqf and put the rest of the code in there and compile it all and have fun?

 

the sensor part goes in your mission.sqm file

Link to comment
Share on other sites

Maybe someone can help here, I have tried everything with this script and as simple as it sounds and seems its not working. I am not new to scripting either, I have worked with A2 Epoch and DayZ but both Arma 3 Scripting and A3 Epoch are new to me.

 

Question before I state my problem, does everything in your mission execute at once? 

 

My problem is no matter what kind of checks I put for this spawn loadout it always seems to execute the loadout and give you a new set of gear every time you relog no matter where you are on the map.

 

If anyone can help me or point me in the right direction that would be great.

 

Here is what I have so far...

 

*Map - Bornholm

 

(excuse the pulling of different scripts from here and there in this thread, using it to test and get working)

 

*As of now the script executes after every login not just if I am inside the clone room (which has correct coordinates)

 

*Also it states that I have left the clone room as a hint at the beginning of every time I login to the server

 

*The crypto I give with this script also seems to disappear after I relog with it

Mission.sqm (correctly placed sensor)

		class Item4 {
			position[] = {15630.2, 3.0141, 210.321};
			name = "Respawn_1";
			type = "hd_dot";
		};
	};
	class Sensors
	{
		items=1;
		class Item0
		{
			position[]={13813.836,3.1900001,6882.484};
			a=50;
			b=50;
			activationBy="ANY";
			repeating=1;
			interruptable=1;
			age="UNKNOWN";
			name="cloneroomsafezone";
			expCond = "(player distance cloneroomsafezone) < 50;";
			expActiv="hint ""You are in the clone room"";  inSafeZone = true; execVM ""random.sqf"";";
			expDesactiv="hint ""You left the clone room"";  inSafeZone = false;";
			class Effects
			{
			};
		};
	};
};

class Intro {
	addOns[] = {"bornholm"};
	addOnsAuto[] = {"bornholm"};
	randomSeed = 25982387;

 

init.sqf



if (!isDedicated) then {
	[] execVM "esc.sqf";
};

[] execVM "effect.sqf";
 

 

random.sqf

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

sleep 5;
if (isNil "inSafezone") then {
    inSafezone = false;
};
hint format [" Alive %1 | EPOCH_playerCrypto %2 ",EPOCH_playerAliveTime,EPOCH_playerCrypto];
if (newPlayer && (EPOCH_playerCrypto == 0) && (EPOCH_playerAliveTime == 0)) then
{
	waitUntil {
        inSafeZone
    };
	clearWeaponCargo player;
	clearMagazineCargo player;
	_PistolANDmag = [["hgun_Pistol_heavy_02_Yorris_F","6Rnd_45ACP_Cylinder"],["hgun_Pistol_heavy_02_F","6Rnd_45ACP_Cylinder"],["hgun_Pistol_heavy_01_MRD_F","11Rnd_45ACP_Mag"],["hgun_Pistol_heavy_01_snds_F","11Rnd_45ACP_Mag"],["hgun_Pistol_heavy_01_F","11Rnd_45ACP_Mag"],["hgun_ACPC2_snds_F","9Rnd_45ACP_Mag"],["hgun_ACPC2_F","9Rnd_45ACP_Mag"],["hgun_Rook40_snds_F","16Rnd_9x21_Mag"],["hgun_Rook40_F","16Rnd_9x21_Mag"],["hgun_P07_snds_F","16Rnd_9x21_Mag"],["hgun_P07_F","16Rnd_9x21_Mag"]] call BIS_fnc_selectRandom;
	_pistol = _PistolANDmag select 0;
	_mag = _PistolANDmag select 1;
	_item = "FAK";
	_food = ["CookedSheep_EPOCH","CookedGoat_EPOCH","CookedChicken_EPOCH","CookedRabbit_EPOCH","ItemTunaCooked","ItemSeaBassCooked","ItemTroutCooked","FoodSnooter","FoodMeeps"] call BIS_fnc_selectRandom;
	_drink = ["ItemSodaRbull","ItemSodaOrangeSherbet","ItemSodaPurple","ItemSodaMocha","ItemSodaBurst","FoodWalkNSons","WhiskeyNoodle"] call BIS_fnc_selectRandom;
	_uniform = ["U_C_Scientist","U_C_Journalist","U_C_WorkerCoveralls","U_C_Poor_1","U_C_Poloshirt_redwhite","U_C_Poloshirt_salmon","U_C_Poloshirt_tricolour","U_C_Poloshirt_burgundy","U_C_Poloshirt_blue","U_C_Poloshirt_stripped"] call BIS_fnc_selectRandom;
	_vest = ["V_1_EPOCH","V_2_EPOCH","V_3_EPOCH","V_4_EPOCH","V_5_EPOCH","V_16_EPOCH","V_1_EPOCH","V_2_EPOCH","V_3_EPOCH","V_4_EPOCH","V_5_EPOCH"] call BIS_fnc_selectRandom;
	_hat = ["H_39_EPOCH","H_40_EPOCH","H_41_EPOCH","H_42_EPOCH","H_43_EPOCH","H_44_EPOCH","H_45_EPOCH","H_46_EPOCH","H_47_EPOCH","H_48_EPOCH","H_49_EPOCH","H_50_EPOCH","H_51_EPOCH","H_52_EPOCH","H_53_EPOCH","H_54_EPOCH","H_55_EPOCH","H_56_EPOCH","H_57_EPOCH","H_58_EPOCH","H_59_EPOCH","H_60_EPOCH","H_61_EPOCH","H_62_EPOCH","H_63_EPOCH","H_64_EPOCH","H_65_EPOCH","H_66_EPOCH","H_67_EPOCH","H_68_EPOCH","H_69_EPOCH","H_70_EPOCH","H_71_EPOCH","H_72_EPOCH","H_73_EPOCH","H_74_EPOCH","H_75_EPOCH","H_76_EPOCH","H_77_EPOCH","H_78_EPOCH","H_79_EPOCH","H_80_EPOCH","H_81_EPOCH","H_82_EPOCH","H_83_EPOCH","H_84_EPOCH","H_85_EPOCH"] call BIS_fnc_selectRandom;
	sleep 4;
	_player = player;
			
	_player addVest _vest;
	_player addHeadgear _hat;
	_player addWeapon _pistol;
	_player addMagazine _mag;
	_player addMagazine _item;
	_player addMagazine _food;
	_player addMagazine _drink;
	_player addWeapon "EpochRadio0";
	EPOCH_playerCrypto = 5;
	
	cutText [format[" %1 \n %2 \n %3 \n %4 \n %5 \n %6 \n %7",_pistol,_mag,_item,_food,_drink,_uniform,_vest] , "PLAIN DOWN"];
	//hint format [" %1 \n %2 \n %3 \n %4 \n %5 \n %6 \n %7",_pistol,_mag,_item,_food,_drink,_uniform,_vest];
	//hint format [" Alive %1 ",EPOCH_playerAliveTime];
			
			
	_modelMale = (typeOF player == "Epoch_Male_F");
    _modelFemale = (typeOF player == "Epoch_Female_F");	
        
    if (_modelFemale) then {
        player forceAddUniform "U_BasicBodyFemale";
        };
    if (_modelMale) then {
    player forceAddUniform _uniform;
        };        	
	newPlayer = false;
} else {
hint "Standard Loadout Already Supplied";
};  	
		 

 

and my OnPlayerRespawn.sqf just contains

newPlayer = true;

 

 

 

 

EDIT:

It now works as the time alive check (EPOCH_playerAliveTime == 0) stops it from executing again after every login

But it still executes the script and the sensor everytime I login no matter where I am at.

I get the you have left the clone room hint and the standard loadout already supplied hint everytime I login so the script still executes everywhere.

The money also doesn't save that is given in the script either.

 

If anyone has any ideas please share! thanks

 

 

 

Got it to work! If anyone wants to see what I did, this is what I changed in my mission.sqm file..

activationBy="CIV";
			repeating=1;
			interruptable=1;
			age="UNKNOWN";
			name="cloneroomsafezone";
			expCond = "(player distance cloneroomsafezone) < 50;";
			expActiv="dome = execVM ""random.sqf""; inSafeZone = true;";
			expDesactiv="terminate dome; inSafeZone = false;";
			class Effects
			{
			}; 
Link to comment
Share on other sites

Second....

Could you elaborate on this a bit?

"In your OnPlayerRespawn.sqf (if you don't have one just place it in your mission root) put the following:

 

newPlayer = true;"

 

Where am I calling this from.... what else should be in this file?

Link to comment
Share on other sites

 

Second....

Could you elaborate on this a bit?

"In your OnPlayerRespawn.sqf (if you don't have one just place it in your mission root) put the following:

 

newPlayer = true;"

 

Where am I calling this from.... what else should be in this file?

 

Background Info:

OnPlayerRespawn.sqf <<== is a pre-defined system file, named by Bohemia Interactive. It is automagically called by the engine thus you are not manually adding & CALLing it from anywhere.

If you want to know more, you can read about this OnPlayerRespawn.sqf and others here (I like the blue ones) and here.

      

So in this case:

You need to look at your <MPmission-directory>. Do you see a "OnPlayerRespawn.sqf" file there?

If not, create a new empty text document and rename as such.

Then copy and paste the line provided above into the file. Just one single magic line. That's it. ==>       newPlayer = true;

 

Good luck!

Link to comment
Share on other sites

 

Got it to work! If anyone wants to see what I did, this is what I changed in my mission.sqm file..

activationBy="CIV";
			repeating=1;
			interruptable=1;
			age="UNKNOWN";
			name="cloneroomsafezone";
			expCond = "(player distance cloneroomsafezone) < 50;";
			expActiv="dome = execVM ""random.sqf""; inSafeZone = true;";
			expDesactiv="terminate dome; inSafeZone = false;";
			class Effects
			{
			}; 

 

Be carfeul putting inSafeZone = false; in your exit trigger.

 

Depending on how responsive the server is, if you leave the clone room and tp to one of the spawn points which is also a safezone then the safezone doesn't always reactivate when entering the new safezone.

 

Personally I removed the inSafeZone = false; from the clone room exit trigger and let it be removed when they leave the spawn area they tp to. Otherwise they can be unprotected when they enter the spawn points.

 

I have also found the triggering of a script when entering a sensor to be hit and miss on first loading the game depending on the sequence of other scripts loading in your init.sqf and onPlayerespawn.sqf. It tends to either work or not but sometimes you have to play around with the order that things load in your init until you find a combination that works (starting FuMS and IgLoad seem to have quite an impact on other scripts loading properly for example).

Link to comment
Share on other sites

Using    EPOCH_playerCrypto = 50;  on my loadout after updating epoch says its given me the crypto but it hasnt and resets back to 0 after i relog- when given by admin menu its fine - anyone else having issues with giving cryto on loadout ??

 

I don't think you can adjust your Krypto balance client side any more, either that or the syntax has altered

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
×
×
  • Create New...