Loadout Selection on Spawn

dunx1976

New Member
I've had this running on my server for a while now, thought i should give back to the community :)

This creates a scroll menu on player spawn so they can choose their own loadout to suit each persons play style.

1. Open dayz_server.pbo\complile\server_playerSetup.sqf
Find the following;
Code:
dayzPlayerLogin2 = [_worldspace,_state];

Change this to;
Code:
dayzPlayerLogin2 = [_worldspace,_state,_randomSpot];

Now download the following file;
http://www.dunx1976.webspace.virginmedia.com/misc/Loadout_select.rar

Unrar, and place the LOADOUT folder into your Mission.pbo

Now, open dayz_X.chernarus\init.sqf

At the very bottom enter the following
PHP:
if (!isDedicated) then {
waitUntil { !isNil ("dayz_animalCheck") and
!(player getVariable ["humanity",0] > 5000 and
typeOf player == "Survivor2_DZ") and
!(player getVariable ["humanity",0] < -2000 and
(typeOf player == "Survivor2_DZ" or
typeOf player == "SurvivorW2_DZ") ) and
!(player getVariable ["humanity",0] > 0 and
(typeOf player == "Bandit1_DZ" or
typeOf player == "BanditW1_DZ") )
};
    if (dayzPlayerLogin2 select 2) then
    {
        sleep 5;
        loadoutAction = player addaction [("<t color=""#0074E8"">" + ("Select Class") +"</t>"),"loadout\select.sqf","",5,false,true,"",""];
        sleep 4;
        cutText ["To select your loadout, just choose "loadout" on the Scroll menu", "PLAIN DOWN"];
}
};
Repack both the server.pbo and the mission.pbo
Upload, and enjoy.

Included in the rar is a txt with a few of the classnames, ammo, etc.

Be careful as you will need to name each item correctly (player addweapon/player addMagazine), with a little bit of thought, this is quite simple.

Ty for the code to...Hangender i think (original halo spawn scriptor?)...before that i had a rather long winded approach at this.
 
I've had this running on my server for a while now, thought i should give back to the community :)

This creates a scroll menu on player spawn so they can choose their own loadout to suit each persons play style.

1. Open dayz_server.pbo\complile\server_playerSetup.sqf
Find the following;
Code:
dayzPlayerLogin2 = [_worldspace,_state];

Change this to;
Code:
dayzPlayerLogin2 = [_worldspace,_state,_randomSpot];

Now download the following file;
http://www.dunx1976.webspace.virginmedia.com/misc/Loadout_select.rar

Unrar, and place the LOADOUT folder into your Mission.pbo

Now, open dayz_X.chernarus\init.sqf

At the very bottom enter the following
PHP:
if (!isDedicated) then {
waitUntil { !isNil ("dayz_animalCheck") and
!(player getVariable ["humanity",0] > 5000 and
typeOf player == "Survivor2_DZ") and
!(player getVariable ["humanity",0] < -2000 and
(typeOf player == "Survivor2_DZ" or
typeOf player == "SurvivorW2_DZ") ) and
!(player getVariable ["humanity",0] > 0 and
(typeOf player == "Bandit1_DZ" or
typeOf player == "BanditW1_DZ") )
};
    if (dayzPlayerLogin2 select 2) then
    {
        sleep 5;
        loadoutAction = player addaction [("<t color=""#0074E8"">" + ("Select Class") +"</t>"),"loadout\select.sqf","",5,false,true,"",""];
        sleep 4;
        cutText ["To select your loadout, just choose "loadout" on the Scroll menu", "PLAIN DOWN"];
}
};
Repack both the server.pbo and the mission.pbo
Upload, and enjoy.

Included in the rar is a txt with a few of the classnames, ammo, etc.

Be careful as you will need to name each item correctly (player addweapon/player addMagazine), with a little bit of thought, this is quite simple.

Ty for the code to...Hangender i think (original halo spawn scriptor?)...before that i had a rather long winded approach at this.



Can't get this to work....Did everything above, but there's no menu.
 
I'm not running antihax and still not working. Will try again tomorrow. Is it something to do with dayz.st?
 
If you are running antihax you need to add "loadoutAction" to the removeactions whitelist and "#USER:loadoutMenu" to the menu whitelist. So it should look like this:
Code:
"+_tlmrand18+" = true;
        while {"+_tlmrand18+"} do
        {
            _cMenuDefault = ["""",""RscMainMenu"",""RscMoveHigh"",""#WATCH"",""#WATCH0"",""RscWatchDir"",""RscWatchMoreDir"",""#GETIN"",""RscStatus"",""RscCallSupport"",""#ACTION"",""RscCombatMode"",""RscFormations"",""RscTeam"",""RscSelectTeam"",""RscReply"",""#CUSTOM_RADIO"",""RscRadio"",""RscGroupRootMenu"",""#USER:loadoutMenu""];
            if !(commandingMenu in _cMenuDefault) then {showCommandingMenu """";};
            _tempRemoveAction = player addAction ["""", """", [], 1, false, true, """", ""false""];
            _startRemove = _tempRemoveAction - 35;
            _endRemove = _tempRemoveAction + 50;
for '_i' from _startRemove to _endRemove do
            {
                _dayzActions = (s_player_repairActions + r_player_actions2 + r_player_actions +
                [s_player_holderPickup,s_player_fillfuel5,s_player_fillfuel20,s_player_grabflare,s_player_removeflare,s_player_deleteBuild,s_player_forceSave,
                s_player_flipveh,s_player_fillfuel,s_player_dropflare,s_player_butcher,s_player_cook,
                s_player_boil,s_player_fireout,null,s_player_packtent,s_player_sleep,s_player_studybody,NORRN_dropAction,loadoutAction]);
                if (!(_i in _dayzActions) and (_i > -1)) then {player removeAction _i};
            };




where is this code standing? i may ask
 
I don't see why all of the humanity restrictions have the !, that just means its making sure that your humanity is NOT over 5000, not under -2000, and not over 0...so according to that this would only be able to be utilized if your humanity is in between -2000 and 0...right?

In reference to the init section

Also in reference to OP...why aren't you using something like
Code:
waitUntil {!isNil ("PVDZ_plr_LoginRecord")};
because without that...won't the option be available to anyone who logs in, and not just newspawns?
 
I don't see why all of the humanity restrictions have the !, that just means its making sure that your humanity is NOT over 5000, not under -2000, and not over 0...so according to that this would only be able to be utilized if your humanity is in between -2000 and 0...right?

In reference to the init section

Also in reference to OP...why aren't you using something like
Code:
waitUntil {!isNil ("PVDZ_plr_LoginRecord")};
because without that...won't the option be available to anyone who logs in, and not just newspawns?


does the scroll menu works for you? matt
 
I havn't tested myself due to a lack of a server at the moment.

Hmm Okey i just tested by my self on my server but seems doesnt work? i added everything correctly into the file's & packed up again pbo's & uploaded them & when i go into server the scroll menu doesnt show up for some reason hmm..
 
Hmm Okey i just tested by my self on my server but seems doesnt work? i added everything correctly into the file's & packed up again pbo's & uploaded them & when i go into server the scroll menu doesnt show up for some reason hmm..

I seriously think OP's script is bugged. No one has been able to get it to work following the tut provided. Try replacing the init.sqf portion of the tut with http://pastebin.com/AtzT0PJ8 No guarentees it will work. (note if I did it right, you will only get an option if you are a FRESH spawn, meaning you'll have to kill yourself to test it.)

TBH I don't even know why all the humanity checks are even there. Like its not necessary at all, for loadout selection you would want everyone (obviously unless you add playerUID restrictions to it) to have access to it.
 
I seriously think OP's script is bugged. No one has been able to get it to work following the tut provided. Try replacing the init.sqf portion of the tut with http://pastebin.com/AtzT0PJ8 No guarentees it will work. (note if I did it right, you will only get an option if you are a FRESH spawn, meaning you'll have to kill yourself to test it.)


Already killed my self few times and still wont work.. this would be nice to have into my server for the new players that are joining. like u said the OP's Script is bugged out. but i'll look into it
 
Already killed my self few times and still wont work.. this would be nice to have into my server for the new players that are joining. like u said the OP's Script is bugged out. but i'll look into it

Try getting rid of the init portion entirely and just placing http://pastebin.com/k66Sv3fu at the bottom. That's all thats really necessary.

and like it was mentioned above you do have to have the menu whitelisted in any anti hacks that you may be using
 
the point is just it wont work for some reason ( my head is going crazy atm )
but i am working on few other things atm

it wont work because the waitUntil variables were not being met, therefore no scroll option. The one I pasted above
Try getting rid of the init portion entirely and just placing http://pastebin.com/k66Sv3fu at the bottom. That's all thats really necessary.

and like it was mentioned above you do have to have the menu whitelisted in any anti hacks that you may be using
Has no waitUntil variables except one that I KNOW works from past experience.
 
Back
Top