AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Multilingual - %L without id (nvm solved =) ) (https://forums.alliedmods.net/showthread.php?t=155247)

Hunter-Digital 04-19-2011 08:55

Multilingual - %L without id (nvm solved =) )
 
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.

Arkshine 04-19-2011 12:12

Re: Multilingual - %L without id (nvm solved =) )
 
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.

Emp` 04-19-2011 16:37

Re: Multilingual - %L without id (nvm solved =) )
 
You can also use LANG_SERVER for the server's language.

Hunter-Digital 04-20-2011 19:52

Re: Multilingual - %L without id (nvm solved =) )
 
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 ?

fysiks 04-20-2011 20:01

Re: Multilingual - %L without id (nvm solved =) )
 
Use "id" when you use "id" as the first argument. Use LANG_PLAYER when you use 0 as the first argument.

Hunter-Digital 04-20-2011 20:16

Re: Multilingual - %L without id (nvm solved =) )
 
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

fysiks 04-20-2011 20:21

Re: Multilingual - %L without id (nvm solved =) )
 
Quote:

Originally Posted by Hunter-Digital (Post 1454476)
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.


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

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