Jump to content

Sending messages only to the one who selected the menu item?


Adonnay

Recommended Posts

I created a menu item available the the coalition using addCommandForCoalition (... function() StatusReport() end, nil).

 

 

Now when StatusReport gets called I want to send a message, but only to the one who actually requested the status report, not to every client.

 

 

 

I know I have to use trigger.action.outTextForGroup, but how do I get the right groupID?

Link to comment
Share on other sites

You have to add it via addCommandForGroup() for each group. For the arguments to call you can have the groupId in there, so it calls the same function with their groupId passed to it as an argument.

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Link to comment
Share on other sites

If you build it at the start then the player should load into their aircraft with the menu already active. Only reasons to build the menu after each player spawns is if you want something specific to that person. Display their name within a sub-menu or something like that.

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Link to comment
Share on other sites

If you want some examples, you can have a look at what we did in my squadron.

The veafRadio.lua module abstracts most of the needed functions, and you can see it used in (for example) veafMove.lua ("move tanker to me" command).

Zip - VEAF :pilotfly:

 

If you want to learn, talk and fly with french-speaking friends, the Virtual European Air Force is here for you ! Meet us on our Discord and our forum

If you're a mission creator, you may want to check the VEAF Mission Creation Tools (and its GitHub repository) a set of open-source scripts and tools that make creating a dynamic mission a breeze !

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...