Raised This Month: $51 Target: $400
 12% 

Solved [HELP] Menu Help for Lang


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
shehzad1234
BANNED
Join Date: Jan 2016
Location: https://t.me/pump_upp
Old 01-08-2017 , 05:05   [HELP] Menu Help for Lang
Reply With Quote #1

Hi all

Any one help me to convert menu_additem to formatex for register lang file like see code please..


PHP Code:
menu_additem(menu"test menu"""0); // case 0 
i want this in lang file like this

PHP Code:
menu_additem(menu"%L"""0,LANG_PLAYER,"Menu_item1_Name"); // case 0 
PHP Code:
// Generated with v3x's AMXX Menu Generator

#include <amxmodx>

public plugin_init()
{
    
register_plugin("My Menu""1.0""Me");
    
register_clcmd("test""ShowMenu"_"");
    
register_dictionary("MyTest.txt")
}

public 
ShowMenu(id)
{
    new 
menu menu_create("MyMenu""mh_MyMenu");

    
menu_additem(menu"test menu"""0); // case 0

    
menu_setprop(menuMPROP_EXITMEXIT_ALL);

    
menu_display(idmenu0);

    return 
PLUGIN_HANDLED;
}

public 
mh_MyMenu(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_cancel(id);
        return 
PLUGIN_HANDLED;
    }

    new 
command[6], name[64], accesscallback;

    
menu_item_getinfo(menuitemaccesscommandsizeof command 1namesizeof name 1callback);

    switch(
item)
    {
        case 
0client_print(idprint_chat"You have selected test menu");
    }

    
menu_destroy(menu);

    return 
PLUGIN_HANDLED;


Last edited by shehzad1234; 01-18-2017 at 08:56.
shehzad1234 is offline
Send a message via ICQ to shehzad1234 Send a message via AIM to shehzad1234 Send a message via Yahoo to shehzad1234
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-08-2017 , 10:22   Re: [HELP] Menu Help for Lang
Reply With Quote #2

You can't do that in menu_additem (at least not in 1.8.2). Add a different buffer and format the text there.

PHP Code:
new szText[64]
formatex(szTextcharsmax(szText), "%L"id"MENU_ITEM1_NAME")
menu_additem(menuszText
PS - you're using an ugly menu again.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
shehzad1234
BANNED
Join Date: Jan 2016
Location: https://t.me/pump_upp
Old 01-08-2017 , 11:23   Re: [HELP] Menu Help for Lang
Reply With Quote #3

Thanks bro but 2nd option ?? like

PHP Code:
// Generated with v3x's AMXX Menu Generator 

#include <amxmodx> 

public plugin_init() 

    
register_plugin("My Menu""1.0""Me"); 
    
register_clcmd("test""ShowMenu"_""); 
    
register_dictionary("MyTest.txt"


public 
ShowMenu(id

    new 
menu menu_create("MyMenu""mh_MyMenu"); 

    new 
szText[64]
    
formatex(szTextcharsmax(szText), "%L"id"MENU_ITEM1_NAME")
    
menu_additem(menuszText
    
menu_additem(menu"%L"""0,LANG_PLAYER,"Menu_item2_Name"); // case 1 

    
menu_setprop(menuMPROP_EXITMEXIT_ALL); 

    
menu_display(idmenu0); 

    return 
PLUGIN_HANDLED


public 
mh_MyMenu(idmenuitem

    if(
item == MENU_EXIT
    { 
        
menu_cancel(id); 
        return 
PLUGIN_HANDLED
    } 

    new 
command[6], name[64], accesscallback

    
menu_item_getinfo(menuitemaccesscommandsizeof command 1namesizeof name 1callback); 

    switch(
item
    { 
        case 
0client_print(idprint_chat"You have selected test menu"); 
        case 
1client_print(idprint_chat"You have selected test menu1"); 
    } 

    
menu_destroy(menu); 

    return 
PLUGIN_HANDLED


Last edited by shehzad1234; 01-08-2017 at 11:23.
shehzad1234 is offline
Send a message via ICQ to shehzad1234 Send a message via AIM to shehzad1234 Send a message via Yahoo to shehzad1234
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-08-2017 , 11:29   Re: [HELP] Menu Help for Lang
Reply With Quote #4

Do the same thing maybe?!?! You're in "scripting" section, so learn how to script.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
shehzad1234
BANNED
Join Date: Jan 2016
Location: https://t.me/pump_upp
Old 01-08-2017 , 12:39   Re: [HELP] Menu Help for Lang
Reply With Quote #5

PHP Code:
menu_additem(menu"test menu"""0); // case 0
menu_additem(menu"test menu1"""0); // case 1 
i want this in lang file like this

PHP Code:
menu_additem(menu"%L"""0,LANG_PLAYER,"Menu_item_Name"); // case 0
menu_additem(menu"%L"""0,LANG_PLAYER,"Menu_item1_Name"); // case 1 
PHP Code:
// Generated with v3x's AMXX Menu Generator

#include <amxmodx>

public plugin_init()
{
    
register_plugin("My Menu""1.0""Me");
    
register_clcmd("test""ShowMenu"_"");
    
register_dictionary("MyTest.txt")
}

public 
ShowMenu(id)
{
    new 
menu menu_create("MyMenu""mh_MyMenu");

    
menu_additem(menu"test menu"""0); // case 0
    
menu_additem(menu"test menu1"""0); // case 1

    
menu_setprop(menuMPROP_EXITMEXIT_ALL);

    
menu_display(idmenu0);

    return 
PLUGIN_HANDLED;
}

public 
mh_MyMenu(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_cancel(id);
        return 
PLUGIN_HANDLED;
    }

    new 
command[6], name[64], accesscallback;

    
menu_item_getinfo(menuitemaccesscommandsizeof command 1namesizeof name 1callback);

    switch(
item)
    {
        case 
0client_print(idprint_chat"You have selected test menu");
        case 
0client_print(idprint_chat"You have selected test menu1");
    }

    
menu_destroy(menu);

    return 
PLUGIN_HANDLED;

add in this bro please.

Last edited by shehzad1234; 01-08-2017 at 12:40.
shehzad1234 is offline
Send a message via ICQ to shehzad1234 Send a message via AIM to shehzad1234 Send a message via Yahoo to shehzad1234
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 01-08-2017 , 14:07   Re: [HELP] Menu Help for Lang
Reply With Quote #6

what's ugly with his actual menu ?
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 01-08-2017 , 17:30   Re: [HELP] Menu Help for Lang
Reply With Quote #7

Dude, OciXCrom has explained for you so much times

PHP Code:
new szText[64]
formatex(szTextcharsmax(szText), "%L"id"MENU_ITEM1_NAME")
menu_additem(menuszText
Thats what you should use instead of

PHP Code:
menu_additem(menu"%L"""0,LANG_PLAYER,"Menu_item_Name"); // case 0
menu_additem(menu"%L"""0,LANG_PLAYER,"Menu_item1_Name"); // case 1 
For user's cs language, use id instead of LANG_PLAYER. For if you want to add the menu for all players, use LANG_PLAYER. Here's the tutorial - https://wiki.alliedmods.net/Advanced...ingual_Support

And if you don't know nothing what this tuto is telling

Quote:
Let's break this down. For each %L that appears, we need at least two parameters. The first parameter is the TARGET. This must be a player id, LANG_SERVER (meaning show in the server's native language), or LANG_PLAYER. LANG_PLAYER is a special modifier that should only be used when sending a message to all players - it means "show in every player's native language". The second parameter is the key string that identifies the language phrase to translate. Lastly, if the translated string requires any parameters itself (ours needs %d, one integer), that must be added as well.
Here's the text that said every what you need know.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 01-08-2017 at 17:40.
EFFx is offline
shehzad1234
BANNED
Join Date: Jan 2016
Location: https://t.me/pump_upp
Old 01-09-2017 , 02:44   Re: [HELP] Menu Help for Lang
Reply With Quote #8

@EFFx thnx bro
shehzad1234 is offline
Send a message via ICQ to shehzad1234 Send a message via AIM to shehzad1234 Send a message via Yahoo to shehzad1234
shehzad1234
BANNED
Join Date: Jan 2016
Location: https://t.me/pump_upp
Old 01-17-2017 , 06:15   Re: [HELP] Menu Help for Lang
Reply With Quote #9

Ok 1 last help add in this code please

PHP Code:
// Generated with v3x's AMXX Menu Generator

#include <amxmodx>

public plugin_init()
{
    
register_plugin("My Menu""1.0""Me");
    
register_clcmd("say /test""ShowMenu"_"");
    
register_dictionary("MyTest.txt")
}

public 
ShowMenu(id)
{
    new 
menu menu_create("MyMenu""mh_MyMenu");

    
menu_additem(menu"%L"""0,LANG_PLAYER,"Menu_item_Name1"); // case 0
    
menu_additem(menu"%L"""0,LANG_PLAYER,"Menu_item_Name2"); // case 1
    
menu_additem(menu"owners"""0); // case 2
    
menu_additem(menu"%L"""0,LANG_PLAYER,"Menu_item_Name3"); // case 3
    
menu_additem(menu"%L"""0,LANG_PLAYER,"Menu_item_Name4"); // case 4

    
menu_setprop(menuMPROP_EXITMEXIT_ALL);

    
menu_display(idmenu0);

    return 
PLUGIN_HANDLED;
}

public 
mh_MyMenu(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_cancel(id);
        return 
PLUGIN_HANDLED;
    }

    new 
command[6], name[64], accesscallback;

    
menu_item_getinfo(menuitemaccesscommandsizeof command 1namesizeof name 1callback);

    switch(
item)
    {
        case 
0client_print(idprint_chat"You have selected Test1");
        case 
1client_print(idprint_chat"You have selected Test2");
        case 
2client_print(idprint_chat"You have selected owners");
        case 
3client_print(idprint_chat"You have selected Test3");
        case 
4client_print(idprint_chat"You have selected Test");
    }

    
menu_destroy(menu);

    return 
PLUGIN_HANDLED;

shehzad1234 is offline
Send a message via ICQ to shehzad1234 Send a message via AIM to shehzad1234 Send a message via Yahoo to shehzad1234
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 01-17-2017 , 13:17   Re: [HELP] Menu Help for Lang
Reply With Quote #10

Omfg, did you learned what we Said?
And you're not in sugestions/requests. Re-read what we Said and do it yourself
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 01-17-2017 at 13:18.
EFFx is offline
Old 02-10-2018, 02:14
Anurag Kumar
This message has been deleted by Anurag Kumar. Reason: Solved
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 08:14.


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