Jump to content

multi custom load outs


rhadamanthus79

Recommended Posts

ok this is a setup i made to have multiple custom load outs.

things needed: pbo manager & notepad++ & loadout attachment

 

i will try to explain this the best i can

 

 

inside your dayz_server.pbo you are going to place AGloadout.sqf inside the init folder

 

you are going to want to edit the server_functions.sqf inside the same location and add this line to the very bottom:   #include "AGloadout.sqf"

 

inside the same pbo you are going to want to go to the compile folder. you are going to want to edit the server_playerLogin.sqf

 

look for these lines:

 

if (count _this > 2) then {
dayz_players = dayz_players - [_this select 2];
};
 
right under these lines you are going to want to add this:
 
 if (_playerID in AG_epoch_top) then {
_inventory = [["NVGoggles","ItemEtool","ItemGps","M4A1_AIM_SD_camo","glock17_EP1","ItemKeyKit","ItemMatchbox"], ["17Rnd_9x19_glock17","17Rnd_9x19_glock17","17Rnd_9x19_glock17","ItemGoldBar","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","ItemBloodbag","ItemAntibiotic","ItemSodaCoke","FoodCanBakedBeans","ItemBandage","ItemBandage","ItemMorphine","ItemTinBar","ItemTinBar","PartGeneric"]];
_backpack =  ["DZ_British_ACU",[[],[]],[[],[]]]; };

 if (_playerID in AG_epoch_mid) then {
_inventory = [["NVGoggles","ItemEtool","ItemMap","bizon_silenced","ItemMatchbox"], ["64Rnd_9x19_SD_Bizon","64Rnd_9x19_SD_Bizon","64Rnd_9x19_SD_Bizon","ItemBloodbag","ItemSodaCoke","FoodCanBakedBeans","ItemBandage","ItemBandage"]];
_backpack =  ["DZ_ALICE_Pack_EP1",[[],[]],[[],[]]]; };

  if (_playerID in AG_epoch_low) then {
_inventory = [["ItemEtool","glock17_EP1","ItemMatchbox","ItemMap"], ["17Rnd_9x19_glock17","17Rnd_9x19_glock17","ItemBloodbag","ItemSodaCoke","FoodCanBakedBeans","ItemBandage","ItemBandage"]];
_backpack =  ["DZ_Patrol_Pack_EP1",[[],[]],[[],[]]]; };

 if (_playerID in AG_epoch_admin) then {
_inventory = [["ItemGPS","NVGoggles","ItemFlashlight","ItemWatch","ItemCompass","M9SD","M4A1_AIM_SD_camo","ItemMatchbox"], ["15Rnd_9x19_M9SD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","ItemBloodbag","ItemPainkiller","ItemEpinephrine","ItemAntibiotic","ItemMorphine","ItemWaterbottle","FoodCanBakedBeans"]];
_backpack =  ["DZ_LargeGunBag_EP1",[[],[]],[[],[]]]; };
there is an example of this in the loginExample.sqf
 
feel free to edit the loadouts as needed. just follow the format.
 
important under this you will see:
 
//Variables
_inventory =	[];
_backpack = 	[];
_survival =		[0,0,0];
_isInfected =   0;
_model =		"";

you are going to want to comment out or delete these 2 lines:

_inventory =	[];
_backpack = 	[];

now put the following files in your operation arrowhead folder premiumadmin.sqf, premiumtop.sqf, premiummid.sqf, premiumlow.sqf

dont forget to add some UID's in these files ( you want UID's -player ID's NOT GUID's

 

Hope this helps you

 

--ZILF form adrenaline-gaming.net

 

loadout.zip

 

 

 

 

Link to comment
Share on other sites

How would this work with a fresh spawn who has never played on the server before but has "contributed" so that he gets a premium load out? Will they spawn on the beach with the default load out that everyone else gets until they die or will it give them the proper load out based on this script?

Link to comment
Share on other sites

  • 3 weeks later...

im not a scripter, but, if u put an ELSE statment on every check ?

 

like this 

if (_playerID in AG_epoch_top) then {
_inventory = [["NVGoggles","ItemEtool","ItemGps","M4A1_AIM_SD_camo","glock17_EP1","ItemKeyKit","ItemMatchbox"], ["17Rnd_9x19_glock17","17Rnd_9x19_glock17","17Rnd_9x19_glock17","ItemGoldBar","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","ItemBloodbag","ItemAntibiotic","ItemSodaCoke","FoodCanBakedBeans","ItemBandage","ItemBandage","ItemMorphine","ItemTinBar","ItemTinBar","PartGeneric"]];
_backpack =  ["DZ_British_ACU",[[],[]],[[],[]]]; }

  else

   if (_playerID in AG_epoch_mid) then {
 _inventory = [["NVGoggles","ItemEtool","ItemMap","bizon_silenced","ItemMatchbox"],       ["64Rnd_9x19_SD_Bizon","64Rnd_9x19_SD_Bizon","64Rnd_9x19_SD_Bizon","ItemBloodbag","ItemSodaCoke","FoodCanBakedBeans","ItemBandage","ItemBandage"]];
_backpack =  ["DZ_ALICE_Pack_EP1",[[],[]],[[],[]]]; }

  else

  if (_playerID in AG_epoch_low) then {
  _inventory = [["ItemEtool","glock17_EP1","ItemMatchbox","ItemMap"], ["17Rnd_9x19_glock17","17Rnd_9x19_glock17","ItemBloodbag","ItemSodaCoke","FoodCanBakedBeans","ItemBandage","ItemBandage"]];
_backpack =  ["DZ_Patrol_Pack_EP1",[[],[]],[[],[]]]; }

  else

  if (_playerID in AG_epoch_admin) then {
  _inventory = [["ItemGPS","NVGoggles","ItemFlashlight","ItemWatch","ItemCompass","M9SD","M4A1_AIM_SD_camo","ItemMatchbox"], ["15Rnd_9x19_M9SD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","ItemBloodbag","ItemPainkiller","ItemEpinephrine","ItemAntibiotic","ItemMorphine","ItemWaterbottle","FoodCanBakedBeans"]];
_backpack =  ["DZ_LargeGunBag_EP1",[[],[]],[[],[]]]; } 

else

{
_inventory =	[];
_backpack = 	[];
};

can someone check this ?

Link to comment
Share on other sites

im not a scripter, but, if u put an ELSE statment on every check ?

 

like this 

if (_playerID in AG_epoch_top) then {
_inventory = [["NVGoggles","ItemEtool","ItemGps","M4A1_AIM_SD_camo","glock17_EP1","ItemKeyKit","ItemMatchbox"], ["17Rnd_9x19_glock17","17Rnd_9x19_glock17","17Rnd_9x19_glock17","ItemGoldBar","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","ItemBloodbag","ItemAntibiotic","ItemSodaCoke","FoodCanBakedBeans","ItemBandage","ItemBandage","ItemMorphine","ItemTinBar","ItemTinBar","PartGeneric"]];
_backpack =  ["DZ_British_ACU",[[],[]],[[],[]]]; }

  else

   if (_playerID in AG_epoch_mid) then {
 _inventory = [["NVGoggles","ItemEtool","ItemMap","bizon_silenced","ItemMatchbox"],       ["64Rnd_9x19_SD_Bizon","64Rnd_9x19_SD_Bizon","64Rnd_9x19_SD_Bizon","ItemBloodbag","ItemSodaCoke","FoodCanBakedBeans","ItemBandage","ItemBandage"]];
_backpack =  ["DZ_ALICE_Pack_EP1",[[],[]],[[],[]]]; }

  else

  if (_playerID in AG_epoch_low) then {
  _inventory = [["ItemEtool","glock17_EP1","ItemMatchbox","ItemMap"], ["17Rnd_9x19_glock17","17Rnd_9x19_glock17","ItemBloodbag","ItemSodaCoke","FoodCanBakedBeans","ItemBandage","ItemBandage"]];
_backpack =  ["DZ_Patrol_Pack_EP1",[[],[]],[[],[]]]; }

  else

  if (_playerID in AG_epoch_admin) then {
  _inventory = [["ItemGPS","NVGoggles","ItemFlashlight","ItemWatch","ItemCompass","M9SD","M4A1_AIM_SD_camo","ItemMatchbox"], ["15Rnd_9x19_M9SD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","ItemBloodbag","ItemPainkiller","ItemEpinephrine","ItemAntibiotic","ItemMorphine","ItemWaterbottle","FoodCanBakedBeans"]];
_backpack =  ["DZ_LargeGunBag_EP1",[[],[]],[[],[]]]; } 

else

{
_inventory =	[];
_backpack = 	[];
};

can someone check this ?

i am going to try and check this later.  I think the code has to read else if but im not 100% sure either.  If i have time ill try and check it both ways.  or if someone else is willing to take a stab : ) so it would look like this?

 

else if (_playerID in AG_epoch_top) then {

_inventory = [["NVGoggles","ItemEtool","ItemGps","M4A1_AIM_SD_camo","glock17_EP1","ItemKeyKit","ItemMatchbox"], ["17Rnd_9x19_glock17","17Rnd_9x19_glock17","17Rnd_9x19_glock17","ItemGoldBar","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","ItemBloodbag","ItemAntibiotic","ItemSodaCoke","FoodCanBakedBeans","ItemBandage","ItemBandage","ItemMorphine","ItemTinBar","ItemTinBar","PartGeneric"]];

_backpack =  ["DZ_British_ACU",[[],[]],[[],[]]]; }

  

  else if (_playerID in AG_epoch_mid) then {

_inventory = [["NVGoggles","ItemEtool","ItemMap","bizon_silenced","ItemMatchbox"],       ["64Rnd_9x19_SD_Bizon","64Rnd_9x19_SD_Bizon","64Rnd_9x19_SD_Bizon","ItemBloodbag","ItemSodaCoke","FoodCanBakedBeans","ItemBandage","ItemBandage"]];

_backpack =  ["DZ_ALICE_Pack_EP1",[[],[]],[[],[]]]; }

  else if

and so on?

Link to comment
Share on other sites

You can use 

if(<condition>)then{<do something>}else{<do something else>};

You can even use an array for the then statement: http://community.bistudio.com/wiki/if

 

There is no else if. Rather than nest more if then statements use switch / casehttp://community.bistudio.com/wiki/switch (is essentially the same thing as nesting and much tidier).

Link to comment
Share on other sites

DefaultMagazines = ["ItemBandage","ItemPainkiller"];
DefaultWeapons = ["ItemFlashlight"];
DefaultBackpack = "";
DefaultBackpackWeapon = "";

 

Add that to init.sqf in the config section and customize to your liking. Remember that cools like map/compass/etc are considered weapons.

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