Jump to content
  • 0

[TUTORIAL] Custom Starting Loadout and Admin/Mod/Donator Loadouts (w/ UIDs)


mysticviperx

Question

So I have been getting a lot of help from here with setting up my server, so I figured I would start making Tutorials on what I have learned.

 

As follows are the instructions to change the starting gear from the default "bandage/painkiller/flashlight" to what ever you want, and how to set up custom gear for different users based on their UIDs. This is not completely my work, some came from Axeman and AsianKid.

 

Original Post

 

Setting Up the Default Load-out (no custom loadouts)

 

To start, this is tested on 1.0.2.4-5, and uses variables that Epoch Devs added to the Server Code.

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

DefaultMagazines is for any item you place in your primary(food, ammo, parts, money) or secondary(bandages, clips, m203 rounds) inventory.

DefaultWeapons is for any guns/rifles or kit(hatchet, map, Bbnoculars, NVGs) items.

DefaultBackpack is as it would sound, the pack you start out with.

 

You will also see DefaultBackpackWeapon = ""; in my loadout script, I assume it adds items to your back pack, but I don't know its limitations, if I can use guns and ammo.

 

Inserting it into your code is easy. Open the init.sqf in your mission folder or mission.pbo.

 

At about line 20 of a stock Epoch init.sqf file you will find this:

// DayZ Epoch config
spawnShoremode = 1; // Default = 1 (on shore)
spawnArea= 1500; // Default = 1500
MaxHeliCrashes= 5; // Default = 5
MaxVehicleLimit = 300; // Default = 50
MaxDynamicDebris = 500; // Default = 100
dayz_MapArea = 14000; // Default = 10000
dayz_maxLocalZombies = 30; // Default = 30 

Below this, add the following:

//Default Loadout
DefaultMagazines = ["ItemBandage","ItemBandage","17Rnd_9x19_glock17","17Rnd_9x19_glock17","ItemMorphine","ItemPainkiller","ItemWaterbottleBoiled","FoodSteakCooked"];
DefaultWeapons = ["glock17_EP1","ItemFlashlight","ItemHatchet"];
DefaultBackpack = "DZ_Patrol_Pack_EP1";
DefaultBackpackWeapon = "";

Here I have configured the default load-out to be a G17 and 2 clips, 2 bandages, one Morphine, Painkillers, Clean Water, Cooked Steak, a Flashlight and Hatchet. You can change the variables your self to what would be best for your server, including removing everything so players don't even get the stock dayz load-out.

 

Custom Load-Outs (includes default load-out)

 

But, you want even more controls, like load-outs for donators or admins. Thats easy, instead of the above we are going to put all the settings in a loadout.sqf and save that to a "Scripts" folder in our mission folder or mission.pbo.

 

First, create a new folder in the Mission folder or PBO named Scripts.

Then Create a new text document in that folder called "loadout.sqf", is will warn you that you are changing the file type, thats ok.

 

Copy this code into your new lodout.sqf:

//Default Loadout
DefaultMagazines = ["ItemBandage","ItemBandage","17Rnd_9x19_glock17","17Rnd_9x19_glock17","ItemMorphine","ItemPainkiller","ItemWaterbottleBoiled","FoodSteakCooked"];
DefaultWeapons = ["glock17_EP1","ItemFlashlight","ItemHatchet"];
DefaultBackpack = "DZ_Patrol_Pack_EP1";
DefaultBackpackWeapon = "";

//Admin Loadout
if ((getPlayerUID player) in ["12345678","98765432"]) then {  //Admins: Nobody, Somebody
	DefaultMagazines = ["ItemBandage","ItemBandage","ItemBandage","ItemBandage","17Rnd_9x19_glock17","17Rnd_9x19_glock17","ItemMorphine","ItemPainkiller","ItemBloodbag","ItemWaterbottleBoiled","ItemWaterbottleBoiled","FoodSteakCooked","20Rnd_B_AA12_74Slug","20Rnd_B_AA12_Pellets","20Rnd_B_AA12_Pellets","ItemGoldBar10oz"];
	DefaultWeapons = ["glock17_EP1","AA12_PMC","Binocular_Vector","NVGoggles","ItemMap","ItemCompass","ItemGPS","ItemWatch","ItemKnife","Itemtoolbox","ItemCrowbar","Itemetool","ItemHatchet"];
	DefaultBackpack = "DZ_LargeGunBag_EP1";
	DefaultBackpackWeapon = "";
	};

//Moderator Loadout
if ((getPlayerUID player) in ["14725836"]) then {   //Moderators: ThatOtherGuy
	DefaultMagazines = ["ItemBandage","ItemBandage","ItemBandage","ItemBandage","17Rnd_9x19_glock17","17Rnd_9x19_glock17","ItemMorphine","ItemPainkiller","ItemBloodbag","ItemWaterbottleBoiled","ItemWaterbottleBoiled","FoodSteakCooked","8Rnd_B_Saiga12_Pellets","8Rnd_B_Saiga12_Pellets","8Rnd_B_Saiga12_74Slug","ItemGoldBar10oz"];
	DefaultWeapons = ["glock17_EP1","Saiga12K","Binocular_Vector","NVGoggles","ItemMap","Itemtoolbox"];
	DefaultBackpack = "DZ_Backpack_EP1";
	DefaultBackpackWeapon = "";
	};

//Pro-Donator Loadout
if ((getPlayerUID player) in ["96385274"]) then {  //Pro-Donators: MoneyBags
	DefaultMagazines = ["ItemBandage","ItemBandage","ItemBandage","ItemBandage","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","ItemMorphine","ItemPainkiller","ItemBloodbag","ItemWaterbottleBoiled","ItemWaterbottleBoiled","FoodSteakCooked","8Rnd_B_Beneli_Pellets","8Rnd_B_Beneli_Pellets","8Rnd_B_Beneli_74Slug","ItemGoldBar10oz"];
	DefaultWeapons = ["M9SD","Remington870_lamp","Binocular","ItemMap","ItemCompass","ItemFlashlightRed","ItemKnife","ItemMatchbox","ItemHatchet"];
	DefaultBackpack = "DZ_GunBag_EP1";
	DefaultBackpackWeapon = "";
	};

//Donator Loadout
if ((getPlayerUID player) in ["456789123"]) then {  //Donators: Nobody
	DefaultMagazines = ["ItemBandage","ItemBandage","ItemBandage","ItemBandage","ItemMorphine","ItemPainkiller","ItemGoldBar","15Rnd_W1866_Slug","15Rnd_W1866_Slug"];
	DefaultWeapons = ["glock17_EP1","Winchester1866","ItemMap","ItemFlashlightRed","ItemHatchet"];
	DefaultBackpack = "DZ_ALICE_Pack_EP1";
	DefaultBackpackWeapon = "";
	};

Hit save then start looking it over. Here we set the default loadout, then we check to see if the player is anyone we know from admins to donators, and set their loadout outs accordingly.

 

You will need the Players UID you can ask them for it, or if they have been on your server and you have database access then you can find it under "player_data".

 

In the code put their UID in the same place you see the seven or eight number groupings surrounded by parenthesis "  and seperated by commas , if you are setting more than one user for that group. I also write their names at the end of the line in the order that they are placed so I can go back and remember them later.

 

You can edit the different load-outs for each User Group and add more by copying one group and changing the UIDs.

 

Safe the file and Open your init.sqf in your mission folder or mission.pbo. Fine the following lines:

if (!isDedicated) then {
	//Conduct map operations
	0 fadeSound 0;
	waitUntil {!isNil "dayz_loadScreenMsg"};
	dayz_loadScreenMsg = (localize "STR_AUTHENTICATING");
	
	//Run the player monitor
	_id = player addEventHandler ["Respawn", {_id = [] spawn player_death;}];
	_playerMonitor = 	[] execVM "\z\addons\dayz_code\system\player_monitor.sqf";	
	_void = [] execVM "R3F_Realism\R3F_Realism_Init.sqf";
	
	//Lights
	//[0,0,true,true,true,58,280,600,[0.698, 0.556, 0.419],"Generator_DZ",0.1] execVM "\z\addons\dayz_code\compile\local_lights_init.sqf";
};

Above "//Run the player monitor" add the following:

	//Custom Loadouts
	[] ExecVM "Scripts\loadout.sqf";

Now we have called the load-out script, and the world is a better place. Save your work, upload your files, and start your server to test out the scripts. Remember, you have to re-spawn for it to work.

 

 

UPDATE

So with each update the epoch devs are giving us server admins more varibles to call and edit in our init.sqf. My hope is they will add a varible to set the default skin when you load in. (logic must be applied when users select between a Male and Female character. Either it ignores females, or it allows for a array to be set: ["Male_Skin","Female_Skin"]) 

 

Further, I would like to make it easyier to set up items in these arrays, but as with everything, it becomes hard. I myself had to visit no less that 5 diffrent sorces to find all the "Item IDs" for diffrent items. But, my current data base is pretty current, with most of the non-OP items listed. Here is a link of the items you can buy and sell on my server all listed by their "ItemID" and organised in a way thats easy to read.

 

As for posts 8-13, I can give no reasoning why the script is failing for them. I my self have broken it many times by forgetting a comma between UIDs, but this only leads to players not getting their custom loadouts, I have not experianced any server issues or stalls from this edit, and I will be the first to admit I dont always know what I'm doing and I am always breaking my server with something.

Link to comment
Share on other sites

Recommended Posts

  • 0

Thinking about it MYSTIC, I'm thnking that you could even add a default skin inside the donators, and the other loadout's, say for a clan of something like that..

//CLAN Loadout
if ((getPlayerUID player) in ["########"]) then {  //Clan: Name, Name
	DefaultMagazines = ["ItemBandage","ItemBandage","ItemBandage","ItemBandage","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","ItemMorphine","ItemPainkiller","ItemBloodbag","ItemWaterbottleBoiled","ItemWaterbottleBoiled","FoodSteakCooked","8Rnd_B_Beneli_Pellets","8Rnd_B_Beneli_Pellets","8Rnd_B_Beneli_74Slug"];
	DefaultWeapons = ["M9SD","Remington870_lamp","Binocular","ItemMap","ItemCompass","ItemFlashlightRed","ItemKnife","ItemMatchbox","ItemHatchet"];
	DefaultBackpack = "DZ_GunBag_EP1";
	DefaultModel = "Rocket_DZ";
	DefaultBackpackWeapon = "";
	};

Have no idea if such a thing would work... thinking that the code there for the skin would be wrong but, personally have NFI

 

 

Anyone got suggestions on how that would work.

 

 

Bags

Link to comment
Share on other sites

  • 0

cool mate, nps...

 

One of the other guru's will chime in here as well soon, and enlighten both of us...

 

I went digging through the dayz_code.pbo, andfound a bunch of stuff about models and changing models goes.. but to make a default way of doing it...

I even dug around the wardrobe script from FREAKY FRED on opendayz.net, and the random clothes one and EBAY's custom spawnpoint and loadout set-up even ZABN's take clothes script and the deathcross script as well, to try and figure it out

 

NAH.. at least it didn't occur to me anyway

Edited by Bags2247
Link to comment
Share on other sites

  • 0

Whenever I add ,

 

//Default Loadout
DefaultMagazines = ["ItemBandage","ItemBandage","17Rnd_9x19_glock17","17Rnd_9x19_glock17","ItemMorphine","ItemPainkiller","ItemWaterbottleBoiled","FoodSteakCooked"];
DefaultWeapons = ["glock17_EP1","ItemFlashlight","ItemHatchet"];
DefaultBackpack = "DZ_Patrol_Pack_EP1";
DefaultBackpackWeapon = "";

 

To the init.sqf, and repack and upload the server gets stuck on a "Waiting for Host" Screen. Any help ?

 

Solved nevermind.

Link to comment
Share on other sites

  • 0

cmon loserman don't be mean share the fix please , as I have exactly the same problem

cheers

Raptor

 

 

 

By removing the space I had put between the last of the old line and the first of the new line , it removed the waiting for host screen

 

However after death my people still spawn with the same old crap, not glock and co ??? and ideas please

 

regards

Raptor

Link to comment
Share on other sites

  • 0

Running 1.0.3.1 and currently this breaks the server as everyone joining gets stuck on Authentication.

Tried any bypass to no avail.

 

This hasn't been working on my server since 1.0.2.5 anyway..

 

Could use a hint.

Thanks.

 

The issue was completely unrelated to this script :)

 

Also, this works flawlessly now.

Link to comment
Share on other sites

  • 0

I havent changed anthing thing wiht my scrip from 1.0.2.5 to 1.0.3 to 1.0.3.1, it just works. It isnt doing anything on or to the server besides changing varables. These varibles can be defined in the beginning of the init.sqf, i simply define them in the script I execute. if you place the call for the script where I mention, and dont have any errors in your loadout script (I am always leaving out a comma or forgetting a quotation) then there semes to be no reason for it to fail.

Link to comment
Share on other sites

  • 0

Running 1.0.3.1 and currently this breaks the server as everyone joining gets stuck on Authentication.

Tried any bypass to no avail.

 

This hasn't been working on my server since 1.0.2.5 anyway..

 

Could use a hint.

Thanks.

 

 

Perhaps if you show us your loadout script we can help you. It's probably just a missing , or " somewhere.

Link to comment
Share on other sites

  • 0
if ((getPlayerUID player) in ["хххххх"]) then {
DefaultMagazines = ["15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","ItemBandage","ItemBandage","ItemBandage","FoodSteakCooked","ItemSodaPepsi","ItemMorphine","ItemAntibiotic","ItemBloodbag","ItemPainkiller","100Rnd_762x51_M240","100Rnd_762x51_M240","100Rnd_762x51_M240"];
DefaultWeapons = ["M9SD","Binocular","NVGoggles","Mk_48_DZ","ItemGPS","ItemMap","ItemCompass","ItemKnife","ItemMatchbox","ItemToolbox"];
DefaultBackpack = "DZ_Backpack_EP1";
DefaultBackpackWeapon = ["ItemJerrycan","PartEngine","PartFueltank","PartGeneric","PartWheel","Skin_Ins_Soldier_GL_DZ","Skin_Soldier1_DZ"];
Link to comment
Share on other sites

  • 0

Ozersk, the issue I see with your loadout is you haven't put a }; after the script.
 
It should be something like this: 



if ((getPlayerUID player) in ["*UIDS*"]) then
{
DefaultMagazines= ["15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","ItemBandage","ItemBandage","ItemBandage","FoodSteakCooked","ItemSodaPepsi","ItemMorphine","ItemAntibiotic","ItemBloodbag","ItemPainkiller","100Rnd_762x51_M240","100Rnd_762x51_M240","100Rnd_762x51_M240"];
DefaultWeapons = ["M9SD","Binocular","NVGoggles","Mk_48_DZ","ItemGPS","ItemMap","ItemCompass","ItemKnife","ItemMatchbox","ItemToolbox"];
DefaultBackpack = "DZ_Backpack_EP1";
DefaultBackpackWeapon = ["ItemJerrycan","PartEngine","PartFueltank","PartGeneric","PartWheel","Skin_Ins_Soldier_GL_DZ","Skin_Soldier1_DZ"];
};

 

See how this goes.

Link to comment
Share on other sites

  • 0

Ozersk, the issue I see with your loadout is you haven't put a }; after the script.

 

It should be something like this: 

if ((getPlayerUID player) in ["*UIDS*"]) then

{

DefaultMagazines= ["15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","ItemBandage","ItemBandage","ItemBandage","FoodSteakCooked","ItemSodaPepsi","ItemMorphine","ItemAntibiotic","ItemBloodbag","ItemPainkiller","100Rnd_762x51_M240","100Rnd_762x51_M240","100Rnd_762x51_M240"];

DefaultWeapons = ["M9SD","Binocular","NVGoggles","Mk_48_DZ","ItemGPS","ItemMap","ItemCompass","ItemKnife","ItemMatchbox","ItemToolbox"];

DefaultBackpack = "DZ_Backpack_EP1";

DefaultBackpackWeapon = ["ItemJerrycan","PartEngine","PartFueltank","PartGeneric","PartWheel","Skin_Ins_Soldier_GL_DZ","Skin_Soldier1_DZ"];

};

 

See how this goes.

Sorry, it costs at the end };
the script stock works, and in a backpack there is nothing

 

if ((getPlayerUID player) in ["хххххх"]) then {
DefaultMagazines = ["15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","ItemBandage","ItemBandage","ItemBandage","FoodSteakCooked","ItemSodaPepsi","ItemMorphine","ItemAntibiotic","ItemBloodbag","ItemPainkiller","100Rnd_762x51_M240","100Rnd_762x51_M240","100Rnd_762x51_M240"];
DefaultWeapons = ["M9SD","Binocular","NVGoggles","Mk_48_DZ","ItemGPS","ItemMap","ItemCompass","ItemKnife","ItemMatchbox","ItemToolbox"];
DefaultBackpack = "DZ_Backpack_EP1";
DefaultBackpackWeapon = ["ItemJerrycan","PartEngine","PartFueltank","PartGeneric","PartWheel","Skin_Ins_Soldier_GL_DZ","Skin_Soldier1_DZ"];
};

The black - works

The red - doesn't work
Link to comment
Share on other sites

  • 0

Could I call the script from dayz_server instead?

Doing something like:

[] execVM "\z\addons\dayz_server\missions\DayZ_Epoch_11.Chernarus\loadout.sqf";

Would that still work? I don't really fancy having everyone download the missionfile every time I add a new ID :P

 

My server people have to do that any way because i change the loading screen every reboot. Plus im constantly updating the server code and they need a new mission file. I can understand that downloading a file each time is a pain, but in the long run it should never be a real issue.

Link to comment
Share on other sites

  • 0

In the BluePhoenix admin tools, the functionality to add items to the backpack looks like this:

 

(Unitbackpack GearAdd) addMagazineCargoGlobal ['ItemBloodbag', 3];
(Unitbackpack GearAdd) addMagazineCargoGlobal ['ItemEpinephrine', 2];
(Unitbackpack GearAdd) addMagazineCargoGlobal ['ItemSodaPepsi', 4];
(Unitbackpack GearAdd) addMagazineCargoGlobal ['ItemBandage', 4];
(Unitbackpack GearAdd) addMagazineCargoGlobal ['FoodSteakCooked', 4];
(Unitbackpack GearAdd) addMagazineCargoGlobal ['ItemMorphine', 3];
(Unitbackpack GearAdd) addMagazineCargoGlobal ['ItemPainkiller', 4];
(Unitbackpack GearAdd) addMagazineCargoGlobal ['ItemAntibiotic', 2];
(Unitbackpack GearAdd) addMagazineCargoGlobal ['20Rnd_762x51_SB_SCAR', 3];

Note that in the database, the structure for the backpack is more like an array, with the item name and then the number/quantity of each.

 (i.e. like this...  )

[[],[]],[["ItemBloodbag","ItemEpinephrine","ItemSodaPepsi","ItemBandage","FoodSteakCooked","ItemMorphine","ItemPainkiller","ItemAntibiotic","20Rnd_9x39_SP5_VSS","ItemBriefcase100oz"],[3,2,3,4,3,3,4,2,4,4]]]

HTH,

 

GT

Link to comment
Share on other sites

  • 0

My server people have to do that any way because i change the loading screen every reboot. Plus im constantly updating the server code and they need a new mission file. I can understand that downloading a file each time is a pain, but in the long run it should never be a real issue.

 

I understand, but do you think it would work? :p

I would like to do it that way because it would be easier for me, not only because of the downloading issue.

 

I think I'll go and test it myself actually, I'll look into it and then post again.

Link to comment
Share on other sites

  • 0

I understand, but do you think it would work? :P

I would like to do it that way because it would be easier for me, not only because of the downloading issue.

 

I think I'll go and test it myself actually, I'll look into it and then post again.

 

 

Well in 1.0.3 the epoch devs moved the mission file to the server.pbo, its not hatd to just put it in there and see what it does. It will work or it wont.

Link to comment
Share on other sites

  • 0

 

In the BluePhoenix admin tools, the functionality to add items to the backpack looks like this:

 

(Unitbackpack GearAdd) addMagazineCargoGlobal ['ItemBloodbag', 3];
(Unitbackpack GearAdd) addMagazineCargoGlobal ['ItemEpinephrine', 2];
(Unitbackpack GearAdd) addMagazineCargoGlobal ['ItemSodaPepsi', 4];
(Unitbackpack GearAdd) addMagazineCargoGlobal ['ItemBandage', 4];
(Unitbackpack GearAdd) addMagazineCargoGlobal ['FoodSteakCooked', 4];
(Unitbackpack GearAdd) addMagazineCargoGlobal ['ItemMorphine', 3];
(Unitbackpack GearAdd) addMagazineCargoGlobal ['ItemPainkiller', 4];
(Unitbackpack GearAdd) addMagazineCargoGlobal ['ItemAntibiotic', 2];
(Unitbackpack GearAdd) addMagazineCargoGlobal ['20Rnd_762x51_SB_SCAR', 3];

Note that in the database, the structure for the backpack is more like an array, with the item name and then the number/quantity of each.

 (i.e. like this...  )

[[],[]],[["ItemBloodbag","ItemEpinephrine","ItemSodaPepsi","ItemBandage","FoodSteakCooked","ItemMorphine","ItemPainkiller","ItemAntibiotic","20Rnd_9x39_SP5_VSS","ItemBriefcase100oz"],[3,2,3,4,3,3,4,2,4,4]]]

HTH,

 

GT

 

 

Yah thats the arma 2 version of doing things, but we are editing and useing a custom varible the epoch devs made for the mod, so you would have to get their input on how to set the add back pack weapon. Its my opinion that that varable can only take one item and it has to be a gun, it cannot set or add magazines or items to the pack. But, I am lazy and have not tested it.

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
×
×
  • Create New...