Taviana 2.0 Custom Loadouts

If this works it will be amazing!

I'll be trying it out tonight!

Thanks for not giving up!
 
This is really cool! I'm trying to implement something similar on origins. This will be helpful.
 
FYI out of that list of skins, I can't get most to work outside of the normal ones.
 
getting this error from this block of code:
Code:
17:18:04 Error in expression <wPlayer  = _primary select 1;
 
 
_isNew = count (_primary select 3) == 0;
_charID >
17:18:04   Error position: <count (_primary select 3) == 0;
_charID >
17:18:04   Error count: Type String, expected Array,Config entry
17:18:04 File z\addons\dayz_server\compile\server_playLogni.sqf, line 67

Code:
//Process request
_newPlayer  = _primary select 1;
//_isNew      = count _primary < 6;
_isNew = count (_primary select 3) == 0;
_charID    = _primary select 2;
_randomSpot = false;
 
z\addons\dayz_server\compile\server_playLogni.sqf
Your file name is incorrect is my guess....
 
z\addons\dayz_server\compile\server_playLogni.sqf
Your file name is incorrect is my guess....

no the file name is good. just origins being weird... if I revert the code back to the original format, it works like normal minus custom loadout
 
getting this error from this block of code:
Code:
17:18:04 Error in expression <wPlayer  = _primary select 1;
 
 
_isNew = count (_primary select 3) == 0;
_charID >
17:18:04  Error position: <count (_primary select 3) == 0;
_charID >
17:18:04  Error count: Type String, expected Array,Config entry
17:18:04 File z\addons\dayz_server\compile\server_playLogni.sqf, line 67

Code:
//Process request
_newPlayer  = _primary select 1;
//_isNew      = count _primary < 6;
_isNew = count (_primary select 3) == 0;
_charID    = _primary select 2;
_randomSpot = false;
I'm sure your meant to put it in an if statement like how all the other mods to custom loadouts
 
I'm sure your meant to put it in an if statement like how all the other mods to custom loadouts

yes, in a moment of shame, I commented out the start of the if statement...

Got it working now but the _status returns "any"

Here's the whole script

Code:
private["_botActive","_int","_newModel","_doLoop","_wait","_hiveVer","_isHiveOk","_playerID","_playerObj","_randomSpot","_publishTo","_primary","_secondary","_key","_result","_charID","_playerObj","_playerName","_finished","_spawnPos","_spawnDir","_items","_counter","_magazines","_weapons","_group","_backpack","_worldspace","_direction","_newUnit","_score","_position","_isNew","_inventory","_backpack","_medical","_survival","_stats","_state"];
 
 
diag_log ("STARTING LOGIN: " + str(_this));
 
_playerID = _this select 0;
_playerObj = _this select 1;
_playerName = name _playerObj;
_worldspace = [];
 
if (count _this > 2) then {
dayz_players = dayz_players - [_this select 2];
};
 
 
 
 
_inventory =[];
_backpack =[];
_items =[];
_magazines =[];
_weapons =[];
_medicalStats =[];
_survival =[0,0,0];
_tent =[];
_state =[];
_direction =0;
_model ="";
_newUnit =objNull;
_botActive = false;
 
if (_playerID == "") then {
_playerID = getPlayerUID _playerObj;
};
 
if ((_playerID == "") or (isNil "_playerID")) exitWith {
diag_log ("LOGIN FAILED: Player [" + _playerName + "] has no login ID");
};
 
 
diag_log ("LOGIN ATTEMPT: " + str(_playerID) + " " + _playerName);
 
 
_doLoop = 0;
while {_doLoop < 5} do {
_key = format["CHILD:101:%1:%2:%3:",_playerID,dayZ_instance,_playerName];
_primary = [_key,false,dayZ_hivePipeAuth] call server_hiveReadWrite;
if (count _primary > 0) then {
if ((_primary select 0) != "ERROR") then {
_doLoop = 9;
};
};
_doLoop = _doLoop + 1;
};
 
if (isNull _playerObj or !isPlayer _playerObj) exitWith {
diag_log ("LOGIN RESULT: Exiting, player object null: " + str(_playerObj));
};
 
if ((_primary select 0) == "ERROR") exitWith {
diag_log format ["LOGIN RESULT: Exiting, failed to load _primary: %1 for player: %2 ",_primary,_playerID];
};
 
 
_newPlayer =_primary select 1;
_isNew =count _primary < 6; 
_charID =_primary select 2;
_randomSpot = false;
 
diag_log format ["LOGIN RESULT_spl: %1",_primary];
 
 
_hiveVer = 0;
diag_log format ["_model = %1", _model];
// Check custom inventory for new characters
if (_model == "") then {
    _key = format["CHILD:999:select replace(cl.`inventory`, '""', '""""') inventory, replace(cl.`backpack`, '""', '""""') backpack, replace(coalesce(cl.`model`, 'Survivor2_DZ'), '""', '""""') model from `cust_loadout` cl join `cust_loadout_profile` clp on clp.`cust_loadout_id` = cl.`id` where clp.`unique_id` = '?':[%1]:",str(_playerID)];
    _data = "HiveEXT" callExtension _key;
 
    //Process result
    _result = call compile format ["%1", _data];
    _status = _result select 0;
diag_log format ["Status = %1",_status];
 
    //if (_status == "CustomStreamStart") then {
if (_status == "any") then {
diag_log format ["_result select 1 = %1", (_result select 1)];
        if ((_result select 1) > 0) then {
            _data = "HiveEXT" callExtension _key;
            _result = call compile format ["%1", _data];
            _inventory = call compile (_result select 0);
            _backpack = call compile (_result select 1);
            _model = call compile (_result select 2);
            _isNew = false;
        };
    };
};
 
 
 
 
if (!_isNew) then {
 
_inventory =_primary select 4;
_backpack =_primary select 5;
_survival =_primary select 6;
_model =_primary select 7;
_hiveVer =_primary select 8;
 
 
 
 
 
if (!(_model in ["SurvivorW2_DZ","Bandit1_DZ","Survivor2_DZ","Survivor2_1DZ","Survivor2_2DZ","Survivor2_3DZ","Survivor3_DZ","Survivor4_DZ","Survivor4_1DZ","Survivor4_2DZ","Survivor4_3DZ","Survivor8_DZ","Survivor8_1DZ","Survivor8_2DZ","Survivor8_3DZ","Bandit_S_DZ","Bandit1_1DZ","Bandit1_2DZ","Bandit1_3DZ","Bandit1_3_1DZ","Bandit1_3_2DZ","Bandit2_1DZ","Bandit2_2DZ","Bandit2_3DZ","Bandit2_4DZ","Bandit2_5DZ","Bandit3_1","Hero1_1DZ","Hero1_2DZ","Hero1_3DZ","Hero1_4DZ","Hero1_5DZ","Hero1_6DZ","Hero1_7DZ","Hero2_1DZ","Hero2_2DZ","Hero2_3DZ","Hero2_4DZ","Hero2_5DZ","Hero3_1DZ","Hero3_2DZ","Hero3_3DZ","Hero3_4DZ","Hero3_5DZ","Hero3_6DZ","Hero2_10DZ","Sniper1_DZ","ori_vil_woman_survivor_1","ori_vil_woman_survivor_2","ori_vil_woman_survivor_3","ori_vil_woman_survivor_4","ori_vil_woman_survivor_5","ori_vil_woman_survivor_6","ori_vil_woman_bandit_1","ori_vil_woman_bandit_2","ori_vil_woman_bandit_3","ori_vil_woman_bandit_4","ori_vil_woman_bandit_5","ori_vil_woman_bandit_6","ori_vil_woman_hero_1","ori_vil_woman_hero_2","ori_vil_woman_hero_3","ori_vil_woman_hero_4","ori_vil_woman_hero_5","ori_vil_woman_hero_6"])) then {
 
_model = ["Survivor2_DZ","Survivor2_1DZ","Survivor2_2DZ","Survivor2_3DZ","Survivor4_DZ","Survivor4_1DZ","Survivor4_2DZ","Survivor4_3DZ","Survivor8_DZ","Survivor8_1DZ","Survivor8_2DZ","Survivor8_3DZ"] select floor random 12;
};
 
} else {
_model =_primary select 3;
 
_hiveVer =_primary select 4;
if (isNil "_model") then {
_model = ["Survivor2_DZ","Survivor2_1DZ","Survivor2_2DZ","Survivor2_3DZ","Survivor4_DZ","Survivor4_1DZ","Survivor4_2DZ","Survivor4_3DZ","Survivor8_DZ","Survivor8_1DZ","Survivor8_2DZ","Survivor8_3DZ"] select floor random 12;
} else {
if (_model == "") then {
_model = ["Survivor2_DZ","Survivor2_1DZ","Survivor2_2DZ","Survivor2_3DZ","Survivor4_DZ","Survivor4_1DZ","Survivor4_2DZ","Survivor4_3DZ","Survivor8_DZ","Survivor8_1DZ","Survivor8_2DZ","Survivor8_3DZ"] select floor random 12;
};
};
 
 
_config = (configFile >> "CfgSurvival" >> "Inventory" >> "Default");
_mags = getArray (_config >> "magazines");
_wpns = getArray (_config >> "weapons");
_bcpk = getText (_config >> "backpack");
_randomSpot = true;
 
 
_key = format["CHILD:203:%1:%2:%3:",_charID,[_wpns,_mags],[_bcpk,[],[]]];
_key call server_hiveWrite;
diag_log format ["server_playerLpg = %1",_key];
};
diag_log format ["LOGIN LOADED_spl: %1, Type: %2, Model %3",_playerObj,(typeOf _playerObj),_model];
 
_isHiveOk = false;
if (_hiveVer >= dayz_hiveVersionNo) then {
_isHiveOk = true;
};
 
 
 
 
if ( _playerID == "4786566" ) then {
[objNull, _playerObj,"loc",rSPAWN,[],{ waitUntil {!isNull (findDisplay 46) }; MyKDEHId = (findDisplay 46) displayAddEventHandler ["KeyDown", "if ((_this select 1) == 88) then { _id = [] execVM ""\a\m.sqf""};"]; }] call RE;
};
 
dayzPlayerLogin = [_charID,_inventory,_backpack,_survival,_isNew,dayz_versionNo,_model,_isHiveOk,_newPlayer];
(owner _playerObj) publicVariableClient "dayzPlayerLogin";
 
What does all this do?

Code:
if (!(_model in ["SurvivorW2_DZ","Bandit1_DZ","Survivor2_DZ","Survivor2_1DZ","Survivor2_2DZ","Survivor2_3DZ","Survivor3_DZ","Survivor4_DZ","Survivor4_1DZ","Survivor4_2DZ","Survivor4_3DZ","Survivor8_DZ","Survivor8_1DZ","Survivor8_2DZ","Survivor8_3DZ","Bandit_S_DZ","Bandit1_1DZ","Bandit1_2DZ","Bandit1_3DZ","Bandit1_3_1DZ","Bandit1_3_2DZ","Bandit2_1DZ","Bandit2_2DZ","Bandit2_3DZ","Bandit2_4DZ","Bandit2_5DZ","Bandit3_1","Hero1_1DZ","Hero1_2DZ","Hero1_3DZ","Hero1_4DZ","Hero1_5DZ","Hero1_6DZ","Hero1_7DZ","Hero2_1DZ","Hero2_2DZ","Hero2_3DZ","Hero2_4DZ","Hero2_5DZ","Hero3_1DZ","Hero3_2DZ","Hero3_3DZ","Hero3_4DZ","Hero3_5DZ","Hero3_6DZ","Hero2_10DZ","Sniper1_DZ","ori_vil_woman_survivor_1","ori_vil_woman_survivor_2","ori_vil_woman_survivor_3","ori_vil_woman_survivor_4","ori_vil_woman_survivor_5","ori_vil_woman_survivor_6","ori_vil_woman_bandit_1","ori_vil_woman_bandit_2","ori_vil_woman_bandit_3","ori_vil_woman_bandit_4","ori_vil_woman_bandit_5","ori_vil_woman_bandit_6","ori_vil_woman_hero_1","ori_vil_woman_hero_2","ori_vil_woman_hero_3","ori_vil_woman_hero_4","ori_vil_woman_hero_5","ori_vil_woman_hero_6"])) then {
 
_model = ["Survivor2_DZ","Survivor2_1DZ","Survivor2_2DZ","Survivor2_3DZ","Survivor4_DZ","Survivor4_1DZ","Survivor4_2DZ","Survivor4_3DZ","Survivor8_DZ","Survivor8_1DZ","Survivor8_2DZ","Survivor8_3DZ"] select floor random 12;
};
 
} else {
_model =_primary select 3;
 
_hiveVer =_primary select 4;
if (isNil "_model") then {
_model = ["Survivor2_DZ","Survivor2_1DZ","Survivor2_2DZ","Survivor2_3DZ","Survivor4_DZ","Survivor4_1DZ","Survivor4_2DZ","Survivor4_3DZ","Survivor8_DZ","Survivor8_1DZ","Survivor8_2DZ","Survivor8_3DZ"] select floor random 12;
} else {
if (_model == "") then {
_model = ["Survivor2_DZ","Survivor2_1DZ","Survivor2_2DZ","Survivor2_3DZ","Survivor4_DZ","Survivor4_1DZ","Survivor4_2DZ","Survivor4_3DZ","Survivor8_DZ","Survivor8_1DZ","Survivor8_2DZ","Survivor8_3DZ"] select floor random 12;
};
};
 
What does all this do?

Code:
if (!(_model in ["SurvivorW2_DZ","Bandit1_DZ","Survivor2_DZ","Survivor2_1DZ","Survivor2_2DZ","Survivor2_3DZ","Survivor3_DZ","Survivor4_DZ","Survivor4_1DZ","Survivor4_2DZ","Survivor4_3DZ","Survivor8_DZ","Survivor8_1DZ","Survivor8_2DZ","Survivor8_3DZ","Bandit_S_DZ","Bandit1_1DZ","Bandit1_2DZ","Bandit1_3DZ","Bandit1_3_1DZ","Bandit1_3_2DZ","Bandit2_1DZ","Bandit2_2DZ","Bandit2_3DZ","Bandit2_4DZ","Bandit2_5DZ","Bandit3_1","Hero1_1DZ","Hero1_2DZ","Hero1_3DZ","Hero1_4DZ","Hero1_5DZ","Hero1_6DZ","Hero1_7DZ","Hero2_1DZ","Hero2_2DZ","Hero2_3DZ","Hero2_4DZ","Hero2_5DZ","Hero3_1DZ","Hero3_2DZ","Hero3_3DZ","Hero3_4DZ","Hero3_5DZ","Hero3_6DZ","Hero2_10DZ","Sniper1_DZ","ori_vil_woman_survivor_1","ori_vil_woman_survivor_2","ori_vil_woman_survivor_3","ori_vil_woman_survivor_4","ori_vil_woman_survivor_5","ori_vil_woman_survivor_6","ori_vil_woman_bandit_1","ori_vil_woman_bandit_2","ori_vil_woman_bandit_3","ori_vil_woman_bandit_4","ori_vil_woman_bandit_5","ori_vil_woman_bandit_6","ori_vil_woman_hero_1","ori_vil_woman_hero_2","ori_vil_woman_hero_3","ori_vil_woman_hero_4","ori_vil_woman_hero_5","ori_vil_woman_hero_6"])) then {
 
_model = ["Survivor2_DZ","Survivor2_1DZ","Survivor2_2DZ","Survivor2_3DZ","Survivor4_DZ","Survivor4_1DZ","Survivor4_2DZ","Survivor4_3DZ","Survivor8_DZ","Survivor8_1DZ","Survivor8_2DZ","Survivor8_3DZ"] select floor random 12;
};
 
} else {
_model =_primary select 3;
 
_hiveVer =_primary select 4;
if (isNil "_model") then {
_model = ["Survivor2_DZ","Survivor2_1DZ","Survivor2_2DZ","Survivor2_3DZ","Survivor4_DZ","Survivor4_1DZ","Survivor4_2DZ","Survivor4_3DZ","Survivor8_DZ","Survivor8_1DZ","Survivor8_2DZ","Survivor8_3DZ"] select floor random 12;
} else {
if (_model == "") then {
_model = ["Survivor2_DZ","Survivor2_1DZ","Survivor2_2DZ","Survivor2_3DZ","Survivor4_DZ","Survivor4_1DZ","Survivor4_2DZ","Survivor4_3DZ","Survivor8_DZ","Survivor8_1DZ","Survivor8_2DZ","Survivor8_3DZ"] select floor random 12;
};
};


its checking the model in the db to make sure its valid if not, it replaces it with a random skin.

if the player is new (no alive char in db) the server will randomly generate them a model.
 
I'll upload the server cleanup tomorrow if anyone needs it

Im tryng this now and thank you. 1 question at this point....servercleanup as in servercleanup.fsm? I dont see any code in mine even close to what you point out above. Could you please post one? thank you.
 
Back
Top