Raised This Month: $ Target: $400
 0% 

Get when player press next or back in a new style menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SicknessArG
Junior Member
Join Date: Oct 2012
Location: Paraná, Entre Ríos (ARG)
Old 06-20-2014 , 10:42   Get when player press next or back in a new style menu
Reply With Quote #1

I tried a lot of differents ways, but none of those works.

Last edited by SicknessArG; 06-20-2014 at 10:43.
SicknessArG is offline
Send a message via MSN to SicknessArG Send a message via Skype™ to SicknessArG
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 06-20-2014 , 10:54   Re: Get when player press next or back in a new style menu
Reply With Quote #2

PHP Code:
if(item == MENU_MORE// This is when button "Next" is pressed
if(item == MENU_BACK// This is when button "Back" is pressed 
__________________
Flick3rR is offline
Send a message via Skype™ to Flick3rR
SicknessArG
Junior Member
Join Date: Oct 2012
Location: Paraná, Entre Ríos (ARG)
Old 06-20-2014 , 11:02   Re: Get when player press next or back in a new style menu
Reply With Quote #3

I used it in a switch and doesn't work:\

[Edit]
Tried in a if statement and still not working.

Last edited by SicknessArG; 06-20-2014 at 11:05.
SicknessArG is offline
Send a message via MSN to SicknessArG Send a message via Skype™ to SicknessArG
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 06-20-2014 , 12:27   Re: Get when player press next or back in a new style menu
Reply With Quote #4

You can't catch that directly through the menu system. Newmenus are supposed to hide pagination and will handle those events internally. The menu callback will not be executed: https://github.com/alliedmodders/amx...a_api.cpp#L993

You should try hooking the "menuselect" command, check if player has a newmenu open and then work out if the player has pressed next or back. Keep in mind that MENU_EXIT and MENU_BACK are special values defined by the newmenu system, so you have to take the number of items and pagination into account.

May I ask what you want to achieve? Maybe there is a more appropriate solution to your problem.
__________________
In Flames we trust!
Nextra is offline
SicknessArG
Junior Member
Join Date: Oct 2012
Location: Paraná, Entre Ríos (ARG)
Old 06-20-2014 , 12:38   Re: Get when player press next or back in a new style menu
Reply With Quote #5

I tried to get the page number in a variable to when you choose something in the menu it shows the last page viewed.
I was reading the library of newmenus and I find player_menu_info(), then I used
Code:
    new minfo;     player_menu_info(id, minfo, minfo, mPos[id]);
And it works.

Is it a good way?
Thanks!
SicknessArG is offline
Send a message via MSN to SicknessArG Send a message via Skype™ to SicknessArG
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 06-20-2014 , 15:03   Re: Get when player press next or back in a new style menu
Reply With Quote #6

Sounds good.
__________________
In Flames we trust!
Nextra is offline
SicknessArG
Junior Member
Join Date: Oct 2012
Location: Paraná, Entre Ríos (ARG)
Old 06-20-2014 , 16:49   Re: Get when player press next or back in a new style menu
Reply With Quote #7

Quote:
Originally Posted by Nextra View Post
Sounds good.
Right, thanks then!
SicknessArG is offline
Send a message via MSN to SicknessArG Send a message via Skype™ to SicknessArG
Reply


Thread Tools
Display Modes

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 21:08.


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