Raised This Month: $ Target: $400
 0% 

Special multilingual


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KadiR
Unnecessary Member
Join Date: Aug 2008
Location: Zürich / Switzerland
Old 03-06-2010 , 12:38   Special multilingual
Reply With Quote #1

I would like to see / know, how this would be with multilingual support.

PHP Code:
format(HUD100"You suck since %s rounds!",Rounds); 
KadiR is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-06-2010 , 12:45   Re: Special multilingual
Reply With Quote #2

PHP Code:
// print to all
format(HUD100"%L"LANG_PLAYER"LANG_KEY"Rounds);
// print to id
format(HUD100"%L"id"LANG_KEY"Rounds); 
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
KadiR
Unnecessary Member
Join Date: Aug 2008
Location: Zürich / Switzerland
Old 03-08-2010 , 11:49   Re: Special multilingual
Reply With Quote #3

Works perfectly, can you help me with this also please?

PHP Code:
ColorChat(0PINK"^x04The suckest map is: ^x03%s"szMap
KadiR is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-08-2010 , 12:34   Re: Special multilingual
Reply With Quote #4

You have a brain, right ? Is it that hard to reproduce from the xolent's exemple ?!!
__________________
Arkshine is offline
KadiR
Unnecessary Member
Join Date: Aug 2008
Location: Zürich / Switzerland
Old 03-08-2010 , 12:41   Re: Special multilingual
Reply With Quote #5

Quote:
Originally Posted by Arkshine View Post
Is it that hard to reproduce from the xolent's exemple ?!!
Yes it is. So I would not ask him.
KadiR is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-08-2010 , 17:42   Re: Special multilingual
Reply With Quote #6

If you use ^x04 or any other colors like that in the ML file, you will have to fix them with the plugin.

Code:
FixMLColor( const szKey[ ], szFixedKey[ ], const iFixedKeyLen ) {     static const szReplaces[ ][ 2 ][ ] =     {         { "^^x04", "^4" },         { "^^x03", "^3" },         { "^^x01", "^1" },         { "^^4", "^4" },         { "^^3", "^3" },         { "^^1", "^1" },         { "!g", "^4" },         { "!t", "^3" },         { "!y", "^1" }     };         copy( szFixedKey, iFixedKeyLen, szKey );         for( new i = 0; i < sizeof( szReplaces ); i++ )     {         replace_all( szFixedKey, iFixedKeyLen, szReplaces[ i ][ 0 ], szReplaces[ i ][ 1 ] );     }         return strlen( szFixedKey ); }

Language file:
Code:
[en]
SUCKEST_MAP = ^x04The suckest map is: ^x03%s
-- or --
SUCKEST_MAP = ^4The suckest map is: ^3%s
-- or --
SUCKEST_MAP = !gThe suckest map is: !t%s
Usage:
Code:
new szMessage[ 192 ]; formatex( szMessage, charsmax( szMessage ), "%L", id, "SUCKEST_MAP", szMap ); FixMLColor( szMessage, szMessage, charsmax( szMessage ) ); message_begin( MSG_ONE, g_iMsgID_SayText, _, id ); write_byte( id ); write_string( szMessage ); message_end( );
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
KadiR
Unnecessary Member
Join Date: Aug 2008
Location: Zürich / Switzerland
Old 03-09-2010 , 01:01   Re: Special multilingual
Reply With Quote #7

Thanks Exolent, but I am getting some errors:

Quote:
Error: Undefined symbol "id" on line 62:
PHP Code:
formatexszMessagecharsmaxszMessage ), "%L"id"SUCKEST_MAP"szMap ); 
Quote:
Error: Undefined symbol "g_iMsgID_SayText"
PHP Code:
message_beginMSG_ONEg_iMsgID_SayText_id ); 
KadiR is offline
lazarev
Veteran Member
Join Date: Sep 2008
Old 03-09-2010 , 01:34   Re: Special multilingual
Reply With Quote #8

PHP Code:
new g_iMsgID_SayText
//===========
//in plugin_init()
//===========
g_iMsgID_SayText get_user_msgid"SayText" ); 
lazarev is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-09-2010 , 02:08   Re: Special multilingual
Reply With Quote #9

And with id == 0 you have to loop through all players and format the string each time replacing LANG_PLAYER with player ID.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-09-2010 , 18:41   Re: Special multilingual
Reply With Quote #10

Quote:
Originally Posted by ConnorMcLeod View Post
And with id == 0 you have to loop through all players and format the string each time replacing LANG_PLAYER with player ID.
The variable isn't even defined.

@Kadir, You'll either need to declare and assign "id" or figure out what variable is used as the players' entity number.
__________________
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 08:41.


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