ace_common_fnc_setAllGear not setting a few items on BIS_fnc_MP
We have a function that is called by the server in initPlayerServer.sqf. This then calls another script with BIS_fnc_MP and that final script is executing ace_common_fnc_setAllGear but it wont set everything. It for example never sets my backpack,the weapons and the vest. Everything else seems to be fine (uniform,helmet,compass,map,cTab,...)
I am using it with this addon i made: https://forums.bistudio.com/topic/187092-sru-persistent-database-and-resupply/ . If you want, i can supply you with the source code, but its easy to open it with PBO Manager (not encrypted)
Could you please provide the code that you use to call ace_common_fnc_setallGear ?
I uploaded our mod in a zip file. Here is how it works:
initPlayerServer.sqf: _thisPlayer = _this select 0; [_thisPlayer]execVM "\sru_pdb\functions\fn_Server_getUnit.sqf";
then you see the code that is in the fn_Server_getUnit.sqf and so on. It gets a string from a mysql database that was set with the ace_common_fnc_getAllGear function (fn_Server_setUnit)
ace_common_fnc_setAllGear is using addWeapon and addBackpack.
Both require the target unit to be local.
ace_common_fnc_setAllGear never checks if the object is local, so only some commands are executed correctly. (addHeadgear for example does not require a local object).
Can we still hotfix this into 3.4.2 ? I'll have to go for 3 hours, but can fix it later today.
tagging BIS's fault for their stupid broken inventory commands.
thanks a lot commy
ps: vest also missing and uniform is a wrong one (could run a few tests for you later then)
@tebsu I think the best would be if you rewrite your scripts so that ace_common_fnc_setAllGear is executed on the units machine.
I may in future add a setAllGear function to CBA, which handles these cases.
@commy2 Thanks for the hint.. Would it be possible to execute it on the units machine without an addon on client side? As of now, it runs on the server only and i would love to keep it that way (for public servers and so on). My arma script skills are very limited, so i am not really sure how i would do that right now. Thanks for the help
//fn_Client_getUnit
[_Player, _playerInventory, true, true] call ace_common_fnc_setAllGear;
// change to
[_Player, _playerInventory, true, true] remoteExecCall ["ace_common_fnc_setAllGear", _Player];
Thanks a lot, that worked perfectly !