Jump to content
topden

remoteExec? or smth more?

Recommended Posts

there was a line in the script

[_veh,"zlt_fnc_partrepair", _veh] call bis_fnc_MP;

 

this function restores damage to vehicles by 50 percent

zlt_fnc_partrepair = {
	private "_veh";
	_veh = [_this, 0] call BIS_fnc_param;
	if (isNil {_veh} ) exitWith {}; 
	{
		_dmg = (_veh getHitPointDamage _x);
		if (not isNil {_dmg}) then {
			if ( _dmg > 0.64 ) then {
				if (_x in zlt_hardRepairParts) then {
					_veh setHitPointDamage [_x,0.64];
				} else {
					_veh setHitPointDamage [_x,0];
				};
			};
		};
	} foreach zlt_repair_hps; 
};

After the latest arma update, it stopped working. The script does not give any errors. the zlt_fnc_partrepair function is simply not executed on a dedicated server. Working only localhost.

How can this be done with other commands? (As I understand it, i need to use remoteExec, but I'm not strong). wrote like this: [_veh] remoteExec ["zlt_fnc_partrepair"]; works on my host, but does not work on a dedicated server.

Share this post


Link to post
Share on other sites

- are you sure zlt_hardRepairParts is defined everywhere?

- setHitPointDamage is Local Argument. That means you need to remoteExec on _veh locality:

[_veh] remoteExec ["zlt_fnc_partrepair",_veh,_veh]; (see remoteExec)

- note: setHitPointDamage has changed in V 2.12 for instigator parameter. I hope this command is OK.

 

  • Like 2

Share this post


Link to post
Share on other sites

A minor point, and I may be missing something, but isn't BIS_fnc_param unnecessary in this context since you aren't setting a default value or doing any checks?

zlt_fnc_partrepair = {
	private "_veh";
	_veh = [_this, 0] call BIS_fnc_param;

//could be

zlt_fnc_partrepair = {
	params ["_veh"];

 

  • Like 2

Share this post


Link to post
Share on other sites
5 hours ago, pierremgi said:

[_veh] remoteExec ["zlt_fnc_partrepair",_veh,_veh]; (see remoteExec)

 

 

Thank you. happened

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

×