Jump to content
  • 0

random starting loadout


Achmed

Question

Is there anyway to make the starting loadout random?

Woukd be configured with a list of potential items for tools, mags, sidearms, primarys and backpacks and also what chance there is for each item.

Ability to set min and max amount of tools and mags etc.

Just an idea really. Anyone know if uts already done or if possiable?

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

It should be, use the same basic method for adding in custom loadouts, which is found here: http://dayzepoch.com/forum/index.php?/topic/1855-multi-custom-load-outs/

 

But instead of making it ID based, edit server_playerLogin.sqf with something like:

switch (random 5) do {
 case 0: loadout 1;
 case 1: loadout 2;
 case 2: loadout 3;
 case 3: loadout 4;
 case 4: loadout 5;
};

Haven't actually tried it, but I don't see a reason it shouldn't work.

Link to comment
Share on other sites

  • 0

It should be, use the same basic method for adding in custom loadouts, which is found here: http://dayzepoch.com/forum/index.php?/topic/1855-multi-custom-load-outs/

 

But instead of making it ID based, edit server_playerLogin.sqf with something like:

switch (random 5) do {
 case 0: loadout 1;
 case 1: loadout 2;
 case 2: loadout 3;
 case 3: loadout 4;
 case 4: loadout 5;
};

Haven't actually tried it, but I don't see a reason it shouldn't work.

Have you gotten you way to work?

Link to comment
Share on other sites

  • 0

I got this done this probably wont work and can someone help me out on the rest?

 

diag_log("Check");
diag_log("Inventory Count: " + str(count _inventory));
if (count _inventory == 1) then {
diag_log("Inventory Select 0: " + str((_inventory select 0)));
if ( (_inventory select 0) == "PVDZE_plr_LoginRecord" ) then {
_chance = round(random 100);
diag_log ("Random chance " + str(_chance));
 
switch (true) do {
case (_chance <= 40):
{
_inventory = [["ItemHatchet_DZE","ItemFlashlight"], ["ItemPainkiller","ItemBandage","ItemBandage","ItemMorphine"]];
_backpack = ["",[[],[]],[[],[]]];
};
case (_chance <= 30):
{
_inventory = [["MeleeMachete","ItemFlashlight"], ["ItemPainkiller","ItemBandage","ItemBandage","ItemMorphine"]];
_backpack = ["DZ_Patrol_Pack_EP1",[[],[]],[[],[]]];
};
 
case (_chance <= 20):
{
_inventory = [["MeleeMachete","ItemFlashlight","ItemMap"], ["ItemPainkiller","ItemBandage","ItemBandage","ItemMorphine"]];
_backpack = ["DZ_Assault_Pack_EP1",[[],[]],[["FoodCanFrankBeans","ItemSodaPepsi"],[1,1]]];
};
 
case (_chance <= 10):
{
_inventory = [["Makarov","ItemMatchbox","ItemCompass","ItemMap","ItemWatch","ItemFlashlight"], ["8Rnd_9x18_Makarov","ItemPainkiller","ItemBandage","ItemBandage","ItemMorphine"]];
_backpack = ["DZ_TerminalPack_EP1",[[],[]],[["FoodCanFrankBeans","ItemSodaCoke"],[1,2]]];
};
 
case (_chance <= 5):
{
_inventory = [["LeeEnfield","ItemCompass","ItemMap","ItemWatch","ItemFlashlight"], ["10x_303","ItemPainkiller","ItemBandage","ItemBandage","ItemMorphine"]];
_backpack = ["DZ_ALICE_Pack_EP1",[[],[]],[["FoodSteakCooked","ItemSodaCoke"],[2,2]]];
};
 
default
{
_inventory = [["ItemHatchet_DZE","ItemFlashlight"], ["ItemPainkiller","ItemBandage","ItemBandage","ItemMorphine"]];
_backpack = ["",[[],[]],[[],[]]];
};
};
};
};
//Variables
_survival =		[0,0,0];
_isInfected =   0;
_model =		"";
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
  • Discord

×
×
  • Create New...