Jump to content
Twiznak

Need help keeping Arsenal and R3F Logistics on a vehicle, after it re-spawns on a server.

Recommended Posts

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

î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

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
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

  • Haha 1

Share this post


Link to post
Share on other sites

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

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
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
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

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.

  • Like 1

Share this post


Link to post
Share on other sites

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
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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×