Raised This Month: $51 Target: $400
 12% 

Solved Translation problem (\x07 and \x08)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MAGNAT2645
Senior Member
Join Date: Nov 2015
Location: AlliedMods.net
Old 08-02-2016 , 08:39   Translation problem (\x07 and \x08)
Reply With Quote #1

Why symbols '\x07' or '\x08' is not processing in translation phrase (.phrases.txt) and CPrintToChat just prints this symbols like text.

P.S. Sorry for my bad english.

Last edited by MAGNAT2645; 11-23-2016 at 05:32.
MAGNAT2645 is offline
Miu
Veteran Member
Join Date: Nov 2013
Old 08-02-2016 , 12:43   Re: Translation problem (\x07 and \x08)
Reply With Quote #2

use the color names, {red} etc
Miu is offline
MAGNAT2645
Senior Member
Join Date: Nov 2015
Location: AlliedMods.net
Old 08-02-2016 , 13:07   Re: Translation problem (\x07 and \x08)
Reply With Quote #3

i know, but i have in-plugin string that taked from KeyValues (for ex.: FFFFFF) and if i will use message in-plugin (not from translate phrase, it will works fine, but if message passed to translate phrase, dont work).
MAGNAT2645 is offline
MAGNAT2645
Senior Member
Join Date: Nov 2015
Location: AlliedMods.net
Old 08-02-2016 , 14:11   Re: Translation problem (\x07 and \x08)
Reply With Quote #4

If i use message from Translate Phrase, chat prints (for example): 'Player - \x7FFFFFFPlayer connected!',
but if i will use message from plugin, colors in chat works fine.

I'm using translate phrases, because it's easier than CPrintToChat('TEXT') from plugin.
MAGNAT2645 is offline
Miu
Veteran Member
Join Date: Nov 2013
Old 08-02-2016 , 16:56   Re: Translation problem (\x07 and \x08)
Reply With Quote #5

ok, replace "\\x07" in the translation phrase with "\x07" inside the plugin with replacestring or whatever it's called

Last edited by Miu; 08-02-2016 at 16:56.
Miu is offline
MAGNAT2645
Senior Member
Join Date: Nov 2015
Location: AlliedMods.net
Old 08-02-2016 , 17:14   Re: Translation problem (\x07 and \x08)
Reply With Quote #6

Can you please write example, because i have learned recently about Translation Phrases.
MAGNAT2645 is offline
MAGNAT2645
Senior Member
Join Date: Nov 2015
Location: AlliedMods.net
Old 08-03-2016 , 03:51   Re: Translation problem (\x07 and \x08)
Reply With Quote #7

Ok, i have this in my code:
PHP Code:
CPrintToChatAll("%t""CHAT_CLIENT_CONNECTED"iClientHEXRank[iClient], sRank[iClient]); 
and in translation file:
PHP Code:
    "CHAT_CLIENT_CONNECTED"
    
{
        
// 1 - Name
        // 2 - Rank color in HEX
        // 3 - Rank
        
"#format" "{1:N},{2:s},{3:s}"
                "en" "{gold}{1} {default}- \x07{2}{3} {default}was connected!" 
        "ru" "{gold}{1} {default}- \x07{2}{3} {default}подключился{lime}!"
    

If i will use same text but in code, colors works fine.
But if in this translation file, chat prints (ex.):

Player - \x7FFFFFFPlayer was connected!

Why '\x7' instead of '\x07' ?
MAGNAT2645 is offline
Miu
Veteran Member
Join Date: Nov 2013
Old 08-03-2016 , 06:49   Re: Translation problem (\x07 and \x08)
Reply With Quote #8

PHP Code:
char buf[256];
Format(bufsizeof(buf), "%t""CHAT_CLIENT_CONNECTED"iClientHEXRank[iClient], sRank[iClient]);
ReplaceString(bufsizeof(buf), "\\x07""\x07");
CPrintToChatAll("%s"buf); 
Miu is offline
MAGNAT2645
Senior Member
Join Date: Nov 2015
Location: AlliedMods.net
Old 08-04-2016 , 13:32   Re: Translation problem (\x07 and \x08)
Reply With Quote #9

not working, chat prints: \x7FFFFFFPlayer instead of colored 'Player'.
MAGNAT2645 is offline
Miu
Veteran Member
Join Date: Nov 2013
Old 08-04-2016 , 13:34   Re: Translation problem (\x07 and \x08)
Reply With Quote #10

replace \\x7 with \x7 instead then? o.-
Miu 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 05:40.


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