Raised This Month: $ Target: $400
 0% 

[SOLVED]menu multi lang. problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 02-05-2010 , 22:04   [SOLVED]menu multi lang. problem
Reply With Quote #1

hi,

i wanted to make my welcome menu ML and i get following errors :

Code:
L 02/06/2010 - 04:00:28: String formatted incorrectly - parameter 4 (total 4)
what i did :

Code:
new menuText[512]
    new len = formatex(menuText,511,"\rJailmod Freeday Manager \d1.0.2b by \rOne^n")
---->
Code:
new menuText[512]
    new len = formatex(menuText,511,"%L","MENU_1")
in ML dictionary/File :

Code:
MENU_1 = \rJailmod Freeday Manager \d1.0.2b by \rOne^n
PS. do i have better replace \r , \w and ^n ? or i can let the texts so ?

sorry but its my first time with ML
__________________

Last edited by One; 02-06-2010 at 08:33.
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-05-2010 , 22:07   Re: menu multi lang. problem
Reply With Quote #2

Quote:
Originally Posted by One View Post
PS. do i have better replace \r , \w and ^n ? or i can let the texts so ?
Remove them and see if it helps. It's called debugging.
__________________
fysiks is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 02-05-2010 , 22:09   Re: menu multi lang. problem
Reply With Quote #3

the same

without \r or \d or ^n is the same like with..
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 02-05-2010 , 23:53   Re: menu multi lang. problem
Reply With Quote #4

Quote:
Originally Posted by fysiks View Post
Remove them and see if it helps. It's called debugging.
You should have seen this...


@ One: when using ML formatting, you need to include an id for the language. Before the ML key ("MENU_1") you can either specify a player id or LANG_SERVER. (for some other natives you can use LANG_PLAYER, eg. client_print)

So your code should either be:
Code:
new len = formatex(menuText,511,"%L",LANG_SERVER,"MENU_1")
or:
Code:
new len = formatex(menuText,511,"%L",id,"MENU_1")
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-05-2010 , 23:56   Re: menu multi lang. problem
Reply With Quote #5

Quote:
Originally Posted by Emp` View Post
You should have seen this...
Maybe, but I've not used ML all that much . I guess I was just trying to get him to learn for himself.

@One, before posting go back and read a simple tutorial and you probably would have got it working on your own.
__________________
fysiks is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 02-06-2010 , 08:32   Re: menu multi lang. problem
Reply With Quote #6

yay ty @ both

its working now

for other when anyone needs the right code :

PHP Code:
public show_welcome(id)
{
    if(
get_pcvar_num(g_welcome_menu))
    {
        if(
g_welcomed[id]) 
        {
            return
        }
        
        new 
menuidkeys
        get_user_menu
(id,menuid,keys)
    
        if(
menuid 0)
        {
            
set_task(3.0,"show_welcome",id)
            return;
        }
        new 
menuText[512];
        new 
len formatex(menuText,511,"%L",id,"MENU_1")
        
len += formatex(menuText[len],511-len,"%L",id,"MENU_2")
        if(
get_pcvar_num(g_free_vote))
        {
            
len += formatex(menuText[len],511-len,"%L",id,"MENU_3")
        }
        else
        {
            
len += formatex(menuText[len],511-len,"%L",id,"MENU_4")
        }
        
        if(
get_pcvar_num(g_vip_admin))
        {
            
len += formatex(menuText[len],511-len,"%L",id,"MENU_5")
        }
        else
        {
            
len += formatex(menuText[len],511-len,"%L",id,"MENU_6")
        }
        if(
get_pcvar_num(g_show_votes))
        {
            
len += formatex(menuText[len],511-len,"%L",id,"MENU_7")
        }
        else
        {
            
len += formatex(menuText[len],511-len,"%L",id,"MENU_8")
        }
        if(
get_pcvar_num(g_leach_cvar))
        {
            
len += formatex(menuText[len],511-len,"%L",id,"MENU_9")
        }
        else
        {
            
len += formatex(menuText[len],511-len,"%L",id,"MENU_10")
        }
        if(
get_pcvar_num(g_free_vote))
        {
            
len += formatex(menuText[len],511-len,"%L",id,"MENU_11",get_pcvar_num(g_vote_round_number))
        }
        
len += formatex(menuText[len],511-len,"%L",id,"MENU_12")
        
len += formatex(menuText[len],511-len,"%L",id,"MENU_13")
        
len += formatex(menuText[len],511-len,"%L",id,"MENU_14")
        
len += formatex(menuText[len],511-len,"%L",id,"MENU_15")
        
len += formatex(menuText[len],511-len,"%L",id,"MENU_16")
        
        
show_menu(id,1023,menuText,-1,"welcome_menu")
    }

__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
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 07:22.


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