AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   new menu problem (https://forums.alliedmods.net/showthread.php?t=292969)

Adomaz1 01-19-2017 10:21

new menu problem
 
I have created a menu and I want to make it multilined, like to add a couple of lines in the title, but it makes extra line, like this:

Code:

Menu Title:

Extra Line
Extra Line




1. 1st option
2. 2nd option
3. 3rd option

0. Exit

I tried changing the charsmax but then it removes some letters or makes new lines. And another problem is that the Exit line ML doesn't work.

code:
Code:

public test(id)
{
        new szInfo[256];
        formatex(szInfo, charsmax(szInfo), "%L", id, "multilanguage")
       
        new menu = menu_create(szInfo, "menu_handle");
       
        formatex(szInfo, charsmax(szInfo), "%L", id, "multilanguage1")
        menu_additem(menu, szInfo, "1");
        formatex(szInfo, charsmax(szInfo), "%L", id, "multilanguage1")
        menu_additem(menu, szInfo, "2");
       
        new szExit[15];
        formatex(szExit, charsmax(szExit), "%L", id, "EXIT_MENU")
        menu_setprop(menu, MPROP_EXIT, szExit);
       
        menu_display(id, menu, 0);
       
        return PLUGIN_HANDLED;
}

What could be the problem?

OciXCrom 01-19-2017 10:28

Re: new menu problem
 
Please explain better what you're trying to do and what you have currently done (the lang file).

edon1337 01-19-2017 10:59

Re: new menu problem
 
menu_additem(menu, szInfo, "1");

-->

menu_additem(menu, szInfo, "");

OciXCrom 01-19-2017 12:36

Re: new menu problem
 
That will change precisely nothing.

Adomaz1 01-19-2017 13:02

Re: new menu problem
 
Quote:

Originally Posted by OciXCrom (Post 2488025)
Please explain better what you're trying to do and what you have currently done (the lang file).

I'm making a menu, and I want that the menu would look like this:
Code:

Menu title:

Extra text
Extra text

1. 1st Option
2. 2nd Option
3. 3rd Option

0. Exit

But the charsmax adds a lot of lines and half of the menu is empty(it looks like this):
Code:

Menu title:

Extra text
Extra text




1. 1st Option
2. 2nd Option
3. 3rd Option

0. Exit

ML line:
Code:

\rMenu title\r:^n^n \r- \yExtra text\r:^n \r- \yExtra text\r:^n^n
If I change the charsmax, it will look ok with the English ML, but it would remove other ML letters if it will have more symbols. And another problem is that Exit doesn't change, even if I have a translate for it.

edon1337 01-19-2017 13:33

Re: new menu problem
 
Quote:

Originally Posted by OciXCrom (Post 2488059)
That will change precisely nothing.

That would send an irrelevant info
PHP Code:

const info[]="" 

Quote:

Originally Posted by Adomaz1 (Post 2488066)
I'm making a menu, and I want that the menu would look like this:
Code:

Menu title:

Extra text
Extra text

1. 1st Option
2. 2nd Option
3. 3rd Option

0. Exit

But the charsmax adds a lot of lines and half of the menu is empty(it looks like this):
Code:

Menu title:

Extra text
Extra text




1. 1st Option
2. 2nd Option
3. 3rd Option

0. Exit

ML line:
Code:

\rMenu title\r:^n^n \r- \yExtra text\r:^n \r- \yExtra text\r:^n^n
If I change the charsmax, it will look ok with the English ML, but it would remove other ML letters if it will have more symbols. And another problem is that Exit doesn't change, even if I have a translate for it.

Remove the ^n^n after Extra text.

Adomaz1 01-19-2017 13:58

Re: new menu problem
 
Quote:

Originally Posted by edon1337 (Post 2488078)
That would send an irrelevant info
PHP Code:

const info[]="" 



Remove the ^n^n after Extra text.

nothing changed :/

edon1337 01-19-2017 14:27

Re: new menu problem
 
Try removing every ^n then try adding them again one by one. You'll detect the mistake by doing that.

EFFx 01-19-2017 14:34

Re: new menu problem
 
You need to make a menu with old format.

OciXCrom 01-19-2017 15:10

Re: new menu problem
 
Quote:

Originally Posted by EFFx (Post 2488112)
You need to make a menu with old format.

Why?!


All times are GMT -4. The time now is 20:58.

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