Difference between revisions of "DCS func addCommand"
From DCS World Wiki - Hoggitworld.com
m (1 revision imported) |
|||
(7 intermediate revisions by 2 users not shown) | |||
Line 59: | Line 59: | ||
|examples= | |examples= | ||
+ | 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 negativeReply = missionCommands. | + | local function displayMsg(vars) |
− | local positiveReply = missionCommands. | + | if vars.flyby == true then |
+ | trigger.action.outText("Roger that Ghostrider, you may do a flyby.", 20) | ||
+ | else | ||
+ | trigger.action.outText("Negative Ghostrider, the pattern is full", 20) | ||
+ | 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}) | ||
Line 69: | Line 78: | ||
}} | }} | ||
[[Category:Singleton Functions|addCommand]] | [[Category:Singleton Functions|addCommand]] | ||
+ | [[Category:Game Patch 1.2.4|addCommand]] |