looks like a random comment?
How do I do this?
With a scriptā¦
warmenu script
How to do it?
Use the warmenu api and script the menu yourself.
Use CitizenFX.log
file content in future.
Add resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937'
to your __resource.lua
Good evening,
I have a question, is it possible to recover data from an old button? If itās possible, how?
Thank you
@Warxander Is there currently a way to remember the last selected option of a menu being opened?
I donāt want it to go back to the first option each time i open a menu.
Thanks in advance
InputBox is not a part of WarMenu.
Check this thread.
I didnāt understand your question.
The only button ādataā is its text and you can control it.
No, because there is no guarantee that this menu wasnāt changed.
Hey I was wondering if theirs a way to close the menu if you step out of a marker on the ground. I got it to remove the button and it was easy but know I need it to exit the menu if the person is still in the menu
@Warxander Thanks for the reply. I managed to get it working to some degree but it has a bug I cant seem to resolve at the momentā¦
I created a structure that contains the id of each menu and an integer value representing the last selected option and retrieve the last saved option it by passing in the id of the current menu like e.g. SavedMenus[id].lastOption.
I set the values of the structure by simply doing SavedMenus[id].lastOption = menus[id].currentOption each time the current menu is closing.
I pass this into setMenuProperty(id, ācurrentOptionā, SavedMenus[id].lastOption) in the setMenuVisible() function.
This works well until I go 3 menus deep (open main menu -> then open 2nd menu from main -> then open 3rd menu from 2nd menu). Its difficult to explain without showing the issue in game. Anyway when i cycle back to main menu going from 3rd menu to 2nd menu to main menu, all is good, last saved options are correct until i try to repeat the same menu opening pattern. What happens is second time around, when i try to open the 2nd menu again it opens the wrong menu. It opens the menu found below the one i selected.
Sorry for the botched explanation, Iām hoping you or someone else sees something in it that hopefully sounds like a similar issue you encountered or solved. If someone needs a demo I can show you.
Thanks
Just use GetDistanceBetweenCoords
in loop and WarMenu.IsMenuOpened()/WarMenu.CloseMenu()
Honestly, I think that the current architecture sucks a big problem.
And you should not use private methods btw.
Do you try to run it on server side? O.O
@zaabox159 It would be helpful if you showed the code that it is trying to execute too.
It seems like your trying to loop through a table that doesnāt exist, or doing it incorrectly. Not sure why your using #1, but iām sure this needs to be your table structures name i.e. #myTable. This specifies that you want to iterate the loop based on the number(#) of items in your table.
Maybe this helps?