xcom Posted September 13, 2014 Share Posted September 13, 2014 (edited) Hi all, I got to a small predicament with using the missionCommands.removeItemForCoalition function. The function states that you need to use ENUM COALITION and PATH. I've mistakenly removed the submenu but then figured out that I'll need to put the command itself's PATH into the remove function. For example - 1. I run - local rPath = missionCommands.addCommandForCoalition(groupCoaEnum, v..Zname.."_CAP", redCAP, setCC, v..Zname.."_CAP") groupCoaEnum - Enum of the coalition. v..Zname.."_CAP" - name of the string. redCAP - PATH to the submenu. setCC - Function that runs a command to do something. v..Zname.."_CAP" - argument that is passed to the function. Now I'd like to remove the command from the radio submenu, ONLY after the command runs, meaning ONLY after it has been selected. To do it, I figured I'll add the command to remove it in the inside function called setCC, problem is, the PATH is not returned or I need somehow to get the PATH of the newly added command into the setCC function. I hope this is understandable, it's a bit hard to explain. Thanks for any help! Edited September 13, 2014 by xcom [sIGPIC][/sIGPIC] BuddySpike Website | Live Map & Statistics BuddySpike Twitch Channel Buddyspike Discord Buddyspike Facebook Link to comment Share on other sites More sharing options...
ajax Posted September 13, 2014 Share Posted September 13, 2014 Can't you make rPath a global variable which can then be referenced in setCC? Link to comment Share on other sites More sharing options...
xcom Posted September 13, 2014 Author Share Posted September 13, 2014 no, because it located in a for loop, rpath changes. I would have to make a table and track it correctly etc... quite a big hassle. [sIGPIC][/sIGPIC] BuddySpike Website | Live Map & Statistics BuddySpike Twitch Channel Buddyspike Discord Buddyspike Facebook Link to comment Share on other sites More sharing options...
ajax Posted September 13, 2014 Share Posted September 13, 2014 Hmmm... then I don't see any alternative to storing the command paths as they get created. Link to comment Share on other sites More sharing options...
ESAc_matador Posted June 12, 2016 Share Posted June 12, 2016 no, because it located in a for loop, rpath changes. I would have to make a table and track it correctly etc... quite a big hassle. Hello xcom. Did you find a solution? Link to comment Share on other sites More sharing options...
Recommended Posts