How to make individual loadouts with vilayer

LTGNick

Valued Member!
Does anyone know how to do this? i just switched from dayz.st to vilayer and im clue less how to make loadouts for certain people
 
If you didn't find it pate that in your Init

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


Create a folder if you don't have it called custom, then inside the custom, a file called loadout.sqf and paste that.. If you don't want the default loadout just use the other one and copy paste it for each new players.

//Default Loadout All your players gonna spawn with what you put here
DefaultMagazines = ["ItemPainkiller","ItemBandage","ItemTinBar","ItemMorphine","ItemBloodbag","ItemTroutCooked","ItemSodaPepsi","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag"];
DefaultWeapons = ["M16A4_ACG","ItemMap","ItemToolbox","ItemHatchet_DZE","ItemRadio"];
DefaultBackpack = "DZ_ALICE_Pack_EP1";
DefaultBackpackWeapon = "";

//Admin Loadout You can change Admin for moderator, donator...
if ((getPlayerUID player) in ["UID"]) then { //Admins: Name
DefaultMagazines = ["15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","20Rnd_762x51_DMR","20Rnd_762x51_DMR","20Rnd_762x51_DMR","20Rnd_762x51_DMR","ItemBandage","ItemBandage","ItemBandage","ItemMorphine","ItemBloodbag","ItemPainkiller","ItemSodaPepsi","FoodMRE"];
DefaultWeapons = ["M9SD","DMR","Binocular_Vector","NVGoggles","ItemMap","ItemCrowbar","ItemRadio","ItemKnife","ItemMatchbox_DZE","ItemHatchet_DZE","ItemGPS","ItemEtool","Itemtoolbox"];
DefaultBackpack = "DZ_Backpack_EP1";
DefaultBackpackWeapon = "";
};
 
Ive used this method for a long time for my custom loadouts and i find sometimes users dont spawn with their Individual Player ID Loadouts, and sometimes people that should spawn with the default loadout, spawn with a custom one?
Any ideas? Or is it just one of those unfix-able things?

thanks
 
Code:
//Default Loadout
DefaultMagazines = ["ItemBandage","ItemPainkiller","ItemWaterbottle"];
DefaultWeapons = ["ItemFlashlight","ItemMap","ItemGPS","ItemWatch","ItemCompass","ItemHatchet_DZE"];
DefaultBackpack = "DZ_Patrol_Pack_EP1";
DefaultBackpackWeapon = "";


//Admin Loadout NIALL-RYAN-KALLUM-HARRY-HARDY
if ((getPlayerUID player) in ["152731014","152729030","40794438","103595334","731138AX"]) then {  //Admins:NIALL-RYAN-KALLUM-HARRY-HARDY
    DefaultMagazines = ["Skin_Rocket_DZ","ItemBandage","ItemBandage","ItemBandage","7Rnd_45ACP_1911","7Rnd_45ACP_1911","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag"];
    DefaultWeapons = ["Colt1911","RH_hk416","ItemMap","ItemCompass","ItemGPS","ItemWatch","ItemKnife","Itemtoolbox","ItemHatchet_DZE"];
    DefaultBackpack = "";
    DefaultBackpackWeapon = "";
    };

//Col Burton
if ((getPlayerUID player) in ["27163782"]) then {   //Moderators: Col_burton
    DefaultMagazines = ["Skin_FR_OHara_DZ","ItemBandage","ItemBandage","ItemBandage","17Rnd_9x19_glock17","17Rnd_9x19_glock17","ItemMorphine","ItemPainkiller","ItemBloodbag","ItemWaterbottleBoiled","ItemWaterbottleBoiled"];
    DefaultWeapons = ["glock17_EP1","ItemMap","Itemtoolbox","ItemHatchet_DZE","ItemGPS","ItemCompass"];
    DefaultBackpack = "DZ_CivilBackpack_EP1";
    DefaultBackpackWeapon = "";
    };

//Karlomatt
if ((getPlayerUID player) in ["24107206"]) then {  //Pro-Donators: Karl'0'Mat
    DefaultMagazines = ["Skin_Soldier_Sniper_PMC_DZ","ItemBandage","ItemBandage","ItemBandage","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","ItemMorphine","ItemPainkiller","ItemBloodbag","ItemWaterbottleBoiled","ItemWaterbottleBoiled"];
    DefaultWeapons = ["M9SD","Binocular","ItemMap","ItemCompass","ItemKnife","ItemMatchbox","ItemHatchet_DZE","Itemtoolbox","ItemGPS"];
    DefaultBackpack = "DZ_British_ACU";
    DefaultBackpackWeapon = "";
    };

//Donator Loadout NMATT
if ((getPlayerUID player) in ["127741766"]) then {  //Donators: MATT
    DefaultMagazines = ["ItemBandage","ItemBandage","ItemBandage","ItemBandage","ItemMorphine","ItemPainkiller","ItemGoldBar","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag"];
    DefaultWeapons = ["glock17_EP1","M4A1_Aim","ItemMap","ItemFlashlightRed","ItemHatchet"];
    DefaultBackpack = "DZ_ALICE_Pack_EP1";
    DefaultBackpackWeapon = "";
    };
   
//Warhamster
if ((getPlayerUID player) in ["250311494"]) then {  //Pro-Donators: Warhamster
    DefaultMagazines = ["GUE_Soldier_MG_DZ","ItemBandage","ItemBandage","ItemBandage","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","ItemMorphine","ItemPainkiller","ItemBloodbag","ItemWaterbottleBoiled","ItemWaterbottleBoiled"];
    DefaultWeapons = ["M4A1_AIM_SD_camo","Binocular","ItemMap","ItemCompass","ItemKnife","ItemMatchbox","ItemHatchet_DZE","Itemtoolbox","ItemGPS"];
    DefaultBackpack = "DZ_British_ACU";
    DefaultBackpackWeapon = "";
    };   

//Pip
if ((getPlayerUID player) in ["2250242"]) then {   //Moderators: PIP
    DefaultMagazines = ["Sniper1_DZ","ItemBandage","ItemBandage","ItemBandage","20rnd_762x51_SB_SCAR","20rnd_762x51_SB_SCAR","ItemMorphine","ItemPainkiller","ItemBloodbag","ItemWaterbottleBoiled","ItemWaterbottleBoiled"];
    DefaultWeapons = ["SCAR_H_LNG_Sniper_SD","ItemMap","Itemtoolbox","ItemHatchet_DZE","ItemGPS","ItemCompass"];
    DefaultBackpack = "DZ_CivilBackpack_EP1";
    DefaultBackpackWeapon = "";
    };   

//Crymexis
if ((getPlayerUID player) in [""]) then {  //
    DefaultMagazines = ["Skin_CZ_Soldier_Sniper_EP1_DZ","ItemBandage","ItemBandage","ItemBandage","30Rnd_545x39_AK","30Rnd_545x39_AK","30Rnd_545x39_AK"];
    DefaultWeapons = ["vil_ak_74m","ItemMap","ItemCompass","ItemGPS","ItemWatch","ItemKnife","Itemtoolbox","ItemHatchet_DZE"];
    DefaultBackpack = "DZ_GunBag_EP1";
    DefaultBackpackWeapon = "";
    };   

//Mr Cuddles
if ((getPlayerUID player) in [""]) then {  //
    DefaultMagazines = ["Skin_GUE_Soldier_2_DZ","ItemBandage","ItemBandage","ItemBandage","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag"];
    DefaultWeapons = ["M4A3_CCO_EP1","ItemMap","ItemCompass","ItemGPS","ItemWatch","ItemKnife","Itemtoolbox","ItemHatchet_DZE"];
    DefaultBackpack = "DZ_British_ACU";
    DefaultBackpackWeapon = "";
    };
 
Is this starting loadout method working for Dayz 1.8.1? I'm trying it put I can't get it to work.

I created a folder in my customs folder called loadout. I put this loadout.sqf in there:

Code:
//Default Loadout
DefaultMagazines = ["ItemBandage","ItemMorphine","ItemPainkiller","FoodCanBakedBeans","ItemWaterbottle","ItemAntibiotic","15Rnd_W1866_Slug","15Rnd_W1866_Slug","15Rnd_W1866_Slug"];
DefaultWeapons = ["Winchester1866"];
DefaultBackpack = "DZ_Patrol_Pack_EP1";
DefaultBackpackWeapon = "";

Tried putting the [] ExecVM "custom\loadout\loadout.sqf"; line in my init.sqf in several locations, including the bottom, in the isDedicated and isServer sections but I don't get the starting loadout.

Any suggestions?
 
Try to have look in the day_server.pbo/compile/server_playerSetup.sqf ;)

Also if using Epoch 1.0.5.1:
DefaultBackpackWeapon is no more in use
 
if you want to throw this into dayz you probably can. This is the server side compiles part of the code :
Code:
    //Record initial inventory only if not player zombie
    if(_isInfected != 1) then {
        _config = (configFile >> "CfgSurvival" >> "Inventory" >> "Default");
        _mags = getArray (_config >> "magazines");
        _wpns = getArray (_config >> "weapons");
        _bcpk = getText (_config >> "backpack");

        if(!isNil "DefaultMagazines") then {
            _mags = DefaultMagazines;
        };
        if(!isNil "DefaultWeapons") then {
            _wpns = DefaultWeapons;
        };
        if(!isNil "DefaultBackpack") then {
            _bcpk = DefaultBackpack;
        };
        //_randomSpot = true;
   
        //Wait for HIVE to be free
        _key = format["CHILD:203:%1:%2:%3:",_charID,[_wpns,_mags],[_bcpk,[],[]]];
        _key call server_hiveWrite;
    };
};

#ifdef DZE_SERVER_DEBUG
diag_log ("LOGIN LOADED: " + str(_playerObj) + " Type: " + (typeOf _playerObj) + " at location: " + (getPosATL _playerObj));
#endif

_isHiveOk = false;
if (_hiveVer >= dayz_hiveVersionNo) then {
    _isHiveOk = true;
};

if (worldName == "chernarus") then {
    ([4654,9595,0] nearestObject 145259) setDamage 1;
    ([4654,9595,0] nearestObject 145260) setDamage 1;
};

dayzPlayerLogin = [_charID,_inventory,_backpack,_survival,_isNew,dayz_versionNo,_model,_isHiveOk,_newPlayer,_isInfected];
(owner _playerObj) publicVariableClient "dayzPlayerLogin";
from player login. This is from the player_monitor.fsm :
Code:
      "//Record current weapon state" \n
       "dayz_myWeapons =         weapons player;        //Array of last checked weapons" \n
       "dayz_myItems =             items player;        //Array of last checked items" \n
       "dayz_myMagazines =     magazines player;" \n
       "" \n
       "dayz_playerUID = _playerUID;" \n
       "" \n
       "if ((_isNew) || (count _inventory == 0)) then {" \n
       "    //player is new, add initial loadout only if player is not pzombie" \n
       "    if(!(player isKindOf ""PZombie_VB"")) then {" \n
       "        _config = (configFile >> ""CfgSurvival"" >> ""Inventory"" >> ""Default"");" \n
       "        _mags = getArray (_config >> ""magazines"");" \n
       "        _wpns = getArray (_config >> ""weapons"");        " \n
       "        _bcpk = getText (_config >> ""backpack"");" \n
       "        _bcpkItems = getText (_config >> ""backpackWeapon"");" \n
       "        if(!isNil ""DefaultMagazines"") then {" \n
       "            _mags = DefaultMagazines;" \n
       "        };" \n
       "        if(!isNil ""DefaultWeapons"") then {" \n
       "            _wpns = DefaultWeapons;" \n
       "        };" \n
       "        if(!isNil ""DefaultBackpack"") then {" \n
       "            _bcpk = DefaultBackpack;" \n
       "        };" \n
       "        if(!isNil ""DefaultBackpackItems"") then {" \n
       "            _bcpkItems = DefaultBackpackItems;" \n
       "        };" \n
       "        //Add inventory" \n
       "        {" \n
       "            _isOK =     isClass(configFile >> ""CfgMagazines"" >> _x);" \n
       "            if (_isOK) then {" \n
       "                player addMagazine _x;" \n
       "            };" \n
       "        } count _mags;" \n
       "        {" \n
       "            _isOK =     isClass(configFile >> ""CfgWeapons"" >> _x);" \n
       "            if (_isOK) then {" \n
       "                player addWeapon _x;" \n
       "            };" \n
       "        } count _wpns;" \n
       "        " \n
       "        if (_bcpk != """") then {" \n
       "            player addBackpack _bcpk; " \n
       "            dayz_myBackpack =    unitBackpack player;" \n
       "        };" \n
       "        if ((typeName _bcpkItems) == ""ARRAY"") then {" \n
       "            {" \n
       "                if (isClass(configFile >> ""CfgWeapons"" >> _x)) then {" \n
       "                    dayz_myBackpack addWeaponCargoGlobal [_x,1];" \n
       "                } else {" \n
       "                    dayz_myBackpack addMagazineCargoGlobal [_x, 1];" \n
       "                };" \n
       "            } count _bcpkItems;" \n
       "        } else {" \n
       "            if (_bcpkItems != """") then {" \n
       "                dayz_myBackpack addMagazineCargoGlobal [_bcpkItems, 1];" \n
       "            };" \n
       "        };" \n
       "    };" \n
       "};" \n
       "" \n
 
Is it possible to do a custom starting loadout for Dayz 1.8.1?

*edit* Looks like I posted at the same time as you. I don't quite understand what I'm supposed to do with that code.
 
sry my bad. server_playerLogin.sqf:
Code:
//Variables
_inventory =    [];
_backpack =     [];
_items =         [];
_magazines =     [];
_weapons =         [];
_medicalStats =    [];
_survival =        [0,0,0];
_tent =            [];
_state =         [];
_direction =    0;
_model =        "";
_newUnit =        objNull;
_botActive = false;
 
Hmm... I saw that but figured since it was empty, that wasn't it. I thought I'd find the starting loadout in some file someplace. I will give this a try. Thank you!
 
Back
Top