Guest User

Untitled

a guest
Dec 7th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. //Test call to see if it worked
  2. diag_log("Testing call to get custom loadout");
  3. diag_log("Unique_id: "+str(_playerID));
  4. _key = format["CHILD:666:%1:",_playerID];
  5. _customloadout = [_key,false,dayZ_hivePipeAuth] call server_hiveReadWrite;
  6. _custominventory = _customloadout select 0;
  7. _custombackpack = _customloadout select 1;
  8. _custommodel = _customloadout select 2;
  9. diag_log("Call to get loadout made, here are results: Inventory? " + str(_custominventory) + " Backpack? " + str(_custombackpack) + " Model? " + str(_custommodel)); //Maybe custom backpack in future
  10.  
  11. //Record initial inventory
  12. _config = (configFile >> "CfgSurvival" >> "Inventory" >> "Default");
  13. _mags = getArray (_config >> "magazines");
  14. _wpns = getArray (_config >> "weapons");
  15. _bcpk = getText (_config >> "backpack");
  16. _randomSpot = true;
  17. _dbLoadout = [_wpns,_mags];
  18. if (str(initialLoadout) != "[]") then {
  19. _inventory = initialLoadout;
  20. _dbLoadout = _inventory;
  21. };
  22. //Wait for HIVE to be free
  23. //Load in custom loadout if found
  24.  
  25. if (count _customInventory == 0) then {
  26. _key = format["CHILD:203:%1:%2:%3:",_charID,_dbLoadout,[_bcpk,[],[]]];
  27. _key spawn server_hiveWrite;
  28. } else {
  29. diag_log("LOADING IN CUSTON LOADOUT");
  30. _inventory = _custominventory;
  31. _dbLoadout = _inventory;
  32. diag_log("bcpk before: " + str(_bcpk));
  33. _bcpk = _custombackpack;
  34. diag_log("bcpk after: " + str(_bcpk));
  35. diag_log("model before: " + str(_model));
  36. _model = _custommodel;
  37. diag_log("model after: " + str(_model));
  38. _backpack = [_bcpk,[[],[]],[[],[]]];
  39. _key = format["CHILD:203:%1:%2:%3:",_charID,_dbLoadout,[_bcpk,[],[]]];
  40. _key spawn server_hiveWrite;
  41. };
Add Comment
Please, Sign In to add comment