Jump to content

Simulating looking at someone else's map.

Recommended Posts

New at scripting, and this one has me pulling my hair out, so here's my dilemma: 

I want to only give the group leaders in my mission access to the map item, and have it so that when other players are near one of these leaders they can access the map, but make it so that when they leave the proximity of the leader, the map disappears again, to simulate the players going to the leader and looking at their map. Now I'm not sure which way to do this, whether I need to make a detection script using inArea or if I can attach triggers to the leaders that will do 

   unitname removeweapon "itemmap" 


   unitname addweapon "itemmap"

I also saw the "leader" command on BI wiki, and was wondering if it could be used to automatically assign the units? 

Any help would be greatly appreciated! 

Share this post

Link to post
Share on other sites

Thanks @Melody_Mike,  this looks interesting and I may well end up using it if I don't have any luck, but I still want to know if it's possible to do this without relying on an ACE mod, and by scripting or clever use of triggers.

Share this post

Link to post
Share on other sites

Sure, in initPlayerlocal.sqf :

[] spawn {
  waitUntil {sleep 1; !isNull findDisplay 46};
  findDisplay 46 displayAddEventHandler["KeyDown","
    if ((_this #1) in actionKeys 'showMap' && player distance leader player <3) exitWith {if !('itemMap' in items player) then {player addWeapon 'itemMap'}; openMap [true,false]};
    player removeWeapon 'itemMap';


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