Jump to content
rick rawlings

Multiplayer - who is the player?

Recommended Posts

So in a multiplayer game, who does the player refer to? I am linking a support requester later in the mission and if I have a trigger with an activation of :

sr1 synchronizeObjectsAdd [player] 

where sr1 is the support module and there are three players in the mission, will they all have access to support? (I would like this) or would only the host player have it (I could live with this...)

 

Thanks for the help!

Share this post


Link to post
Share on other sites

As @HazJ says player is the client(human player) of the machine from where the command is run. If it is a dedicated server or a headless client then player will always be objNull.

//description.ext

class CfgFunctions {	
	class supportLink {
		tag = "TAG";
		class supports {
			file = "functions";
			class addSupportLink {};
		};
	};	
};
//functions\fn_addSupportLink.sqf

params[ "_requestor", "_provider" ];

[ player, _requestor, _provider ] call BIS_fnc_addSupportLink;
//initServer.sqf

//Wait for mission to start OR some specifc time during the mission
waitUntil{ time > 0 };

//Add a support link
//sr1 = support requestor
//sp1 = a support provider
//called remotely to each player( client machine ) and JIP
[ sr1, sp1 ] remoteExec[ "TAG_fnc_addSupportLink", [ 0, -2 ] select isDedicated, "SupportJIP" ];

You are better off using BI's commands to add support links rather than trying to add synchronised objects, as it will also refresh the command menu properly.

  • Like 3

Share this post


Link to post
Share on other sites
17 hours ago, major-stiffy said:

@Larrow

 

Love that avatar ! Great episode.

What avatar? Thats an actual self potrait :icon_biggrin: cheeky bugger.

  • Like 3
  • Haha 2

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

×