Jump to content
  • 0

Donator Spawn loadout without Database triggers


MassAsster

Question

I've been toying around with how not to do database driven donator spawn loot, I've come up with this system that  I am currently testing.

 

Inside the server PBO, inside the compile folder  locate server_playerLogin.sqf

 

AFTER line

if (count _this > 2) then {
	dayz_players = dayz_players - [_this select 2];
};

Insert your custom user spawn setups.

if (_playerID == "3042438") then {
//MassAsster
_inventory =	[["ItemMap","ItemFlashlight","ItemWatch","ItemCompass","revolver_gold_EP1","AKS_GOLD"], ["ItemBandage","6Rnd_45ACP","6Rnd_45ACP","6Rnd_45ACP","30Rnd_762x39_AK47","ItemBandage","ItemPainkiller","ItemEpinephrine","ItemAntibiotic","ItemMorphine","ItemWaterbottle","FoodCanBakedBeans"]];
_backpack = 	["DZ_ALICE_Pack_EP1",[[],[]],[[],[]]]; };

if (_playerID == "3042694") then {
//Adam
_inventory =	[["ItemMap","ItemFlashlight","ItemWatch","ItemCompass","revolver_gold_EP1","AKS_GOLD"], ["ItemBandage","6Rnd_45ACP","6Rnd_45ACP","6Rnd_45ACP","30Rnd_762x39_AK47","ItemBandage","ItemPainkiller","ItemEpinephrine","ItemAntibiotic","ItemMorphine","ItemWaterbottle","FoodCanBakedBeans"]];
_backpack = 	["DZ_ALICE_Pack_EP1",[[],[]],[[],[]]]; };

if (_playerID == "3042630") then {
//jody
_inventory =	[["ItemMap","ItemFlashlight","ItemWatch","ItemCompass","revolver_gold_EP1","AKS_GOLD"], ["ItemBandage","6Rnd_45ACP","6Rnd_45ACP","6Rnd_45ACP","30Rnd_762x39_AK47","ItemBandage","ItemPainkiller","ItemEpinephrine","ItemAntibiotic","ItemMorphine","ItemWaterbottle","FoodCanBakedBeans"]];
_backpack = 	["DZ_ALICE_Pack_EP1",[[],[]],[[],[]]]; };

if (_playerID == "138731014") then {
//Greg
_inventory =	[["ItemMap","ItemFlashlight","ItemWatch","ItemCompass","revolver_gold_EP1","AKS_GOLD"], ["ItemBandage","6Rnd_45ACP","6Rnd_45ACP","6Rnd_45ACP","30Rnd_762x39_AK47","ItemBandage","ItemPainkiller","ItemEpinephrine","ItemAntibiotic","ItemMorphine","ItemWaterbottle","FoodCanBakedBeans"]];
_backpack = 	["DZ_ALICE_Pack_EP1",[[],[]],[[],[]]]; };

Comment out any spawn setups that may exist under these lines.

//Variables
//_inventory =	[[], []];
//_backpack = 	["DZ_ALICE_Pack_EP1",[[],[]],[[],[]]];
//_items = 		[];
//_magazines = 	[];
//_weapons = 		[];
//_medicalStats =	[];

Locate your Init inside your mission.pbo

 

Locate (if they are inside) or insert (if they are not)

DefaultMagazines = ["ItemBandage","ItemBandage","ItemMorphine"];
DefaultWeapons = ["ItemFlashlight","ItemWatch","ItemCompass"];
DefaultBackpack = "DZ_ALICE_Pack_EP1";
DefaultBackpackWeapon = "";

Notice I do not give out a weapon, if i give a pistol to my default setup, than it will cause a bug with my donators setup, donators will get two pistols overlaying each other... To resolve this you can simply not assign a pistol to the default like I have done, or you can assign a pistol to the default and not assign one to the donator, simply give the donator more ammo. Either way you want to work it.

 

 

Have fun!

Link to comment
Share on other sites

Recommended Posts

  • 0

If the skin is one that is standard in game, you can prefix the name of the skin with skin_   (IE:  Skin_GUE_Soldier_Sniper_DZ )  and stick it into their gear for them to change into. Other than that, I haven't really looked into setting their skin... maybe you can toy around with    _model =        "";  ?

Link to comment
Share on other sites

  • 0

It it possible to remove something from a donors gear/bag once they die?

 

Let's say you give a donor Rifle X in their new spawn loadout for helping with server upkeep, but you don't want other players hunting them down and killing them for an easy Rifle X.

Could you make it unlootable or vanish from their gear when they die?

Link to comment
Share on other sites

  • 0

If the skin is one that is standard in game, you can prefix the name of the skin with skin_   (IE:  Skin_GUE_Soldier_Sniper_DZ )  and stick it into their gear for them to change into. Other than that, I haven't really looked into setting their skin... maybe you can toy around with    _model =        "";  ?

 

Actually, i put the _model= line under the _backpack= line, thinking "yeah, this looks good". tried just the basic "GUE_Soldier_Sniper_DZ" skin. It was a no go. In fact, im having trouble getting the entire script to work. Ensured that both the inventory & backpack lines are // out. Copied your loadouts, exactly as they were (just to test). Changed the UID's to my own, and other members of staff. Yet, i get nothing. Perhaps i forgot something, yet i slowly read over all 3 pages 4 times.

 

It it possible to remove something from a donors gear/bag once they die?

 

Let's say you give a donor Rifle X in their new spawn loadout for helping with server upkeep, but you don't want other players hunting them down and killing them for an easy Rifle X.

Could you make it unlootable or vanish from their gear when they die?

 

There's actually something similar to what you're wanting inside one of my addons... Maybe it can be modified for this use?

 

These lines:

/// clears all Weapons and Magazines off body on death
ai_clear_body = False;
 
are what toggles these lines:
if (ai_clear_body) then {
{_unit removeMagazine _x;} forEach (magazines _unit);
{_unit removeWeapon _x;} forEach (weapons _unit);
};

 

Personally, it would be a great way to protect admin class items from falling into the hands of regular players upon admin death. Id like to see it working.

Link to comment
Share on other sites

  • 0

I just went ahead and copied your playerLogin and changed the loadouts from there, worked like a charm. However, my thoughts on the backpack situation... What if you leave the custom loadout backpack class name empty but still stocked it with gear like the following?

 

["",[["ItemToolbox"],[1]],[["Skin_GUE_Soldier_2_DZ"],[1]]];

 

I feel like it should automatically insert the default backpack loadout classname and then just stock the gear into that pack? Gonna give it a test and let you know!

Link to comment
Share on other sites

  • 0

there is an easier way to do it 

paste this code after _playerMonitor = [] execVM "\z\addons\dayz_code\system\player_monitor.sqf"; in init.sqf

switch true do {
    case ((getPlayerUID player) in ["PlayerUID","PlayerUiD","0000000","0000000","0000000","0000000"])  :   
        {
    DefaultMagazines = ["ItemBandage","ItemBandage","ItemBandage","ItemBandage","ItemMorphine","ItemPainkiller","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","17Rnd_9x19_glock17","17Rnd_9x19_glock17"];
DefaultWeapons = ["glock17_EP1","G36C","ItemMap","ItemWatch","ItemHatchet","Itemtoolbox"];
DefaultBackpack = "DZ_ALICE_Pack_EP1";
DefaultBackpackWeapon = "";
        };
    default  
        {
DefaultMagazines = ["ItemBandage","ItemBandage","ItemPainkiller"];
DefaultWeapons = ["ItemFlashlight","ItemMachete"];
DefaultBackpack = "DZ_Patrol_Pack_EP1";
DefaultBackpackWeapon = "";
        };
};
Link to comment
Share on other sites

  • 0

Followed your instructions,
Load into game and get countdown timer.
Never actually get passed the loading screen.
 

//Run the player monitor
	_id = player addEventHandler ["Respawn", {_id = [] spawn player_death;}];
	_playerMonitor = 	[] execVM "\z\addons\dayz_code\system\player_monitor.sqf";	
	switch true do {
    case ((getPlayerUID player) in ["198544198"])  :   
        {
    DefaultMagazines = ["ItemBandage","ItemBandage","ItemBandage","FoodCanBakedBeans","ItemSodaCoke","ItemPainkiller","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","Skin_Soldier1_DZ","ItemMorphine","ItemBloodbag","15Rnd_9x19_M9","15Rnd_9x19_M9","15Rnd_9x19_M9","15Rnd_9x19_M9"];
DefaultWeapons = ["ItemToolbox","ItemFlashlight","M4A3_CCO_EP1","UZI_EP1","Binocular_Vector","NVGoggles","ItemGPS","ItemCompass","ItemKnife","ItemEtool"];
DefaultBackpack = "DZ_ALICE_Pack_EP1";
DefaultBackpackWeapon = "";
        };
    default  
        {
DefaultMagazines = ["ItemBandage","ItemBandage","ItemBandage","17Rnd_9x19_glock17","17Rnd_9x19_glock17","FoodCanBakedBeans","ItemSodaCoke","ItemPainkiller"];
DefaultWeapons = ["glock17_EP1","ItemMap","ItemToolbox","ItemFlashlight"];
DefaultBackpack = "DZ_Patrol_Pack_EP1";
DefaultBackpackWeapon = "";
        };
	
	//anti Hack
	//[] execVM "\z\addons\dayz_code\system\antihack.sqf";

I'm no genius at coding, nor do I even know how to do alot of it, but from my basic understanding of code, I would think that you're asking already existing players (alive) to spawn with what is show there. I think some sort of 'If player is new', or something like that needs to be input somewhere, because It's rejecting players to load their character. Not even new players can join

 

Link to comment
Share on other sites

  • 0

I believe this will help a bunch.


A tutorial on basic setup, extremely easy, all it requires you to do is change what you want the players to spawn with.

Basic Instructions, Create a Loaout.sqf file in your Mission folder/Pbo, (You can use the script I edited to suit my server and donars) just paste the code into your new Loadouts.sqf file you made.

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

//Admin Loadout
if ((getPlayerUID player) in ["38128710","149474374"]) then {  //Admins: John West, Me
	DefaultMagazines = ["ItemBandage","ItemBandage","ItemBandage","ItemPainkiller","FoodSteakCooked","ItemWatterBottle","ItemMorphine","ItemBloodbag","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","20Rnd_762x51_B_scar","20Rnd_762x51_B_scar","20Rnd_762x51_B_scar","20Rnd_762x51_B_scar","20Rnd_762x51_B_scar","Skin_Drake_light_DZ"];
DefaultWeapons = ["ItemToolbox","Binocular_Vector","NVGoggles","ItemGPS","ItemCompass","ItemKnife","ItemEtool","M9SD","Scar_H_STD_EGLM_Spect","ItemHatchet","ItemFlashlightRed"];
	DefaultBackpack = "DZ_LargeGunBag_EP1";
	DefaultBackpackWeapon = "";
	};

//Pro-Donator Loadout Custom As50 Boom
if ((getPlayerUID player) in ["198544198"]) then {  //Pro-Donators AS50 Custom: Boom Headshot
	DefaultMagazines = ["ItemBandage","ItemBandage","ItemBandage","ItemPainkiller","FoodSteakCooked","ItemWatterBottle","ItemMorphine","ItemBloodbag","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","10Rnd_127x99_m107","10Rnd_127x99_m107","10Rnd_127x99_m107","10Rnd_127x99_m107","10Rnd_127x99_m107","10Rnd_127x99_m107","Skin_CZ_Soldier_Sniper_EP1_DZ"];
	DefaultWeapons = ["ItemToolbox","Binocular_Vector","NVGoggles","ItemGPS","ItemCompass","ItemKnife","ItemEtool","M9SD","BAF_AS50_scoped","ItemHatchet","ItemFlashlightRed"];
	DefaultBackpack = "DZ_LargeGunBag_EP1";
	DefaultBackpackWeapon = "";
	};
	
//Pro-Donator Loadout Custom Mk17 Gizmo
if ((getPlayerUID player) in ["198544070"]) then {  //Pro-Donators AS50 Custom: Gizmo
DefaultMagazines = ["ItemBandage","ItemBandage","ItemBandage","ItemPainkiller","FoodSteakCooked","ItemWatterBottle","ItemMorphine","ItemBloodbag","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","20Rnd_762x51_B_scar","20Rnd_762x51_B_scar","20Rnd_762x51_B_scar","20Rnd_762x51_B_scar","20Rnd_762x51_B_scar","Skin_GUE_Commander_DZ"];
DefaultWeapons = ["ItemToolbox","Binocular_Vector","NVGoggles","ItemGPS","ItemCompass","ItemKnife","ItemEtool","M9SD","SCAR_H_CQC_CCO","ItemHatchet","ItemFlashlightRed"];
	DefaultBackpack = "DZ_LargeGunBag_EP1";
	DefaultBackpackWeapon = "";
	};

//Advanced Donator Loadout USMC Sniper
if ((getPlayerUID player) in [""93836038""]) then {   //Donators: Keks R Us
	DefaultMagazines = ["20Rnd_762x51_DMR","20Rnd_762x51_DMR","20Rnd_762x51_DMR","20Rnd_762x51_DMR","20Rnd_762x51_DMR","20Rnd_762x51_DMR","ItemBandage","ItemBandage","ItemBandage","ItemBandage","17Rnd_9x19_glock17","17Rnd_9x19_glock17","17Rnd_9x19_glock17","17Rnd_9x19_glock17","ItemPainkiller","ItemMorphine","ItemAntibiotic","FoodSteakCooked","ItemSodaPepsi"];
	DefaultWeapons = ["Binocular_Vector","NVGoggles","ItemGPS","ItemCompass","ItemFlashlightRed","ItemKnife","ItemHatchet","ItemEtool","ItemToolbox","DMR","glock17_EP1"];
	DefaultBackpack = "DZ_Backpack_EP1";
	DefaultBackpackWeapon = "";
	};

//Donator Loadout USMC Assault
if ((getPlayerUID player) in ["167074310"]) then {  //USMC Donators: Jac_2001nz
	DefaultMagazines = ["ItemBandage","ItemBandage","ItemBandage","ItemBandage","ItemPainkiller","ItemMorphine","ItemAntibiotic","FoodSteakCooked","ItemSodaPepsi","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD"];
	DefaultWeapons = ["Binocular_Vector","NVGoggles","ItemGPS","ItemCompass","ItemFlashlightRed","ItemKnife","ItemHatchet","ItemEtool","ItemToolbox","M4A3_CCO_EP1","M9SD"];
	DefaultBackpack = "DZ_GunBag_EP1";
	DefaultBackpackWeapon = "";
	};

 

Then call it in your Init.sqf Between the 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";	
	

So it looks like:
 

if (!isDedicated) then {
	//Conduct map operations
	0 fadeSound 0;
	waitUntil {!isNil "dayz_loadScreenMsg"};
	dayz_loadScreenMsg = (localize "STR_AUTHENTICATING");

	//Custom Loadouts
	[] ExecVM "loadouts.sqf";

	//Run the player monitor
	_id = player addEventHandler ["Respawn", {_id = [] spawn player_death;}];
	_playerMonitor = 	[] execVM "\z\addons\dayz_code\system\player_monitor.sqf";	
	 

or

if (!isDedicated) then {
	//Conduct map operations
	0 fadeSound 0;
	waitUntil {!isNil "dayz_loadScreenMsg"};
	dayz_loadScreenMsg = (localize "STR_AUTHENTICATING");

	//Custom Loadouts
	[] ExecVM "scripts/loadout.sqf";

	//Run the player monitor
	_id = player addEventHandler ["Respawn", {_id = [] spawn player_death;}];
	_playerMonitor = 	[] execVM "\z\addons\dayz_code\system\player_monitor.sqf";	
	 

If you follow the other tutorial (I choose not to have another useless folder)

 

It works absolutely brilliant on my server.

All credit for this goes to Mysticviperx

Link to comment
Share on other sites

  • 0

Sorry copy pasted the code wrong its missing one };

 

Here is working script

//Run the player monitor
    _id = player addEventHandler ["Respawn", {_id = [] spawn player_death;}];
    _playerMonitor =     [] execVM "\z\addons\dayz_code\system\player_monitor.sqf";    
    switch true do {
case ((getPlayerUID player) in ["198544198"]) : 
{
DefaultMagazines = ["ItemBandage","ItemBandage","ItemBandage","FoodCanBakedBeans","ItemSodaCoke","ItemPainkiller","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","Skin_Soldier1_DZ","ItemMorphine","ItemBloodbag","15Rnd_9x19_M9","15Rnd_9x19_M9","15Rnd_9x19_M9","15Rnd_9x19_M9"];
DefaultWeapons = ["ItemToolbox","ItemFlashlight","M4A3_CCO_EP1","UZI_EP1","Binocular_Vector","NVGoggles","ItemGPS","ItemCompass","ItemKnife","ItemEtool"];
DefaultBackpack = "DZ_ALICE_Pack_EP1";
DefaultBackpackWeapon = "";
};
default 
{
DefaultMagazines = ["ItemBandage","ItemBandage","ItemBandage","17Rnd_9x19_glock17","17Rnd_9x19_glock17","FoodCanBakedBeans","ItemSodaCoke","ItemPainkiller"];
DefaultWeapons = ["glock17_EP1","ItemMap","ItemToolbox","ItemFlashlight"];
DefaultBackpack = "DZ_Patrol_Pack_EP1";
DefaultBackpackWeapon = "";
};
};
    //anti Hack
    //[] execVM "\z\addons\dayz_code\system\antihack.sqf";
Link to comment
Share on other sites

  • 0

I believe this will help a bunch.

A tutorial on basic setup, extremely easy, all it requires you to do is change what you want the players to spawn with.

Basic Instructions, Create a Loaout.sqf file in your Mission folder/Pbo, (You can use the script I edited to suit my server and donars) just paste the code into your new Loadouts.sqf file you made.

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

//Admin Loadout
if ((getPlayerUID player) in ["38128710","149474374"]) then {  //Admins: John West, Me
	DefaultMagazines = ["ItemBandage","ItemBandage","ItemBandage","ItemPainkiller","FoodSteakCooked","ItemWatterBottle","ItemMorphine","ItemBloodbag","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","20Rnd_762x51_B_scar","20Rnd_762x51_B_scar","20Rnd_762x51_B_scar","20Rnd_762x51_B_scar","20Rnd_762x51_B_scar","Skin_Drake_light_DZ"];
DefaultWeapons = ["ItemToolbox","Binocular_Vector","NVGoggles","ItemGPS","ItemCompass","ItemKnife","ItemEtool","M9SD","Scar_H_STD_EGLM_Spect","ItemHatchet","ItemFlashlightRed"];
	DefaultBackpack = "DZ_LargeGunBag_EP1";
	DefaultBackpackWeapon = "";
	};

//Pro-Donator Loadout Custom As50 Boom
if ((getPlayerUID player) in ["198544198"]) then {  //Pro-Donators AS50 Custom: Boom Headshot
	DefaultMagazines = ["ItemBandage","ItemBandage","ItemBandage","ItemPainkiller","FoodSteakCooked","ItemWatterBottle","ItemMorphine","ItemBloodbag","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","10Rnd_127x99_m107","10Rnd_127x99_m107","10Rnd_127x99_m107","10Rnd_127x99_m107","10Rnd_127x99_m107","10Rnd_127x99_m107","Skin_CZ_Soldier_Sniper_EP1_DZ"];
	DefaultWeapons = ["ItemToolbox","Binocular_Vector","NVGoggles","ItemGPS","ItemCompass","ItemKnife","ItemEtool","M9SD","BAF_AS50_scoped","ItemHatchet","ItemFlashlightRed"];
	DefaultBackpack = "DZ_LargeGunBag_EP1";
	DefaultBackpackWeapon = "";
	};
	
//Pro-Donator Loadout Custom Mk17 Gizmo
if ((getPlayerUID player) in ["198544070"]) then {  //Pro-Donators AS50 Custom: Gizmo
DefaultMagazines = ["ItemBandage","ItemBandage","ItemBandage","ItemPainkiller","FoodSteakCooked","ItemWatterBottle","ItemMorphine","ItemBloodbag","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","20Rnd_762x51_B_scar","20Rnd_762x51_B_scar","20Rnd_762x51_B_scar","20Rnd_762x51_B_scar","20Rnd_762x51_B_scar","Skin_GUE_Commander_DZ"];
DefaultWeapons = ["ItemToolbox","Binocular_Vector","NVGoggles","ItemGPS","ItemCompass","ItemKnife","ItemEtool","M9SD","SCAR_H_CQC_CCO","ItemHatchet","ItemFlashlightRed"];
	DefaultBackpack = "DZ_LargeGunBag_EP1";
	DefaultBackpackWeapon = "";
	};

//Advanced Donator Loadout USMC Sniper
if ((getPlayerUID player) in [""93836038""]) then {   //Donators: Keks R Us
	DefaultMagazines = ["20Rnd_762x51_DMR","20Rnd_762x51_DMR","20Rnd_762x51_DMR","20Rnd_762x51_DMR","20Rnd_762x51_DMR","20Rnd_762x51_DMR","ItemBandage","ItemBandage","ItemBandage","ItemBandage","17Rnd_9x19_glock17","17Rnd_9x19_glock17","17Rnd_9x19_glock17","17Rnd_9x19_glock17","ItemPainkiller","ItemMorphine","ItemAntibiotic","FoodSteakCooked","ItemSodaPepsi"];
	DefaultWeapons = ["Binocular_Vector","NVGoggles","ItemGPS","ItemCompass","ItemFlashlightRed","ItemKnife","ItemHatchet","ItemEtool","ItemToolbox","DMR","glock17_EP1"];
	DefaultBackpack = "DZ_Backpack_EP1";
	DefaultBackpackWeapon = "";
	};

//Donator Loadout USMC Assault
if ((getPlayerUID player) in ["167074310"]) then {  //USMC Donators: Jac_2001nz
	DefaultMagazines = ["ItemBandage","ItemBandage","ItemBandage","ItemBandage","ItemPainkiller","ItemMorphine","ItemAntibiotic","FoodSteakCooked","ItemSodaPepsi","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD"];
	DefaultWeapons = ["Binocular_Vector","NVGoggles","ItemGPS","ItemCompass","ItemFlashlightRed","ItemKnife","ItemHatchet","ItemEtool","ItemToolbox","M4A3_CCO_EP1","M9SD"];
	DefaultBackpack = "DZ_GunBag_EP1";
	DefaultBackpackWeapon = "";
	};

 

Then call it in your Init.sqf Between the 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";	
	

So it looks like:

 

if (!isDedicated) then {
	//Conduct map operations
	0 fadeSound 0;
	waitUntil {!isNil "dayz_loadScreenMsg"};
	dayz_loadScreenMsg = (localize "STR_AUTHENTICATING");

	//Custom Loadouts
	[] ExecVM "loadouts.sqf";

	//Run the player monitor
	_id = player addEventHandler ["Respawn", {_id = [] spawn player_death;}];
	_playerMonitor = 	[] execVM "\z\addons\dayz_code\system\player_monitor.sqf";	
	 

or

if (!isDedicated) then {
	//Conduct map operations
	0 fadeSound 0;
	waitUntil {!isNil "dayz_loadScreenMsg"};
	dayz_loadScreenMsg = (localize "STR_AUTHENTICATING");

	//Custom Loadouts
	[] ExecVM "scripts/loadout.sqf";

	//Run the player monitor
	_id = player addEventHandler ["Respawn", {_id = [] spawn player_death;}];
	_playerMonitor = 	[] execVM "\z\addons\dayz_code\system\player_monitor.sqf";	
	 

If you follow the other tutorial (I choose not to have another useless folder)

 

It works absolutely brilliant on my server.

All credit for this goes to Mysticviperx

 

 

Is there a max number of "If" statements that can be used? Im trying to set this up and my first one or two work but the last ones dont.

 

Im just working my way through the list trying them all but it takes a while as have to keep restarting the server etc

Link to comment
Share on other sites

  • 0

@mathewjknott I don't believe there is, Since posting this I have added another 2 Donator kits to it, and they work fine.
It's a strange script, If you have misspelled or phrased a classname wrong, that loadout wont work, but the rest will. Just double check that all the classnames are correct aswell as player ID's, and that the line doesn't end with a comma ',' before ].

I'll give you an example, Yesterday I set up a loadout for the MK17 EGLM, and set the magazines as 20rnd_772x51_B_SCAR when it should be 20rnd_762x51_B_SCAR.

You should be able to easily copy one of the loadouts and use it as a template of others.

If you want, I can have a look at them for you.

 

Link to comment
Share on other sites

  • 0

I'm working on having a file fully set up with all different variations of donation load outs so all I have to do is add the uid in to the correct one etc.

I can't see any error so I'm currently testing every option... just takes its time as have to keep restarting my local server etc.

I'm almost half way through and they all worked so far so fingers crossed I'll find the error soon

Link to comment
Share on other sites

  • 0

Is there a max number of "If" statements that can be used? Im trying to set this up and my first one or two work but the last ones dont.

 

Im just working my way through the list trying them all but it takes a while as have to keep restarting the server etc

 

Personally i would use a switch:

switch (getPlayerUID player) do {
case ("12314215"):{ //loadout here};
case ("23145215"):{ //another loadout};
case default: {//default loadout}

but then again, I wouldnt use the default loadout vars to give donators stuff

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