AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   New AMXX Menu Static Item (https://forums.alliedmods.net/showthread.php?t=282990)

siriusmd99 05-22-2016 06:19

New AMXX Menu Static Item
 
How can I add static item in player menu?
For example I make menu with 2 options slap with 0 damage and slay.

Select Player:

1.name
2.name2
...
7. name

8.Action : Slay / Slap

9.Next

0. Exit


I really don't understand , is there a function which I don't know or I shall do manualy, like
if (max_items - i = 1 )
add_item(slap/slay item)

And please, don't say that I can send player to other menu and then select action type. I want to use this ,like old menu has.

klippy 05-22-2016 08:17

Re: New AMXX Menu Static Item
 
It's most likely possible, but I am not sure if you would want to do that, seems like it would be easier to achieve with old style menus.
I don't know if you can even make this without 1.8.3 considering menu_addblank() doesn't work properly, and if you had less than 7 players on a page you wouldn't be able to shift the action option down to the 8th position.

siriusmd99 05-22-2016 08:37

Re: New AMXX Menu Static Item
 
Ohh... Okay... But it's not bad if my plugin uses about 6-7 menus (new system) and I add 1 old style menu?
Will it affect efficiency or cause some run time errors, or not?

klippy 05-22-2016 09:42

Re: New AMXX Menu Static Item
 
All menus are the same, it's just the API that's different between the old and new ones. They are interchangeable.

siriusmd99 05-22-2016 09:48

Re: New AMXX Menu Static Item
 
OK, thanks, I think I will use that instead.

And because it's on topic I have one more question
I just used menu_create, additem, set prop exit and display_menu.
If players are more than 10 then will it auto make 2 pages or I should do manually like in old style menu?

OciXCrom 05-22-2016 10:08

Re: New AMXX Menu Static Item
 
It's auto.

siriusmd99 05-22-2016 10:18

Re: New AMXX Menu Static Item
 
OK, thanks.

skz 05-23-2016 00:47

Re: New AMXX Menu Static Item
 
Its simple!

On menu:
PHP Code:

menu_additem(menu"Option""*"); 

On handle:
PHP Code:

static _accessinfo[4], callback;
menu_item_getinfo(menuitem_accessinfosizeof(info) - 1__callback);
menu_destroy(menu);
    
if( 
info[0] == '*' )
{
    
//Your function here


Outside the function where you loop all the players, of course

OciXCrom 05-23-2016 08:08

Re: New AMXX Menu Static Item
 
That's not what static menu option means.

siriusmd99 05-23-2016 10:12

Re: New AMXX Menu Static Item
 
If I make translation in plugin.txt lang file for Russian language, will IT Be displayed properly with client_print and in the menu?


All times are GMT -4. The time now is 18:41.

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