AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Get when player press next or back in a new style menu (https://forums.alliedmods.net/showthread.php?t=242494)

SicknessArG 06-20-2014 10:42

Get when player press next or back in a new style menu
 
I tried a lot of differents ways, but none of those works.

Flick3rR 06-20-2014 10:54

Re: Get when player press next or back in a new style menu
 
PHP Code:

if(item == MENU_MORE// This is when button "Next" is pressed
if(item == MENU_BACK// This is when button "Back" is pressed 


SicknessArG 06-20-2014 11:02

Re: Get when player press next or back in a new style menu
 
I used it in a switch and doesn't work:\

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

Nextra 06-20-2014 12:27

Re: Get when player press next or back in a new style menu
 
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.

SicknessArG 06-20-2014 12:38

Re: Get when player press next or back in a new style menu
 
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!

Nextra 06-20-2014 15:03

Re: Get when player press next or back in a new style menu
 
Sounds good.

SicknessArG 06-20-2014 16:49

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

Originally Posted by Nextra (Post 2154713)
Sounds good.

Right, thanks then! :D


All times are GMT -4. The time now is 21:08.

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