Jump to content
rhadamanthus79

multi custom load outs

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

 

 

 

 

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites

having same issue with the black screen.  Players that do not have their UID's inside the files go to black screens and have to disconnect reconnect. Players that have their UID's in the files get fine through 

Share this post


Link to post
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 ?

Share this post


Link to post
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?

Share this post


Link to post
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).

Share this post


Link to post
Share on other sites

I'm really new at this coding stuff. I dont want admin loadouts or donator loadouts. I just want everyone to start with a certain load out. something other that a little tiny backpack, a bandage and pain killers. 

 

can someone direct me to where i can go to get that changed?

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Advertisement
  • Supporters
  • Discord

×
×
  • Create New...