Separate virtual arsenal contents for each player?

Separate virtual arsenal contents for each player?

« posted: Dec 12, 2017, 04:07 AM »
Hey,
I'm trying to make virtual arsenal money based loadouts. What i have now:
arsenalMain.sqf (one i'm calling from functions\playerSpawn.sqf)
arsenalMain = "addons\arsenal\arsenalMain.sqf" call mf_compile;
in client\functions\clientCompile.sqf
Code: [Select]
_playerBankMoney = player getVariable ["bmoney", 0];
systemChat format["total money $%1",_playerBankMoney];
if ((_playerBankMoney > 0) && (_playerBankMoney < 1000000)) exitWith
{
systemChat format["call arsenalLevel1 total money $%1",_playerBankMoney];
call arsenalLevel1;
};
if ((_playerBankMoney >= 1000000) && (_playerBankMoney < 1999999)) exitWith
{
systemChat format["call arsenalLevel2 total money $%1",_playerBankMoney];
call arsenalLevel2;
};

arsenalLevel1.sqf
declared in arsenalLevel1 = "addons\arsenal\arsenalLevel1.sqf" call mf_compile;
in client\functions\clientCompile.sqf
Code: [Select]
_crate = "Box_East_Ammo_F";
[nil, _crate] call BIS_fnc_arsenal;

[_crate,[true]] call BIS_fnc_removeVirtualBackpackCargo;
[_crate,[true]] call BIS_fnc_removeVirtualItemCargo;
[_crate,[true]] call BIS_fnc_removeVirtualWeaponCargo;
[_crate,[true]] call BIS_fnc_removeVirtualMagazineCargo;

_virtualWeaponCargo = [];
_virtualWeaponCargo = call pistolArrayLevel1;

[_crate,_virtualWeaponCargo] call BIS_fnc_addVirtualWeaponCargo;

arsenalLevel2.sqf
declared in arsenalLevel2 = "addons\arsenal\arsenalLevel2.sqf" call mf_compile;
in client\functions\clientCompile.sqf
Code: [Select]
_crate = "Box_East_Ammo_F";
[nil, _crate] call BIS_fnc_arsenal;

[_crate,[true]] call BIS_fnc_removeVirtualBackpackCargo;
[_crate,[true]] call BIS_fnc_removeVirtualItemCargo;
[_crate,[true]] call BIS_fnc_removeVirtualWeaponCargo;
[_crate,[true]] call BIS_fnc_removeVirtualMagazineCargo;

_virtualWeaponCargo = [];
_virtualWeaponCargo = call pistolArrayLevel1 + call pistolArrayLevel2;

[_crate,_virtualWeaponCargo] call BIS_fnc_addVirtualWeaponCargo;

gearList.sqf declared in client\init.sqf
call compile preprocessFileLineNumbers "addons\arsenal\gearList.sqf";
Code: [Select]
pistolArrayLevel1 = compileFinal str
[
// Handguns
"hgun_Pistol_01_F",
"hgun_P07_F",
"hgun_P07_khk_F",
"hgun_Rook40_F",
"hgun_ACPC2_F",
"hgun_Pistol_heavy_02_F",
"hgun_Pistol_heavy_01_F"
];

pistolArrayLevel2 = compileFinal str
[
"arifle_CTAR_blk_ARCO_F",
"arifle_MX_Black_F",
"arifle_MX_GL_Black_F",
"arifle_MX_SW_Black_F",
"arifle_MX_khk_F"
];

What happens:
arsenalMain returns correct values in system chat and calls correct script as it seems. When i'm alone when i go from level 1 to level 2 i have to respawn 2 times to get the extra guns in arsenal. When i go from level 2 to level 1 guns will get removed only after server restart.
When my level 2 mate joins the server after restart and i have level 1 we both get arsenal of level 2.
Is the arsenal inventory global for the whole server? Is there a way to make it work separately for each player?

I tried also
[_crate,[true],true] call BIS_fnc_removeVirtualWeaponCargo;
and
[_crate,[true],false] call BIS_fnc_removeVirtualWeaponCargo;

p.s. Getting the following in my client RPT. Can this be causing the issue? Any way to fix it?
Code: [Select]
1:19:57 Error in expression <Global","_initAction"];
_object = _this param [0,missionnamespace,[missionnamesp>
 1:19:57   Error position: <param [0,missionnamespace,[missionnamesp>
 1:19:57   Error Type String, expected Namespace,Object
 1:19:57 File A3\functions_f_bootcamp\Inventory\fn_addVirtualWeaponCargo.sqf [BIS_fnc_addVirtualWeaponCargo], line 19
 1:19:57 Error in expression <Global","_initAction"];
_object = _this param [0,missionnamespace,[missionnamesp>
 1:19:57   Error position: <param [0,missionnamespace,[missionnamesp>
 1:19:57   Error Type String, expected Namespace,Object
 1:19:57 File A3\functions_f_bootcamp\Inventory\fn_addVirtualBackpackCargo.sqf [BIS_fnc_addVirtualBackpackCargo], line 19
 1:19:57 Error in expression <Global","_initAction"];
_object = _this param [0,missionnamespace,[missionnamesp>
 1:19:57   Error position: <param [0,missionnamespace,[missionnamesp>
 1:19:57   Error Type String, expected Namespace,Object
 1:19:57 File A3\functions_f_bootcamp\Inventory\fn_addVirtualMagazineCargo.sqf [BIS_fnc_addVirtualMagazineCargo], line 19
 1:19:57 Error in expression <"_cargoArray","_save"];
_object = _this param [0,missionnamespace,[missionnamesp>
 1:19:57   Error position: <param [0,missionnamespace,[missionnamesp>
 1:19:57   Error Type String, expected Namespace,Object
 1:19:57 File A3\functions_f_bootcamp\Inventory\fn_addVirtualItemCargo.sqf [BIS_fnc_addVirtualItemCargo], line 19