Jump to content
CPT Powell

Shift-Click Map Waypoints MP

Recommended Posts

We run a milsim unit and have a problem that so far, we have been unable to resolve.

 

We want the ground players to have Waypoints disabled, which we can achieve via the Difficulty Setting. However, we want Pilots to be able to use waypoints. Is anyone aware of a MOD or Setting that would make this accomplish-able? I have been searching the modding websites endlessly to no avail. I would prefer to avoid loop scripts that disable/re enable every second. Always cautious of loops impacts on performance when you have ~20-40 players on a server.

 

Thank you 

Share this post


Link to post
Share on other sites

 

 

// init.sqf
if (!isDedicated) then {
	if (!(['pilot',(typeOf player),FALSE] call BIS_fnc_inString)) then {
		onMapSingleClick {_shift};
	};
};

 

Share this post


Link to post
Share on other sites
On 6/14/2017 at 7:05 AM, fn_Quiksilver said:

 

 


// init.sqf
if (!isDedicated) then {
	if (!(['pilot',(typeOf player),FALSE] call BIS_fnc_inString)) then {
		onMapSingleClick {_shift};
	};
};

 

Can no longer get this working. For a while, I was able to just copy and paste this and it worked like a charm. What could have changed to cause this to stop working?

Share this post


Link to post
Share on other sites
23 hours ago, CY4 said:

Can no longer get this working. For a while, I was able to just copy and paste this and it worked like a charm. What could have changed to cause this to stop working? 

 

There's a foreign character when you copy/paste the code (forum bug).

Re-type it yourself on notepad (or somewhere) and paste it in game.

Also, not sure, but pilot should be encircled by quotation marks (" "), not apostrophes (' ')?

Share this post


Link to post
Share on other sites
6 hours ago, RCA3 said:

 

There's a foreign character when you copy/paste the code (forum bug).

Re-type it yourself on notepad (or somewhere) and paste it in game.

Also, not sure, but pilot should be encircled by quotation marks (" "), not apostrophes (' ')?

 

Hmm, I tried re-typing it myself and it still didn't work. I then tried with quotation marks instead of apostrophes. Still no dice...
EDIT: I feel I should add that I'm testing this on a dedicated server.
EDIT 2: I've been trying various things for hours, hoping to come up with some workaround but every time, either no one can use a waypoint, or everyone can.

Share this post


Link to post
Share on other sites

Sorry, I should've checked the wiki before replying:

Quote

Since Arma 3 v1.58 a stackable MissionEventHandler is available and should be used instead: MapSingleClick.

 

So addMissionEventHandler#MapSingleClick:

addMissionEventHandler ["MapSingleClick", {
  params ["_units", "_pos", "_alt", "_shift"];
    if !(["pilot", typeOf player, false] call BIS_fnc_inString) then {
      onMapSingleClick {_shift};
    };
}];

This seems to work, credits to @fn_Quiksilver.

I would move this to initPlayerLocal.sqf instead though.

  • Like 2

Share this post


Link to post
Share on other sites

That works like a charm, thank you so much!

  • Like 1

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

×