Raised This Month: $ Target: $400
 0% 

Multilingual - %L without id (nvm solved =) )


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 04-19-2011 , 08:55   Multilingual - %L without id (nvm solved =) )
Reply With Quote #1

I'm using the first time ML and I've come accros a confusing thing, why is id really required ?
How can I skip it if I want to send to all players and I don't have a player id ?

EDIT: eh nvm I found it, it's LANG_PLAYER for all players... just my luck, I've been searchin for a couple of minutes and I finally find it unwillingly after I've posted the message... XD

Still, to not waste the space, is there any concrete full tutorial on multilingual ? I didn't see any on the forum, wiki or funcwiki.
__________________

Last edited by Hunter-Digital; 04-19-2011 at 08:58. Reason: oh lol, solved
Hunter-Digital is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-19-2011 , 12:12   Re: Multilingual - %L without id (nvm solved =) )
Reply With Quote #2

So far I remember, there is not really a tutorial about ML.

The player's index is needed to retrieve the player's language, through "lang" key.

When sending to one player, you need to pass the current player's index to know his language.
When sending to all players, You need to pass LANG_PLAYER to tell code to use player's index of all players. If you specify an index instead, the language of this player will be used for all. That's why you need to pass LANG_PLAYER.
__________________
Arkshine is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 04-19-2011 , 16:37   Re: Multilingual - %L without id (nvm solved =) )
Reply With Quote #3

You can also use LANG_SERVER for the server's language.
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`
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 04-20-2011 , 19:52   Re: Multilingual - %L without id (nvm solved =) )
Reply With Quote #4

Hmm, I just used LANG_PLAYER for all of them but it seems that I have different languages, some are server languages and some are player languages... I started replacing them with id where I had an id and I came accros something.

If I format a string that uses ML then send it using a loop to each player... should I use LANG_PLAYER or should I move the format inside the loop ?
__________________
Hunter-Digital is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-20-2011 , 20:01   Re: Multilingual - %L without id (nvm solved =) )
Reply With Quote #5

Use "id" when you use "id" as the first argument. Use LANG_PLAYER when you use 0 as the first argument.
__________________
fysiks is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 04-20-2011 , 20:16   Re: Multilingual - %L without id (nvm solved =) )
Reply With Quote #6

Soo... I need to move the format function inside the loop where I use id ?

I can't test this so sorry for bugging you xD
__________________
Hunter-Digital is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-20-2011 , 20:21   Re: Multilingual - %L without id (nvm solved =) )
Reply With Quote #7

Quote:
Originally Posted by Hunter-Digital View Post
Soo... I need to move the format function inside the loop where I use id ?

I can't test this so sorry for bugging you xD
The language is chosen then formatted. See my last post.

I'm guessing the answer is yes. If it's client_print() you can print to 0 and use LANG_PLAYER.
__________________

Last edited by fysiks; 04-20-2011 at 20:32.
fysiks 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 20:13.


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