Got my custom loadouts to work perfect and figured I would share the code as I see a lot of people having trouble with this type of code and it not working all the time under server stress and 50+ players.
Step 1: Create a folder name Scripts and place it in the root of your mission pbo. (If you don't already have one)
Step 2: Create a file named custloadout.sqf and place this code inside. Place the custloadout.sqf inside the Scripts folder. (You can name it what ever you want just be sure to change the name also inside the init.sqf)
Replace the "111111111111111" with your player(s) UID.
My loadout.sqf
waitUntil {(getPlayerUID player) != ""};
_loadList = ["111111111111111","222222222222222","333333333333333"];
_lpID = getPlayerUID player;
//CL1 *** player ***
if ((_lpID in ["111111111111111"]) && (_lpID in _loadList)) then {
DefaultMagazines = ["5Rnd_86x70_L115A1","Skin_Soldier1_DZ"];
DefaultWeapons = ["ItemCompass","BAF_LRR_scoped"];
DefaultBackpack = "DZ_largeGunBag_EP1";
DefaultBackpackItems = ["BAF_LRR_scoped","5Rnd_86x70_L115A1","5Rnd_86x70_L115A1"];
};
//CL2 *** player ***
if ((_lpID in ["222222222222222"]) && (_lpID in _loadList)) then {
DefaultMagazines = ["5Rnd_86x70_L115A1","Skin_Soldier1_DZ"];
DefaultWeapons = ["ItemCompass","BAF_LRR_scoped"];
DefaultBackpack = "DZ_largeGunBag_EP1";
DefaultBackpackItems = ["BAF_LRR_scoped","5Rnd_86x70_L115A1","5Rnd_86x70_L115A1"];
};
//CL3 *** player ***
if ((_lpID in ["333333333333333"]) && (_lpID in _loadList)) then {
DefaultMagazines = ["5Rnd_86x70_L115A1","Skin_Soldier1_DZ"];
DefaultWeapons = ["ItemCompass","BAF_LRR_scoped"];
DefaultBackpack = "DZ_largeGunBag_EP1";
DefaultBackpackItems = ["BAF_LRR_scoped","5Rnd_86x70_L115A1","5Rnd_86x70_L115A1"];
};
Step 3: Inside your Init.sqf inside the if (! isDedicated) then {
Place this. [] execVM "Scripts\custloadout.sqf"; (Be sure to change the name to what ever you named your custloadout.sqf)
These are all just examples, be sure to change to what you want them to be.
I have done this for 60+ loadouts and works with high amounts of server lag and 50+ players on server. Have yet to have any player not get there loadout.
EDIT:
This is still working perfect with new steam UID's and updates.
Question
syco
Got my custom loadouts to work perfect and figured I would share the code as I see a lot of people having trouble with this type of code and it not working all the time under server stress and 50+ players.
Step 1: Create a folder name Scripts and place it in the root of your mission pbo. (If you don't already have one)
Step 2: Create a file named custloadout.sqf and place this code inside. Place the custloadout.sqf inside the Scripts folder. (You can name it what ever you want just be sure to change the name also inside the init.sqf)
Replace the "111111111111111" with your player(s) UID.
My loadout.sqf
Step 3: Inside your Init.sqf inside the if (! isDedicated) then {
Place this. [] execVM "Scripts\custloadout.sqf"; (Be sure to change the name to what ever you named your custloadout.sqf)
My Init.sqf
For default loadout just place this inside your init.sqf inside your mission file in between dayz_MapArea and dayz_paraSpawn like this
These are all just examples, be sure to change to what you want them to be.
I have done this for 60+ loadouts and works with high amounts of server lag and 50+ players on server. Have yet to have any player not get there loadout.
EDIT:
This is still working perfect with new steam UID's and updates.
Link to comment
Share on other sites
8 answers to this question
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now