Difference between revisions of "DCS func addCommand"
From DCS World Wiki - Hoggitworld.com
(2 intermediate revisions by the same user not shown) | |||
Line 61: | Line 61: | ||
The sample below will generate a base menu accessed via F10 called "Display Requests" for all users with two sub-items for a negative or positive response | The sample below will generate a base menu accessed via F10 called "Display Requests" for all users with two sub-items for a negative or positive response | ||
− | + | local function displayMsg(vars) | |
− | local displayRequests = missionCommands.addSubMenu( "Display Requests") | + | if vars.flyby == true then |
− | + | trigger.action.outText("Roger that Ghostrider, you may do a flyby.", 20) | |
− | local negativeReply = missionCommands.addCommand( "Negative Ghostrider", displayRequests , displayMsg, {flyby = false}) | + | else |
− | + | trigger.action.outText("Negative Ghostrider, the pattern is full", 20) | |
− | local positiveReply = missionCommands.addCommand( "Roger Ghostrider", displayRequests , displayMsg, {flyby = true}) | + | end |
+ | end | ||
+ | local displayRequests = missionCommands.addSubMenu( "Display Requests") | ||
+ | local negativeReply = missionCommands.addCommand( "Negative Ghostrider", displayRequests , displayMsg, {flyby = false}) | ||
+ | local positiveReply = missionCommands.addCommand( "Roger Ghostrider", displayRequests , displayMsg, {flyby = true}) | ||