Need Help With Custom Loadout Please

Nsomnia

New Member
This Is For Dayz Epoch 1.0.3

What I am trying to do is setup custom loadouts for donators through the mission pbo.
______________________________________________________________
Working
Step 1. Create A File In Your Mission PBO Called: custloadout.sqf
In This File Paste In:

if ((getPlayerUID player) in ["xxx","xxx"]) then {
DefaultMagazines = [];
DefaultWeapons = [];
DefaultBackpack = "";
DefaultBackpackWeapon = "";
}else {
DefaultMagazines = [];
DefaultWeapons = [];
DefaultBackpack = "";
DefaultBackpackWeapon = "";
};

Step 2. In Mission Init.sqf At The Bottom Paste In

//CustomLoadout
[] execVM "custloadout.sqf";
________________________________________________________________
What I am having trouble with is having multiple sections of:

if ((getPlayerUID player) in ["xxx","xxx"]) then {
DefaultMagazines = [];
DefaultWeapons = [];
DefaultBackpack = "";
DefaultBackpackWeapon = "";
________________________________________________________________
Not Working Missing Symbols? Help Please
Example:

if ((getPlayerUID player) in ["xxx","xxx"]) then {
DefaultMagazines = [];
DefaultWeapons = [];
DefaultBackpack = "";
DefaultBackpackWeapon = "";
if ((getPlayerUID player) in ["xxx","xxx"]) then {
DefaultMagazines = [];
DefaultWeapons = [];
DefaultBackpack = "";
DefaultBackpackWeapon = "";
}else {
DefaultMagazines = [];
DefaultWeapons = [];
DefaultBackpack = "";
DefaultBackpackWeapon = "";
};
________________________________________________________________
 
Think of it this way....

If (PlayerID matches this) then we do {
This code here
} else it doesnt match {
So we do this code here
}; close bracket

So really you would have an array of playerID's, then do a check if the player is in the list to give the loadouts, something like this:

Code:
_loadList = ["1","2"];
_lpID = getPlayerUID player;
 
if (("1" = _lpID) && (_lpID in _loadList)) then {
    First loadout
};
 
if (("2" = _lpID) && (_lpID in _loadList)) then {
    Second loadout
};
 
if (!(_lpID in _loadList)) then {
    Default Loadout
};
 
Think of it this way....

If (PlayerID matches this) then we do {
This code here
} else it doesnt match {
So we do this code here
}; close bracket

So really you would have an array of playerID's, then do a check if the player is in the list to give the loadouts, something like this:

Code:
_loadList = ["1","2"];
_lpID = getPlayerUID player;
 
if (("1" = _lpID) && (_lpID in _loadList)) then {
    First loadout
};
 
if (("2" = _lpID) && (_lpID in _loadList)) then {
    Second loadout
};
 
if (!(_lpID in _loadList)) then {
    Default Loadout
};


I am still lost lol would I do something like:

_loadList = ["1","2"];
_lpID = getPlayerUID player;

if (("1" = _lpID) && (_lpID in _loadList)) then {
DefaultMagazines = [];
DefaultWeapons = [];
DefaultBackpack = "";
DefaultBackpackWeapon = "";
};

I am kind of new here, what I cant understand about this is, how/where is the loadout determined
and where exactly would the ID's go in this method
could you give an example?
 
Would It Be This?
_loadList = ["123","124"]; //list all player ID's here?
_lpID = getPlayerUID player;

if (("123" = _lpID) && (_lpID in _loadList)) then { //specific player id here?
DefaultMagazines = [];
DefaultWeapons = [];
DefaultBackpack = "";
DefaultBackpackWeapon = ""; };

if (("124" = _lpID) && (_lpID in _loadList)) then {

DefaultMagazines = [];
DefaultWeapons = [];
DefaultBackpack = "";

DefaultBackpackWeapon = "";
};

if (!(_lpID in _loadList)) then {

DefaultMagazines = [];
DefaultWeapons = [];
DefaultBackpack = "";
DefaultBackpackWeapon = "";


};
 
The last one should work, yes.

I tried it and couldnt get it to work, maybe because I am trying to do this for 11+ people each with there own block of code?

in this line:
if (("124" = _lpID) && (_lpID in _loadList)) then {

Could I do this:
if (("124","125","126" = _lpID) && (_lpID in _loadList)) then {

Or Do I need separate blocks of code for each one,

when I tried what I posted on post#4, none of it worked, even the default loadout did not work
 
Idk, never used pastebin?

I have a teamspeak server i could upload it to and you download

Or if you have one i could do it there

Or lol, how would i go about the pastebin thing
 
Tried To Shorten This By Removing A Lot Of The Gear

xx = the uids Below the line is entire sqf file contents
___________________________________________________________________________

_loadList = ["xx","xx","xx","xx","xx","xx","xx","xx","xx","xx","xx"];
_lpID = getPlayerUID player;

if (("xx" = _lpID) && (_lpID in _loadList)) then {
DefaultMagazines = ["5Rnd_127x99_as50"];
DefaultWeapons = ["BAF_AS50_scoped","ItemWatch"];
DefaultBackpack = "DZ_LargeGunBag_EP1";
DefaultBackpackWeapon = "";
};

if (("xx" = _lpID) && (_lpID in _loadList)) then {
DefaultMagazines = ["5Rnd_127x99_as50"];
DefaultWeapons = ["BAF_AS50_scoped","ItemWatch"];
DefaultBackpack = "DZ_LargeGunBag_EP1";
DefaultBackpackWeapon = "";
};

if (("xx" = _lpID) && (_lpID in _loadList)) then {
DefaultMagazines = ["5x_22_LR_17_HMR"];
DefaultWeapons = ["huntingrifle","M9SD"];
DefaultBackpack = "DZ_ALICE_Pack_EP1";
DefaultBackpackWeapon = "";
};

if (("xx" = _lpID) && (_lpID in _loadList)) then {
DefaultMagazines = ["5x_22_LR_17_HMR"];
DefaultWeapons = ["huntingrifle","M9SD"];
DefaultBackpack = "DZ_ALICE_Pack_EP1";
DefaultBackpackWeapon = "";
};

if (("xx" = _lpID) && (_lpID in _loadList)) then {
DefaultMagazines = ["5x_22_LR_17_HMR"];
DefaultWeapons = ["huntingrifle","M9SD"];
DefaultBackpack = "DZ_ALICE_Pack_EP1";
DefaultBackpackWeapon = "";
};

if (("xx" = _lpID) && (_lpID in _loadList)) then {
DefaultMagazines = ["5x_22_LR_17_HMR"];
DefaultWeapons = ["huntingrifle"];
DefaultBackpack = "DZ_ALICE_Pack_EP1";
DefaultBackpackWeapon = "";
};

if (("xx" = _lpID) && (_lpID in _loadList)) then {
DefaultMagazines = ["ItemAntibiotic"];
DefaultWeapons = ["M9SD","NVGoggles"];
DefaultBackpack = "DZ_ALICE_Pack_EP1";
DefaultBackpackWeapon = "";
};

if (("xx" = _lpID) && (_lpID in _loadList)) then {
DefaultMagazines = ["ItemAntibiotic"];
DefaultWeapons = ["M9SD","NVGoggles"];
DefaultBackpack = "DZ_ALICE_Pack_EP1";
DefaultBackpackWeapon = "";
};

if (("xx" = _lpID) && (_lpID in _loadList)) then {
DefaultMagazines = ["ItemAntibiotic"];
DefaultWeapons = ["M9SD","NVGoggles"];
DefaultBackpack = "DZ_ALICE_Pack_EP1";
DefaultBackpackWeapon = "";
};

if (("xx" = _lpID) && (_lpID in _loadList)) then {
DefaultMagazines = ["ItemAntibiotic"];
DefaultWeapons = ["M9SD","NVGoggles"];
DefaultBackpack = "DZ_ALICE_Pack_EP1";
DefaultBackpackWeapon = "";
};

if (("xx" = _lpID) && (_lpID in _loadList)) then {
DefaultMagazines = ["ItemAntibiotic"];
DefaultWeapons = ["M9SD","NVGoggles"];
DefaultBackpack = "DZ_ALICE_Pack_EP1";
DefaultBackpackWeapon = "";
};

if (!(_lpID in _loadList)) then {
DefaultMagazines = ["ItemMorphine"];
DefaultWeapons = ["revolver_EP1"];
DefaultBackpack = "DZ_TerminalPack_EP1";
DefaultBackpackWeapon = "";
};
 
I tried it and couldnt get it to work, maybe because I am trying to do this for 11+ people each with there own block of code?

in this line:
if (("124" = _lpID) && (_lpID in _loadList)) then {

Could I do this:
if (("124","125","126" = _lpID) && (_lpID in _loadList)) then {

Or Do I need separate blocks of code for each one,

when I tried what I posted on post#4, none of it worked, even the default loadout did not work

To do multiple to one loadout do:
Code:
if ((_lpID in ["0","1","2"]) && (_lpID in _loadList)) then {

When you see ["0","1","2","etc"] it is an array.
 
Making progress, I changed

if (("1" = _lpID) && (_lpID in _loadList)) then {

To

if ((_lpID in ["0","1","2"]) && (_lpID in _loadList)) then {
And Now It Gave Me My Loadout Just Have To Test With Others
Problem I have had before when I had it semi working, is it would give the first block of code
but every one else would get the default loadout
 
Its coded so that if the player doesn't have their name in the ID list at the top, they should get the default.
 
BTW, to use pastebin....

Paste in your code, submit it, and then post the link to the page it sends you to.
 
Back
Top