Jump to content

Custom Loadouts for Admins and Regular Players


MisterT

Recommended Posts

After 2 respawns keep duping items, in my server it is parashute, if in server are 30 players and they die every 5 minutes after 1 hout spawn box lagging cose there is tons of parashute of the ground

 

 

That's why I did it the way I have.  Look at the first line of the code I'm using:

if (EPOCH_playerCrypto == 0) then

  Part of the loadout script is that it gives players 100 Crypto, shown here:

EPOCH_playerCrypto = 100;

So a player spawns/respawns, goes up to the box to get a loadout, and they are also given 100 Crypto.  Once they get the loadout and the Crypto, because of the first line of code where it check their Crypto amount, they cannot get a loadout again until their next spawn event.  This prevents box hoarding and keeps the spawn box nice and tidy.   ;)

Link to comment
Share on other sites

hi

 

could you tell me that it is the BE filter for this:

 

 

28.02.2015 17:52:32: Laurent (***************) 5************************************ - #47 "arWeaponCargo player;

clearMagazineCargo player;
player forceAddUniform "U_OG_Guerilla2_3";
player addHeadGear "H_11_EPOCH";

 

thanks

Link to comment
Share on other sites

I have this error:

 

28.02.2015 20:24:32: Laurent (*****************) **************************************e - #26 "apon "Rangefinder";

player addWeapon "ItemCompass";
 
player addItemToVest "optic_SOS";
player addItemToVest "optic_Arco";


I do not know if it is correct.
I added in my ca script.txt

 

 

7 addHeadGear !"player forceAddUniform \"H_11_EPOCH\";"
7 forceAddUniform !"player forceAddUniform \"U_OG_Guerilla2_3\";"
7 addVest !="player addVest \"V_TacVest_camo\";"
7 additemtovest  !="player additemtovest \"optic_SOS\";" !="player additemtovest \"optic_Arco\";" !=player additemtovest \"scam_epoch\";" !="player additemtovest \"ItemSodaRbull\";"
7 addWeapon !="player addWeapon \"hgun_Pistol_heavy_01_F\";" !="player addWeapon \"ItemWatch\";" !=player addWeapon \"M14Grn_EPOCH\";" !="player addWeapon \"EpochRadio0\";" !=player addWeapon \"ItemGPS\";" !="player addWeapon \"Rangefinder\";" !=player addWeapon \"ItemCompass\";"
 

 

thanks

Link to comment
Share on other sites

That's why I did it the way I have.  Look at the first line of the code I'm using:

if (EPOCH_playerCrypto == 0) then

  Part of the loadout script is that it gives players 100 Crypto, shown here:

EPOCH_playerCrypto = 100;

So a player spawns/respawns, goes up to the box to get a loadout, and they are also given 100 Crypto.  Once they get the loadout and the Crypto, because of the first line of code where it check their Crypto amount, they cannot get a loadout again until their next spawn event.  This prevents box hoarding and keeps the spawn box nice and tidy.   ;)

I have this running on my server, runs great but I would like to implement your crypto 0 line.. How would i apply it the custom loadout? 

 

            if (getPlayerUID player in ["xxxxxxxxxxxxxxxxx","xxxxxxxxxxxxxxxxx","xxxxxxxxxxxxxxxxx","xxxxxxxxxxxxxxxxx","xxxxxxxxxxxxxxxxx","xxxxxxxxxxxxxxxxx","xxxxxxxxxxxxxxxxx","xxxxxxxxxxxxxxxxx","xxxxxxxxxxxxxxxxx"]) then {

 
hint format ["Custom Loadout Supplied"]; 
       clearWeaponCargo player;
       clearMagazineCargo player;
       removeBackpackGlobal player;
 
_PistolANDmag = [["hgun_Rook40_snds_F","16Rnd_9x21_Mag"],["hgun_P07_snds_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_O_GhillieSuit";
_vest = ["V_F41_EPOCH","V_41_EPOCH"] call BIS_fnc_selectRandom;
hint format [" %1 \n %2 \n %3 \n %4 \n %5 \n %6 \n %7",_pistol,_mag,_item,_food,_drink,_uniform,_vest];
player addVest _vest;
player addWeapon _pistol;
player addMagazine _mag;
player addMagazine _item;
player addMagazine _food;
player addMagazine _drink;
player addMagazine "16Rnd_9x21_Mag";
player addMagazine "16Rnd_9x21_Mag";
player addWeapon "EpochRadio0";
            player addWeapon "NVG_EPOCH";
            player addWeapon "Rangefinder";
       player addWeapon "ItemWatch";
player addWeapon "ItemCompass";
player addWeapon "ItemGPS";
player addBackpack "B_Kitbag_cbr";
player forceAddUniform _uniform;
            EPOCH_playerEnergy = 2500;
EPOCH_playerCrypto = 100;
            hint "Custom Loadout Already Supplied";
            } else {
hint format ["Standard Loadout Supplied"];
           clearWeaponCargo player;
           clearMagazineCargo player;
           removeBackpackGlobal player;
_PistolANDmag = [["hgun_Rook40_F","16Rnd_9x21_Mag"],["hgun_P07_F","16Rnd_9x21_Mag"]] call BIS_fnc_selectRandom;
_pistol = _PistolANDmag select 0;
_mag = _PistolANDmag select 1;
            _item = "";
_food = "";
_drink = "";
            _uniform = ["U_C_Driver_4","U_C_Driver_3","U_C_Driver_2","U_C_Driver_1","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_F41_EPOCH","V_41_EPOCH"] call BIS_fnc_selectRandom;
hint format [" %1 \n %2 \n %3 \n %4 \n %5 \n %6 \n %7",_pistol,_mag,_item,_food,_drink,_uniform,_vest];
player addVest _vest;
player addWeapon _pistol;
player addMagazine _mag;
player addMagazine _item;
player addMagazine _food;
player addMagazine _drink;
player addWeapon "EpochRadio0"; 
       player addWeapon "ItemWatch";
player addWeapon "ItemCompass";
EPOCH_playerEnergy = 500;
EPOCH_playerCrypto = 100;
player addBackpack "B_parachute";
_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;
            };  
hint "Standard Loadout Already Supplied";

            };

Link to comment
Share on other sites

I have this running on my server, runs great but I would like to implement your crypto 0 line.. How would i apply it the custom loadout? 

 

            if (getPlayerUID player in ["xxxxxxxxxxxxxxxxx","xxxxxxxxxxxxxxxxx","xxxxxxxxxxxxxxxxx","xxxxxxxxxxxxxxxxx","xxxxxxxxxxxxxxxxx","xxxxxxxxxxxxxxxxx","xxxxxxxxxxxxxxxxx","xxxxxxxxxxxxxxxxx","xxxxxxxxxxxxxxxxx"]) then {

 
hint format ["Custom Loadout Supplied"]; 
       clearWeaponCargo player;
       clearMagazineCargo player;
       removeBackpackGlobal player;
 
_PistolANDmag = [["hgun_Rook40_snds_F","16Rnd_9x21_Mag"],["hgun_P07_snds_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_O_GhillieSuit";
_vest = ["V_F41_EPOCH","V_41_EPOCH"] call BIS_fnc_selectRandom;
hint format [" %1 \n %2 \n %3 \n %4 \n %5 \n %6 \n %7",_pistol,_mag,_item,_food,_drink,_uniform,_vest];
player addVest _vest;
player addWeapon _pistol;
player addMagazine _mag;
player addMagazine _item;
player addMagazine _food;
player addMagazine _drink;
player addMagazine "16Rnd_9x21_Mag";
player addMagazine "16Rnd_9x21_Mag";
player addWeapon "EpochRadio0";
            player addWeapon "NVG_EPOCH";
            player addWeapon "Rangefinder";
       player addWeapon "ItemWatch";
player addWeapon "ItemCompass";
player addWeapon "ItemGPS";
player addBackpack "B_Kitbag_cbr";
player forceAddUniform _uniform;
            EPOCH_playerEnergy = 2500;
EPOCH_playerCrypto = 100;
            hint "Custom Loadout Already Supplied";
            } else {
hint format ["Standard Loadout Supplied"];
           clearWeaponCargo player;
           clearMagazineCargo player;
           removeBackpackGlobal player;
_PistolANDmag = [["hgun_Rook40_F","16Rnd_9x21_Mag"],["hgun_P07_F","16Rnd_9x21_Mag"]] call BIS_fnc_selectRandom;
_pistol = _PistolANDmag select 0;
_mag = _PistolANDmag select 1;
            _item = "";
_food = "";
_drink = "";
            _uniform = ["U_C_Driver_4","U_C_Driver_3","U_C_Driver_2","U_C_Driver_1","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_F41_EPOCH","V_41_EPOCH"] call BIS_fnc_selectRandom;
hint format [" %1 \n %2 \n %3 \n %4 \n %5 \n %6 \n %7",_pistol,_mag,_item,_food,_drink,_uniform,_vest];
player addVest _vest;
player addWeapon _pistol;
player addMagazine _mag;
player addMagazine _item;
player addMagazine _food;
player addMagazine _drink;
player addWeapon "EpochRadio0"; 
       player addWeapon "ItemWatch";
player addWeapon "ItemCompass";
EPOCH_playerEnergy = 500;
EPOCH_playerCrypto = 100;
player addBackpack "B_parachute";
_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;
            };  
hint "Standard Loadout Already Supplied";

            };

 

 

Try this:

 

if (EPOCH_playerCrypto == 0) && if (getPlayerUID player in ["xxxxxxxxxxxxxxxxx","xxxxxxxxxxxxxxxxx","xxxxxxxxxxxxxxxxx","xxxxxxxxxxxxxxxxx","xxxxxxxxxxxxxxxxx","xxxxxxxxxxxxxxxxx","xxxxxxxxxxxxxxxxx","xxxxxxxxxxxxxxxxx","xxxxxxxxxxxxxxxxx"]) then {
 

       clearWeaponCargo player;
       clearMagazineCargo player;
       removeBackpackGlobal player;
 
		_PistolANDmag = [["hgun_Rook40_snds_F","16Rnd_9x21_Mag"],["hgun_P07_snds_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_O_GhillieSuit";
		_vest = ["V_F41_EPOCH","V_41_EPOCH"] call BIS_fnc_selectRandom;
		player addVest _vest;
		player addWeapon _pistol;
		player addMagazine _mag;
		player addMagazine _item;
		player addMagazine _food;
		player addMagazine _drink;
		player addMagazine "16Rnd_9x21_Mag";
		player addMagazine "16Rnd_9x21_Mag";
		player addWeapon "EpochRadio0";
		player addWeapon "NVG_EPOCH";
        player addWeapon "Rangefinder";
		player addWeapon "ItemWatch";
		player addWeapon "ItemCompass";
		player addWeapon "ItemGPS";
		player addBackpack "B_Kitbag_cbr";
		player forceAddUniform _uniform;
        EPOCH_playerEnergy = 2500;
		EPOCH_playerCrypto = 100;
       

	   hint "Admin Loadout Supplied";
       } else {
	   
	   hint "Admin Loadout Already Supplied";
	   
	   };
	   
	   
if (EPOCH_playerCrypto == 0) then {
		
           clearWeaponCargo player;
           clearMagazineCargo player;
           removeBackpackGlobal player;
			_PistolANDmag = [["hgun_Rook40_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_Driver_4","U_C_Driver_3","U_C_Driver_2","U_C_Driver_1","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;
			player addVest _vest;
			player addWeapon _pistol;
			player addMagazine _mag;
			player addMagazine _item;
			player addMagazine _food;
			player addMagazine _drink;
			player addWeapon "EpochRadio0"; 
			player addWeapon "ItemWatch";
			player addWeapon "ItemCompass";
			EPOCH_playerEnergy = 500;
			EPOCH_playerCrypto = 100;
			player addBackpack "B_parachute";
			_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;
            };  
			hint "Standard Loadout Supplied";
			
			} else {
			hint "Standard Loadout Already Supplied";
            };

 

 

I haven't tested this but I think it will work.  The only thing I'm shaky on is whether that's the proper way to handle two separate 'if' statements in the same script.  

Link to comment
Share on other sites

good morning
 
it's good I have no restrictions.
but when a normal respawn player he respawn with his weapon.
but when an admin he just respawn uniform and vest. it has no weapons , magazine, item
 
I do not know that I made mistake
 
my loadout.sqf:

if (!isServer) then {
waitUntil {!isNull player};
waitUntil {player == player};

while {true} do {
_player = player;
player addEventHandler ["Respawn", {
if (getPlayerUID player in ["****************"]) then {
player forceAddUniform "U_OG_Guerilla2_3";
player addHeadGear "H_11_EPOCH";
player addVest "V_26_EPOCH";
player addWeapon !"M14Grn_EPOCH";
player addWeapon !"EpochRa dio0";
player addWeapon !"ItemGPS";
player addWeapon !"Rangefinder";
player addWeapon !"ItemCompass";

player addItemToVest !"optic_SOS";
player addItemToVest !"optic_Arco";
player addItemToVest !"scam_epoch";
player addItemToVest !"scam_epoch";
player addItemToVest !"ItemSodaRbull";
player addItemToVest !"ItemSodaRbull";

player addMagazines ["20rnd_762x51_mag", 5];
player addMagazines ["energypacklg", 2];
player addMagazines ["handgrenade", 6];
EPOCH_playerCrypto = 30000;
} else {
player addWeapon "EpochRadio0";
player addWeapon !"hgun_Pistol_heavy_01_F";
player addMagazine "11Rnd_45ACP_Mag";
EPOCH_playerCrypto = 100;
};
}];
waitUntil {_player != player};
};
};

 
thanks
Link to comment
Share on other sites

Here's mine.  Works on new spawns and respawns.  Also provides a random, dynamic loadout regardless of whether the player is an admin or regular player.  It makes it more fair for everyone.

 

if (EPOCH_playerCrypto == 0) 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 ["Standard 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_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 _uniform;
                         };        		      	
			
		
			}else{
				hint "Standard Loadout Already Supplied";
			}; 

 

 

I use it in conjunction with this mission.sqm addon to put a static crate in the spawn box.  When players approach it you get an option to get the loadout.  But due to the code above, you can only get a loadout once per spawn event.

 

class Vehicles
	{
		items=1;
		class Item0
		{
			position[] = {13813.3,0.305496,6887.16};
			azimut = 176.925;
			id=102;
			side="EMPTY";
			vehicle="O_supplyCrate_F";
			skill=0.60000002;
			init="clearMagazineCargoGlobal this;  clearWeaponCargoGlobal this;  clearItemCargoGlobal this; clearAllItemsFromBackpack this; clearBackpackCargoGlobal this; this addAction[""<t color='#D11313'>Grab Starting Loadout</t>"", ""addons\loadout\loadout.sqf""];";
 
		};

 

Put the above code right under your markers and you're all set.  The listed crate coords are for Bornholm.  Those would need changed if you use this on any other map.

 

 

Sorry...I've been banging head against a brick wall recently and seem to have forgotten ...words.

 

Where am I placing these additions? which files and.. stuff.

Link to comment
Share on other sites

You should copy the code from my first spoiler and paste it into Notepad++, then save it as "loadout.sqf".  Then put it in your mission file in a location of your choice.  Past that, you can do it a couple different ways.  You can either just call the loadout.sqf from your mission init.sqf and then players will be given the loadout automatically on spawn or respawn.  Or you can do it a little fancier like I did a couple pages back with the crate placed in the spawn building.  Pay close attention to the coords of the crate though, as it will vary from map to map.  The ones I posted are for Bornholm I think.  

Link to comment
Share on other sites

hi
 
I need your help.
 
where I place the restrictions in script.txt for that?

 

addHeadGear player "H_11_EPOCH";

addBackpack player "B_Carryall_oli";
addVest player "V_PlateCarrierH_CTRG";
addWeapon player "Rangefinder";
addWeapon player "ItemCompass";
 
addItemToVest player "optic_Nightstalker";
addItemToVest player "optic_Hamr";
player addItemToVest "muzzle_snds_B";

 

script.log :

 

 

 
player addMagazines ["20rnd_762x51_mag", 5];
player addMagazines ["energypack"
02.03.2015 18:05:18: blazer(****************) ************************************* - #24 "SodaRbull";
player addItemToVest "ItemSodaRbull";
 
player addMagazines ["20rnd_762x51_mag", 5];
player addMagazines ["energypack"
02.03.2015 18:26:18: blazer (*******************) ********************************* - #24 "tic_Hamr";
player addItemToVest "muzzle_snds_B";
 
 
player addMagazines ["20rnd_762x51_mag", 5];
EPOCH_playerCrypto = 2000;

 

i try to add to line "7 additem" but nothing

Link to comment
Share on other sites

You should copy the code from my first spoiler and paste it into Notepad++, then save it as "loadout.sqf".  Then put it in your mission file in a location of your choice.  Past that, you can do it a couple different ways.  You can either just call the loadout.sqf from your mission init.sqf and then players will be given the loadout automatically on spawn or respawn.  Or you can do it a little fancier like I did a couple pages back with the crate placed in the spawn building.  Pay close attention to the coords of the crate though, as it will vary from map to map.  The ones I posted are for Bornholm I think.  

 

Fantastic Darth thank you.

 

Noob question incoming....

 

Do I call it like so? :

 

[] execVM "custom\loadout.sqf";

Link to comment
Share on other sites

Try this:

 

if (EPOCH_playerCrypto == 0) && if (getPlayerUID player in ["xxxxxxxxxxxxxxxxx","xxxxxxxxxxxxxxxxx","xxxxxxxxxxxxxxxxx","xxxxxxxxxxxxxxxxx","xxxxxxxxxxxxxxxxx","xxxxxxxxxxxxxxxxx","xxxxxxxxxxxxxxxxx","xxxxxxxxxxxxxxxxx","xxxxxxxxxxxxxxxxx]) then {
 

       clearWeaponCargo player;
       clearMagazineCargo player;
       removeBackpackGlobal player;
 
		_PistolANDmag = [["hgun_Rook40_snds_F","16Rnd_9x21_Mag"],["hgun_P07_snds_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_O_GhillieSuit";
		_vest = ["V_F41_EPOCH","V_41_EPOCH"] call BIS_fnc_selectRandom;
		player addVest _vest;
		player addWeapon _pistol;
		player addMagazine _mag;
		player addMagazine _item;
		player addMagazine _food;
		player addMagazine _drink;
		player addMagazine "16Rnd_9x21_Mag";
		player addMagazine "16Rnd_9x21_Mag";
		player addWeapon "EpochRadio0";
		player addWeapon "NVG_EPOCH";
        player addWeapon "Rangefinder";
		player addWeapon "ItemWatch";
		player addWeapon "ItemCompass";
		player addWeapon "ItemGPS";
		player addBackpack "B_Kitbag_cbr";
		player forceAddUniform _uniform;
        EPOCH_playerEnergy = 2500;
		EPOCH_playerCrypto = 100;
       

	   hint "Admin Loadout Supplied";
       } else {
	   
	   hint "Admin Loadout Already Supplied";
	   
	   };
	   
	   
if (EPOCH_playerCrypto == 0) then {
		
           clearWeaponCargo player;
           clearMagazineCargo player;
           removeBackpackGlobal player;
			_PistolANDmag = [["hgun_Rook40_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_Driver_4","U_C_Driver_3","U_C_Driver_2","U_C_Driver_1","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;
			player addVest _vest;
			player addWeapon _pistol;
			player addMagazine _mag;
			player addMagazine _item;
			player addMagazine _food;
			player addMagazine _drink;
			player addWeapon "EpochRadio0"; 
			player addWeapon "ItemWatch";
			player addWeapon "ItemCompass";
			EPOCH_playerEnergy = 500;
			EPOCH_playerCrypto = 100;
			player addBackpack "B_parachute";
			_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;
            };  
			hint "Standard Loadout Supplied";
			
			} else {
			hint "Standard Loadout Already Supplied";
            };

 

 

I haven't tested this but I think it will work.  The only thing I'm shaky on is whether that's the proper way to handle two separate 'if' statements in the same script.

It worked for else but still no go for the players with custom loadout. I'll keep looking into it .

Reason I want this to work is to prevent players with custom loadout from dropping the backpack with the items and going right back to the box to re supply.

Link to comment
Share on other sites

If you don't have to have the unique loadout for admins I'd suggest going a page or two back and trying out my original one. I'm on my phone or I'd give you the exact code. It correctly implements the crypto check so the loadout can only be given once.

Link to comment
Share on other sites

How can i modify this script for checking not the users ID but his name?

Is there a "getPlayerName" comand or something like this?

Not really a good idea as people can just change their name, although the server does append a number if more than one person with the same name connects.

Link to comment
Share on other sites

Post up your server and client RPT files and let's take a look. Don't forget to use spoiler tags! Lol

I didn't get anything in the RPT and I don't know where to look for the client side.

It did however take 4 manual restarts after back tracking the script addition before players could rejoin.

IF someone could tell me where to get the client side RPT I'll re-add the script and try again.

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...