Raised This Month: $ Target: $400
 0% 

Help with new menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 10-02-2009 , 07:49   Help with new menu
Reply With Quote #1

Simple:

PHP Code:
for(new 0;sizeof name_weapons1;j++)
        
menu_additem(menuname_all_weapons[get_weaponid(name_weapons1[j])], j
As would be the code if I want to put the item number as j?
__________________
alan_el_more is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-02-2009 , 08:57   Re: Help with new menu
Reply With Quote #2

use num_to_str() for j.
__________________
Arkshine is offline
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 10-02-2009 , 09:12   Re: Help with new menu
Reply With Quote #3

Thanks arkshine, work perfect
__________________
alan_el_more is offline
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 10-03-2009 , 07:50   Re: Help with new menu
Reply With Quote #4

Another question to not create another thread:

How do i take the page number?
__________________
alan_el_more is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 10-03-2009 , 08:33   Re: Help with new menu
Reply With Quote #5

Quote:
Originally Posted by alan_el_more View Post
How do i take the page number?
Explain more.

About the first one, I don't think you even need to pass the num as info since you can just use the item id. Only if you need, you should be able to do:
PHP Code:
new gMenuInfo[ ] = "0123456789";
...
gMenuInfo
SnoW is offline
Send a message via MSN to SnoW
Old 10-03-2009, 11:47
larito
This message has been deleted by larito. Reason: ups
larito
Veteran Member
Join Date: Nov 2008
Location: Argentina- Mendoza
Old 10-04-2009 , 13:31   Re: Help with new menu
Reply With Quote #6

You can use this native player_menu_info(), here is a example for check what page current some player:

PHP Code:
// Normal menu
public clcmd_test(id)
{
    new 
menu menu_create("Menu Test""menu_test")
    
    
// Items for make page 1 and 2
    
menu_additem(menu"Numero de pag""1")
    
menu_additem(menu"Nada""2")
    
menu_additem(menu"Nada""3")
    
menu_additem(menu"Nada""4")
    
menu_additem(menu"Nada""5")
    
menu_additem(menu"Nada""6")
    
menu_additem(menu"Nada""7")
    
menu_additem(menu"Nada""8")
    
menu_additem(menu"Nada""9")
    
menu_additem(menu"Numero de pag""10")

    
menu_display(idmenu0)
}

public 
menu_test(idmenuitem)
{
    if(
item == MENU_EXIT)
        return 
PLUGIN_HANDLED;
    
    new 
data[6], iname[30], callbackiaccess
    menu_item_getinfo
(menuitemiaccessdata5iname92callback)
    
    
// Variables for store player menu info
    
new oldmenunewmenupage
    
// Get player menu info
    
player_menu_info(idoldmenunewmenupage)
    
    
// Some case
    
switch(str_to_num(data))
    {    
        case 
1:    client_print(idprint_chat"Numero de pag %d"page)
        case 
2..9: return PLUGIN_HANDLED;
        case 
10client_print(idprint_chat"Numero de pag: %d"page)
    }
    return 
PLUGIN_HANDLED

Info: player_menu_info return a some number of page but is page 1 return 0 , 2 return 1....
larito is offline
Send a message via MSN to larito
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 22:40.


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