Raised This Month: $ Target: $400
 0% 

Auto-paginate doesn't work?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bibu
Veteran Member
Join Date: Sep 2010
Old 03-27-2011 , 12:57   Auto-paginate doesn't work?
Reply With Quote #1

I've made the menu like that:

PHP Code:
new TotalReasonsGlobal 7
new const reasons_global[][64] =
{
    
"Camping",
    
"Spamming",
    
"Insulting",
    
"Bad Behaving",
    
"High Ping",
    
"Racism",
    
"Cheating"

PHP Code:
public GlobalreasonMenu(id)
{
    new 
ReasonmenuTemp[64]
    
formatex(Temp,63"\rChoose reason:")
    
    
Reasonmenu menu_create(Temp"globalban_reason_handler")
    new 
key[6]
    
    for(new 
iTotalReasonsGlobali++)
    {
        
num_to_str(ikeysizeof(key)-1)
        
menu_additem(Reasonmenureasons_global[i], key0)
    }
    
menu_display(idReasonmenu)
    return 
PLUGIN_HANDLED

This shows me just 6 items. Cheating isn't in the list.
bibu is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 03-27-2011 , 13:24   Re: Auto-paginate doesn't work?
Reply With Quote #2

new key[6]
to
new key[7]
.Dare Devil. is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-27-2011 , 13:29   Re: Auto-paginate doesn't work?
Reply With Quote #3

Quote:
Originally Posted by .Dare Devil. View Post
new key[6]
to
new key[7]
That won't change anything. In fact, he could even use new key[3]

EDIT:

All seven options show up on one page for me with this test plugin (note the change of TotalReasonsGlobal; this way you won't need to change the number when adding or removing options from reasons_global):

PHP Code:
#include <amxmodx>

new const reasons_global[][64] =
{
    
"Camping",
    
"Spamming",
    
"Insulting",
    
"Bad Behaving",
    
"High Ping",
    
"Racism",
    
"Cheating"
}
new 
TotalReasonsGlobal sizeof(reasons_global)

public 
plugin_init()
{
    
register_clcmd("say test""GlobalreasonMenu")
}

public 
GlobalreasonMenu(id)
{
    new 
ReasonmenuTemp[64]
    
formatex(Temp,63"\rChoose reason:")

    
Reasonmenu menu_create(Temp"globalban_reason_handler")
    new 
key[3]

    for(new 
iTotalReasonsGlobali++)
    {
        
num_to_str(ikeysizeof(key)-1)
        
menu_additem(Reasonmenureasons_global[i], key0)
    }
    
menu_display(idReasonmenu)
    return 
PLUGIN_HANDLED
}

public 
globalban_reason_handler(idmenuitem)
{
    
client_print(0print_chat"Option selected")

__________________

Last edited by fysiks; 03-27-2011 at 13:45.
fysiks is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 03-27-2011 , 13:42   Re: Auto-paginate doesn't work?
Reply With Quote #4

Quote:
Originally Posted by fysiks View Post
That won't change anything. In fact, he could even use new key[3]
I dont know about nohting in this menu style ..
Sorry my bad.

I was thinking if there are key[6] and 7 menu items then may by must key[7] too. lol
.Dare Devil. is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-27-2011 , 13:47   Re: Auto-paginate doesn't work?
Reply With Quote #5

Quote:
Originally Posted by .Dare Devil. View Post
I was thinking if there are key[6] and 7 menu items then may by must key[7] too. lol
Nope. The variable "key" is just a string to contian a number in string format: "1", "9", "10", etc.

Everything seems to work fine for me. See code above.
__________________
fysiks is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 03-27-2011 , 14:04   Re: Auto-paginate doesn't work?
Reply With Quote #6

Somehow, it works now. :/
bibu is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-27-2011 , 14:21   Re: Auto-paginate doesn't work?
Reply With Quote #7

Quote:
Originally Posted by bibu View Post
Somehow, it works now. :/
Yeah, I've had that happen sometimes. I usually found that I forgot to put the newest .amxx file in the folder or it didn't actually compile (I wasn't watching the compiler output when compiling).
__________________
fysiks is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 03-27-2011 , 15:19   Re: Auto-paginate doesn't work?
Reply With Quote #8

Quote:
Originally Posted by fysiks View Post
Yeah, I've had that happen sometimes. I usually found that I forgot to put the newest .amxx file in the folder or it didn't actually compile (I wasn't watching the compiler output when compiling).
Hehe, yeah.

Wow, that's cool with "sizeof", will replace it with that. Otherwise, there isn't something to change right? And, I do not really know what new key then stands for, I thought that Dare Devil is right.
bibu 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 14:38.


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