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

Language help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Gasa
Senior Member
Join Date: Sep 2013
Old 11-10-2013 , 06:14   Language help
Reply With Quote #1

Hey allied, i have problem to make multi langauge on menu, i have this

new menu = menu_create("\wMain Menu:", "Menu_handle");
menu_additem(menu, "\wChange Class");
menu_additem(menu, "\wShop");

But i think i need formatex , but idk how to use, any help pls!
Gasa is offline
simanovich
AlliedModders Donor
Join Date: Jun 2012
Location: Israel
Old 11-10-2013 , 07:13   Re: Language help
Reply With Quote #2

Code:
PHP Code:
// ... 

// In plugin_init ..
register_dictionary("mylangfile.txt");

// ...

// ... in the menu function ..
static lang[128];

formatex(lang,charsmax(lang),"\w%L:",LANG_PLAYER,"MY_LANG_KEY1");
new 
menu menu_create(lang"Menu_handle");

formatex(lang,charsmax(lang),"\w%L",LANG_PLAYER,"MY_LANG_KEY2");
menu_additem(menulang);

formatex(lang,charsmax(lang),"\w%L",LANG_PLAYER,"MY_LANG_KEY3");
menu_additem(menu ,lang); 
Language file (at $moddir/addons/amxmodx/data/lang/mylangfile.txt):
Spoiler
__________________
simanovich is offline
Gasa
Senior Member
Join Date: Sep 2013
Old 11-10-2013 , 12:22   Re: Language help
Reply With Quote #3

I make like you said and working great but when players change language in whole plugin lang has been changed only in this main menu not working, working oonly when no players in server,and sometimes if somone other choose example - germany when i come in server i see main menu on germany here what i do:
PHP Code:
public Menu(id)
{
    static 
lang[128];

    
formatex(lang,charsmax(lang),"\w%L:",LANG_PLAYER,"MAIN_MENU");
    new 
menu menu_create(lang"Menu_handle");

    
formatex(lang,charsmax(lang),"\w%L",LANG_PLAYER,"CHANGE_CLASS");
    
menu_additem(menulang);

    
formatex(lang,charsmax(lang),"\w%L",LANG_PLAYER,"CLASS_INFO");
    
menu_additem(menu ,lang);
    
    
formatex(lang,charsmax(lang),"\y%L",LANG_PLAYER,"SHOP_MENU");
    
menu_additem(menu ,lang);
    
    
formatex(lang,charsmax(lang),"\y%L",LANG_PLAYER,"ITEM_MENU");
    
menu_additem(menu ,lang);

    
formatex(lang,charsmax(lang),"\r%L",LANG_PLAYER,"HELP_MENU");
    
menu_additem(menu ,lang);
    
    
formatex(lang,charsmax(lang),"\w%L",LANG_PLAYER,"CHANGE_TEAM");
    
menu_additem(menu ,lang);
    
    
formatex(lang,charsmax(lang),"\w%L",LANG_PLAYER,"KS_ITEMS");
    
menu_additem(menu ,lang);
    
    
formatex(lang,charsmax(lang),"\y%L",LANG_PLAYER,"DEFUSE_KIT");
    
menu_additem(menu ,lang);
    
    
formatex(lang,charsmax(lang),"\y%L",LANG_PLAYER,"RESET_POINTS");
    
menu_additem(menu ,lang);
    
    
formatex(lang,charsmax(lang),"\y%L",LANG_PLAYER,"CHANGE_LANGUAGE");
    
menu_additem(menu ,lang);
    
        
menu_display(idmenu);

NVM i fixed, i only replaced LANG_PLAYER with id

Last edited by Gasa; 11-10-2013 at 14:34.
Gasa is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 11-10-2013 , 15:12   Re: Language help
Reply With Quote #4

Replace LANG_PLAYER with id
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou 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 21:51.


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