Raised This Month: $ Target: $400
 0% 

Content loss on menu's next page


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Airkish
AlliedModders Donor
Join Date: Apr 2016
Location: Lithuania
Old 03-11-2017 , 16:37   Content loss on menu's next page
Reply With Quote #1

Once again seekin for help

I'm currently experiencing content loss when moving onto next page

Here's some photo for more detailed explanation:

http://imgur.com/a/I3rXs

First and Last pages are fine

2 and 3 bugged:

1. Doesn't show number 7.
2. No Back, Next

Menu format code:

PHP Code:
public CmdAch(iPlayer)
{
    new 
g_AchMenu menu_create("\wPasiekimai""Achievements_Handler")
    
    new 
Key[6]
    
    for(new 
iAch 0iAch AchievesiAch++)
    {
        if(
Achievement[iPlayer][iAch] == 0formatex(szTempcharsmax(szTemp), "\d%s - [%s] [%d/%d]"AchName[iAch], AchDescription[iAch], Achievement[iPlayer][iAch], AchRequirement[iAch])
        else if(
Achievement[iPlayer][iAch] >= AchRequirement[iAch]) formatex(szTempcharsmax(szTemp), "\y%s \w- [\rCOMPLETED\w]"AchName[iAch])
        else 
formatex(szTempcharsmax(szTemp), "\y%s \w- [\r%s\w]\w [\r%d\w/\r%d\w]"AchName[iAch], AchDescription[iAch], Achievement[iPlayer][iAch], AchRequirement[iAch])
        
menu_additem(g_AchMenuszTempKey)
    }
    
    
menu_setprop(g_AchMenuMPROP_EXITMEXIT_ALL)
    
menu_display(iPlayerg_AchMenu0)

__________________
Airkish is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-11-2017 , 19:30   Re: Content loss on menu's next page
Reply With Quote #2

Menus have a character limit and when that limit is reached, characters won't display anymore. The only solution is to make your texts shorter.

The text on the picture doesn't look very long at all, but bear in mind that the special characters (non-english letters) take up more space than the regular ones.
__________________

Last edited by OciXCrom; 03-11-2017 at 19:32.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Airkish
AlliedModders Donor
Join Date: Apr 2016
Location: Lithuania
Old 03-12-2017 , 04:59   Re: Content loss on menu's next page
Reply With Quote #3

Quote:
Originally Posted by OciXCrom View Post
Menus have a character limit and when that limit is reached, characters won't display anymore. The only solution is to make your texts shorter.

The text on the picture doesn't look very long at all, but bear in mind that the special characters (non-english letters) take up more space than the regular ones.
You are right, just tested (texts were too long, not because of special characters).
So I was wondering how to make description appear in chat when u press number

Here's menu with handler

PHP Code:
public CmdAch(iPlayer)
{
    new 
g_AchMenu menu_create("\wPasiekimai""Achievements_Handler")
    
    new 
Key[6]
    
    for(new 
iAch 0iAch AchievesiAch++)
    {
        if(
Achievement[iPlayer][iAch] == 0formatex(szTempcharsmax(szTemp), "\d%s - [%d/%d]"AchName[iAch], Achievement[iPlayer][iAch], AchRequirement[iAch])
        else if(
Achievement[iPlayer][iAch] >= AchRequirement[iAch]) formatex(szTempcharsmax(szTemp), "\y%s \w- [\rĮVYKDYTAS\w]"AchName[iAch])
        else 
formatex(szTempcharsmax(szTemp), "\y%s \w- [\r%d\w/\r%d\w]"AchName[iAch], Achievement[iPlayer][iAch], AchRequirement[iAch])
        
menu_additem(g_AchMenuszTempKey)
    }
    
    
menu_setprop(g_AchMenuMPROP_EXITMEXIT_ALL)
    
menu_display(iPlayerg_AchMenu0)
}

public 
Achievements_Handler(iPlayerg_AchMenuitem

    if(
item == MENU_EXIT
    { 
        
menu_destroy(g_AchMenu)
        return 
PLUGIN_HANDLED 
    
}
    else
    {
        if(
Achievement[iPlayer][item] >= AchRequirement[item]) 
        { 
            
ColorChat(iPlayerRED"Completed.")
            
CmdAch(iPlayer); 
        } 
        else 
        { 
            
ColorChat(iPlayerRED"%s"AchDescription[iPlayer])
                       
CmdAch(iPlayer); 
        } 
    } 
    return 
PLUGIN_CONTINUE 

__________________
Airkish is offline
Airkish
AlliedModders Donor
Join Date: Apr 2016
Location: Lithuania
Old 03-19-2017 , 07:00   Re: Content loss on menu's next page
Reply With Quote #4

Quote:
Originally Posted by Airkish View Post
You are right, just tested (texts were too long, not because of special characters).
So I was wondering how to make description appear in chat when u press number

Here's menu with handler

PHP Code:
public CmdAch(iPlayer)
{
    new 
g_AchMenu menu_create("\wPasiekimai""Achievements_Handler")
    
    new 
Key[6]
    
    for(new 
iAch 0iAch AchievesiAch++)
    {
        if(
Achievement[iPlayer][iAch] == 0formatex(szTempcharsmax(szTemp), "\d%s - [%d/%d]"AchName[iAch], Achievement[iPlayer][iAch], AchRequirement[iAch])
        else if(
Achievement[iPlayer][iAch] >= AchRequirement[iAch]) formatex(szTempcharsmax(szTemp), "\y%s \w- [\rĮVYKDYTAS\w]"AchName[iAch])
        else 
formatex(szTempcharsmax(szTemp), "\y%s \w- [\r%d\w/\r%d\w]"AchName[iAch], Achievement[iPlayer][iAch], AchRequirement[iAch])
        
menu_additem(g_AchMenuszTempKey)
    }
    
    
menu_setprop(g_AchMenuMPROP_EXITMEXIT_ALL)
    
menu_display(iPlayerg_AchMenu0)
}

public 
Achievements_Handler(iPlayerg_AchMenuitem

    if(
item == MENU_EXIT
    { 
        
menu_destroy(g_AchMenu)
        return 
PLUGIN_HANDLED 
    
}
    else
    {
        if(
Achievement[iPlayer][item] >= AchRequirement[item]) 
        { 
            
ColorChat(iPlayerRED"Completed.")
            
CmdAch(iPlayer); 
        } 
        else 
        { 
            
ColorChat(iPlayerRED"%s"AchDescription[iPlayer])
                       
CmdAch(iPlayer); 
        } 
    } 
    return 
PLUGIN_CONTINUE 

This still not solved, please help.
__________________
Airkish is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-19-2017 , 13:54   Re: Content loss on menu's next page
Reply With Quote #5

The question in the OP was answered: Shorten your menu text.
__________________
fysiks is offline
Airkish
AlliedModders Donor
Join Date: Apr 2016
Location: Lithuania
Old 03-19-2017 , 14:01   Re: Content loss on menu's next page
Reply With Quote #6

Quote:
Originally Posted by fysiks View Post
The question in the OP was answered: Shorten your menu text.
I'm talking about this:
"So I was wondering how to make description appear in chat when u press number"
__________________
Airkish is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-19-2017 , 18:28   Re: Content loss on menu's next page
Reply With Quote #7

Quote:
Originally Posted by Airkish View Post
I'm talking about this:
"So I was wondering how to make description appear in chat when u press number"
New topic, new thread.
__________________
fysiks 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 17:57.


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