Raised This Month: $51 Target: $400
 12% 

Solved Menu.Selection Property


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 07-14-2018 , 17:24   Menu.Selection Property
Reply With Quote #1

I was trying to bring the menu back to the same page after you select an item. Usual case is that you can recreate a same menu, but it never retains the page that you were on. My menu has 5+ pages and coming back to the first page after each selection is not ideal.

I came across this menu property.

https://sm.alliedmods.net/new-api/menus/Menu/Selection

I was thinking of saving this value and using it along with Menu.DisplayAt function, but can't seem to figure out the syntax.

PHP Code:
int itemnumber;
menu.Selection(itemnumber); 
Above code gives me the following error.

PHP Code:
error 012invalid function callnot a valid address 
__________________

Last edited by Spirit_12; 07-14-2018 at 17:38.
Spirit_12 is offline
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 07-14-2018 , 17:38   Re: Menu.Selection Property
Reply With Quote #2

Never mind I was just having a brain fart.

It is a property, so it won't have anything afterwards. Code below works fine.

PHP Code:
int itemnumber menu.Selection
__________________
Spirit_12 is offline
FaceCSGO
Junior Member
Join Date: Mar 2015
Old 07-14-2018 , 17:40   Re: Menu.Selection Property
Reply With Quote #3

Have you tried https://sm.alliedmods.net/new-api/me...playMenuAtItem

You can use what item they are at + the maximum number of items per page on your menu to figure out what page to go back to, and use that page number to get to the appropriate menu item (the 3rd parameter)

edit: (did not see his reply before my own post went through )

Last edited by FaceCSGO; 07-14-2018 at 17:41.
FaceCSGO is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:40.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode