Twiznak 57 Posted November 12, 2018 Hi, I need help keeping arsenal and r3f logistics on a vehicle after it has re-spawned on a server. In my vehicle's init field: nul = [myVeh_1, -1, nil, ["Fortifications", "Structures_Military"]] execVM "R3F_LOG\USER_FUNCT\init_creation_factory.sqf"; ["AmmoboxInit",[this,true]] call BIS_fnc_arsenal; Your help is greatly appreciated. Share this post Link to post Share on other sites
davidoss 550 Posted November 12, 2018 îf you are using vehicle respawn module there are expresion field where you can execute any code on new spawned object Share this post Link to post Share on other sites
pierremgi 4743 Posted November 12, 2018 Keep what you want (2nd script). Not tested with specific R3F factory, but I can adapt if it fails. Share this post Link to post Share on other sites
Twiznak 57 Posted November 12, 2018 Hi guys! These are the solutions to my problem. Thank you Davidoss. Thank you PierreMGI. It's always you two helping me! I feel very lucky that I can come here, ask a question and get a concise answer from knowledgeable people. Thank you. Share this post Link to post Share on other sites
davidoss 550 Posted November 12, 2018 Quote It's always you two helping me! Yea Pierr and I we are the lowest BI forum workers trying to do our celebrities job 1 Share this post Link to post Share on other sites
Twiznak 57 Posted November 14, 2018 AND we are back to it. This works for games hosted in single player and local hosted multiplayer but it doesn't work on a dedicated (rented) server. Another hurdle. I don't know where to go from here. Share this post Link to post Share on other sites
pierremgi 4743 Posted November 14, 2018 Tell me if the new version with init field saving is OK. Share this post Link to post Share on other sites
davidoss 550 Posted November 15, 2018 expression field of vehicle respawn module: if (isServer) then { params [["_newVeh", objNull,[objNull]], ["_oldVeh", objNull,[objNull]]]; 0 = [ [_newVeh, -1, nil, ["Fortifications", "Structures_Military"]], "R3F_LOG\USER_FUNCT\init_creation_factory.sqf" ] remoteExec ["execVM", [0,-2] select isDedicated, _newVeh]; ["AmmoboxInit",[ _newVeh, true, {(_this distance _target) < 10} ]] remoteExecCall ["BIS_fnc_arsenal",[0,-2] select isDedicated,_newVeh]; }; Share this post Link to post Share on other sites
pierremgi 4743 Posted November 15, 2018 Just now, davidoss said: expression field of vehicle respawn module: if (isServer) then { params [["_newVeh", objNull,[objNull]], ["_oldVeh", objNull,[objNull]]]; 0 = [ [_newVeh, -1, nil, ["Fortifications", "Structures_Military"]], "R3F_LOG\USER_FUNCT\init_creation_factory.sqf" ] remoteExec ["execVM", [0,-2] select isDedicated, _newVeh]; ["AmmoboxInit",[ _newVeh, true, {(_this distance _target) < 10} ]] remoteExecCall ["BIS_fnc_arsenal",[0,-2] select isDedicated,_newVeh]; }; OK, but why isServer as you need to remoteExec the code on every client? if ( hasInterface) then {...}; should avoid remote execution. PS: I do prefer my script, saving the vehicle appearance, its loadouts... It's ridiculous to see different vans, hatchbacks, with different colors. Share this post Link to post Share on other sites
Twiznak 57 Posted November 15, 2018 Just now, davidoss said: expression field of vehicle respawn module: if (isServer) then { params [["_newVeh", objNull,[objNull]], ["_oldVeh", objNull,[objNull]]]; 0 = [ [_newVeh, -1, nil, ["Fortifications", "Structures_Military"]], "R3F_LOG\USER_FUNCT\init_creation_factory.sqf" ] remoteExec ["execVM", [0,-2] select isDedicated, _newVeh]; ["AmmoboxInit",[ _newVeh, true, {(_this distance _target) < 10} ]] remoteExecCall ["BIS_fnc_arsenal",[0,-2] select isDedicated,_newVeh]; }; BINGO! Thank you Davidoss. This works to respawn vehicles with arsenal and r3f logistics on a dedicated server. Thank you again, Sir. Share this post Link to post Share on other sites
pierremgi 4743 Posted November 15, 2018 Why remoteExecuting everywhere a code after an isServer condition? (except if your arguments are defined on server only, which is not the case here). It's seems to me a waste of broadcast. Think about hasInterface condition in this case. 1 Share this post Link to post Share on other sites
davidoss 550 Posted November 16, 2018 To make our friend Pierr calm down change to: if (hasInterface) then { params [["_newVeh", objNull,[objNull]], ["_oldVeh", objNull,[objNull]]]; 0 = [_newVeh, -1, nil, ["Fortifications", "Structures_Military"]] execVM "R3F_LOG\USER_FUNCT\init_creation_factory.sqf"; ["AmmoboxInit",[ _newVeh, true, {(_this distance _target) < 10} ]] call BIS_fnc_arsenal; }; There are no reason to remoteexec stuff because module expression will be executed globally Share this post Link to post Share on other sites
pierremgi 4743 Posted November 16, 2018 Just now, davidoss said: To make our friend Pierr calm down change to: This was necessary? Share this post Link to post Share on other sites