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

New AMXX Menu Static Item


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 05-22-2016 , 06:19   New AMXX Menu Static Item
Reply With Quote #1

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.
siriusmd99 is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 05-22-2016 , 08:17   Re: New AMXX Menu Static Item
Reply With Quote #2

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.

Last edited by klippy; 05-22-2016 at 08:17.
klippy is offline
Old 05-22-2016, 08:26
Whitez
This message has been deleted by Whitez. Reason: Sorry, it was hard to understand at first what you were asking for
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 05-22-2016 , 08:37   Re: New AMXX Menu Static Item
Reply With Quote #3

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?
siriusmd99 is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 05-22-2016 , 09:42   Re: New AMXX Menu Static Item
Reply With Quote #4

All menus are the same, it's just the API that's different between the old and new ones. They are interchangeable.
klippy is offline
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 05-22-2016 , 09:48   Re: New AMXX Menu Static Item
Reply With Quote #5

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?
siriusmd99 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-22-2016 , 10:08   Re: New AMXX Menu Static Item
Reply With Quote #6

It's auto.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 05-22-2016 , 10:18   Re: New AMXX Menu Static Item
Reply With Quote #7

OK, thanks.
siriusmd99 is offline
skz
Senior Member
Join Date: Jul 2014
Location: Portugal
Old 05-23-2016 , 00:47   Re: New AMXX Menu Static Item
Reply With Quote #8

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
__________________

Last edited by skz; 05-23-2016 at 00:50.
skz is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-23-2016 , 08:08   Re: New AMXX Menu Static Item
Reply With Quote #9

That's not what static menu option means.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 05-23-2016 , 10:12   Re: New AMXX Menu Static Item
Reply With Quote #10

If I make translation in plugin.txt lang file for Russian language, will IT Be displayed properly with client_print and in the menu?
siriusmd99 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 12:20.


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