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

[Sourcemod] Plugin translations per palyer


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Nerus
Senior Member
Join Date: Aug 2010
Location: Poland
Old 07-20-2018 , 12:08   [Sourcemod] Plugin translations per palyer
Reply With Quote #1

Hi,

like in title, I have problem with chat on server.
Time to time some players get chat plugins adverts in en and sometime in they native language.
I guess is some problem with PrintToChatAll() and/or SetGlobalTransTarget(int client).
Its random and not depends on plugins (every plugin have the same problem).

E.g of county connection:
PHP Code:
PrintToChatAll("%t""sm_country_connecting"clientcountry_name); 
Translation file for plugin
PHP Code:
"Phrases"
{
    
// Game chat
    
"sm_country_connecting"
    
{
        
"#format"        "{1:N},{2:s}"
        "en"            "{green}{1}{default} connected from {green}{2}"
        "pl"            "{green}{1}{default} połączył się z {green}{2}"
    
}

sourcemod/configs/core.cfg
PHP Code:
     /**
     * Language that multilingual enabled plugins and extensions will use to print messages.
     * Only languages listed in languages.cfg are valid.
     *
     * The default value is "en"
     */
    
"ServerLang"    "en" 

Last edited by Nerus; 07-21-2018 at 05:59.
Nerus is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 07-20-2018 , 16:27   Re: [CSGO]Translate problems
Reply With Quote #2

This is normally due to a plugin / include missing a call to SetGlobalTransTarget.
__________________
asherkin is offline
Nerus
Senior Member
Join Date: Aug 2010
Location: Poland
Old 07-21-2018 , 04:36   Re: [CSGO]Translate problems
Reply With Quote #3

Quote:
Originally Posted by asherkin View Post
This is normally due to a plugin / include missing a call to SetGlobalTransTarget.
So,

instead of PrintToChatAll better will be to use PrintToChat in loop of clients in every plugin?

Last edited by Nerus; 07-21-2018 at 04:41.
Nerus is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 07-21-2018 , 05:36   Re: [CSGO]Translate problems
Reply With Quote #4

No, not at all.
__________________
asherkin is offline
Nerus
Senior Member
Join Date: Aug 2010
Location: Poland
Old 07-21-2018 , 05:56   Re: [CSGO]Translate problems
Reply With Quote #5

Quote:
Originally Posted by asherkin View Post
No, not at all.
I can't set SetGlobalTransTarget(int client) for the PrintToChatAll("%t", "sm_country_connecting", client, country_name) based on client because can't get client from it.
I can use VFormat with %T but the same situation I can't get client when message is broadcast to all clients.
But I need to send message to every player in different language how to do this, is there any solution for it?

Last edited by Nerus; 07-21-2018 at 08:21.
Nerus 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 16:53.


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