AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Content loss on menu's next page (https://forums.alliedmods.net/showthread.php?t=294936)

Airkish 03-11-2017 16:37

Content loss on menu's next page
 
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)



OciXCrom 03-11-2017 19:30

Re: Content loss on menu's next page
 
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.

Airkish 03-12-2017 04:59

Re: Content loss on menu's next page
 
Quote:

Originally Posted by OciXCrom (Post 2502835)
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 03-19-2017 07:00

Re: Content loss on menu's next page
 
Quote:

Originally Posted by Airkish (Post 2502900)
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.

fysiks 03-19-2017 13:54

Re: Content loss on menu's next page
 
The question in the OP was answered: Shorten your menu text.

Airkish 03-19-2017 14:01

Re: Content loss on menu's next page
 
Quote:

Originally Posted by fysiks (Post 2504855)
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"

fysiks 03-19-2017 18:28

Re: Content loss on menu's next page
 
Quote:

Originally Posted by Airkish (Post 2504856)
I'm talking about this:
"So I was wondering how to make description appear in chat when u press number"

New topic, new thread.


All times are GMT -4. The time now is 17:57.

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