Raised This Month: $32 Target: $400
 8% 

Assign names in multi language


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Beatles
Senior Member
Join Date: Feb 2014
Old 08-01-2018 , 16:15   Assign names in multi language
Reply With Quote #1

Hello everyone, I've been working a lot on multi-language plugins, one of them the already published "[L4D] All 8 Survivors" created for l4d1, I've only found one problem, assign the name to the survivors, I've been using this method:

PHP Code:
public Action:BikerUse(iClient)  
{  
    
SetEntProp(iClientProp_Send"m_survivorCharacter"FRANCIS);  
    
SetEntityModel(iClientMODEL_FRANCIS);  
    if (
IsFakeClient(iClient))
    {
        
SetClientInfo(iClient"name""Francis");
        
SetClientName(iClient"Francis");
    }

But obviously in some countries the name is correct, in Russian for example or in Chinese, the name would not be written like this, it would be something like this:

ENGLISH - RUSO
Francis – Френсис

ENGLISH – CHINO
Francis - 弗朗西斯


So, my question is: How to make use of names in multi languages?
At the beginning I did it in the following way:

PHP Code:
public Action:BikerUse(iClient)  
{  
    
SetEntProp(iClientProp_Send"m_survivorCharacter"FRANCIS);  
    
SetEntityModel(iClientMODEL_FRANCIS);  
    if (
IsFakeClient(iClient))
    {
        
SetClientInfo(iClient"name %t""francis");
        
SetClientName(iClient"%t""francis");
    }

Obviously it did not work, I've tried everything and it has not worked, could you help me with that?

Last edited by Beatles; 08-01-2018 at 16:21.
Beatles is offline
Beatles
Senior Member
Join Date: Feb 2014
Old 08-17-2018 , 17:51   Re: Assign names in multi language
Reply With Quote #2

This is for l4d1, surely you know that the l4d2 characters do not exist there, the code is just a reference, apparently nobody knows how to do it. u.u
Beatles is offline
mug1wara
AlliedModders Donor
Join Date: Jun 2018
Old 08-17-2018 , 18:20   Re: Assign names in multi language
Reply With Quote #3

PHP Code:
char sFormat[256];
Format(sFormatsizeof(sFormat), "%t""");

SetClientInfo(iClient"name"sFormat); 
mug1wara is offline
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 08-17-2018 , 18:27   Re: Assign names in multi language
Reply With Quote #4

The only way I could think of adding multi-lingual support for naming extra bots is by creating a translation file that players can edit, and then you use those phrases to set as names for the bots.

translation file:

PHP Code:
"Phrases"
{
    
"Francis"
    
{
        
"es"        "Francisco"
    
}

plugin file:

PHP Code:
char sName[32];
Format(sNamesizeof(sName), "%T""Francis"LANG_SERVER); // Change LANG_SERVER to client to translate to each player's language.
SetClientInfo(client"name"sName);
SetClientName(clientsName); 
__________________

Last edited by Psyk0tik; 08-17-2018 at 18:28.
Psyk0tik is offline
Beatles
Senior Member
Join Date: Feb 2014
Old 08-18-2018 , 03:31   Re: Assign names in multi language
Reply With Quote #5

Quote:
Originally Posted by mug1wara View Post
PHP Code:
char sFormat[256];
Format(sFormatsizeof(sFormat), "%t""");

SetClientInfo(iClient"name"sFormat); 
Thank you very much
Beatles is offline
Beatles
Senior Member
Join Date: Feb 2014
Old 08-18-2018 , 03:34   Re: Assign names in multi language
Reply With Quote #6

Quote:
Originally Posted by Crasher_3637 View Post
The only way I could think of adding multi-lingual support for naming extra bots is by creating a translation file that players can edit, and then you use those phrases to set as names for the bots.

translation file:

PHP Code:
"Phrases"
{
    
"Francis"
    
{
        
"es"        "Francisco"
    
}

plugin file:

PHP Code:
char sName[32];
Format(sNamesizeof(sName), "%T""Francis"LANG_SERVER); // Change LANG_SERVER to client to translate to each player's language.
SetClientInfo(client"name"sName);
SetClientName(clientsName); 
Thank you very much bro, the file "phrases" I have had prepared since I started, I just needed the correct syntax, this has been very helpful.
Beatles is offline
Beatles
Senior Member
Join Date: Feb 2014
Old 08-21-2018 , 00:51   Re: Assign names in multi language
Reply With Quote #7

Quote:
Originally Posted by Crasher_3637 View Post
The only way I could think of adding multi-lingual support for naming extra bots is by creating a translation file that players can edit, and then you use those phrases to set as names for the bots.

translation file:

PHP Code:
"Phrases"
{
    
"Francis"
    
{
        
"es"        "Francisco"
    
}

plugin file:

PHP Code:
char sName[32];
Format(sNamesizeof(sName), "%T""Francis"LANG_SERVER); // Change LANG_SERVER to client to translate to each player's language.
SetClientInfo(client"name"sName);
SetClientName(clientsName); 
Hey bro, I have a problem, I've been testing the operation of everything, and even though the language reading is working well, in the same game the name is changed between Spanish and Russian, that is, if for example: dies a character, the revive already changed language to Russian, or vice versa.

The method I have used has been the following:

PHP Code:
char sName[32];
Format(sNamesizeof(sName), "%t""Francis"client);.
SetClientInfo(client"name"sName);
SetClientName(clientsName); 
Beatles is offline
Reply


Thread Tools
Display Modes

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 11:37.


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