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

Problem with TF2 translation strings!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Naydef
Senior Member
Join Date: Dec 2015
Location: Doom Town, Nevada
Old 04-11-2016 , 08:54   Problem with TF2 translation strings!
Reply With Quote #1

HTML Code:
"TF_Class_Name_Pyro" 			"Pyro"
"TF_Class_Name_Spy" 			"Spy"
"TF_Class_Name_Engineer" 		"Engineer"

"game_player_joined_game"	"%s1 has joined the game"
"game_player_left_game"		"%s1 left the game (%s2)"
"game_player_joined_team"	"%s1 joined team %s2"
"game_player_joined_team_party_leader"	"%s1 joined %s2"
"game_player_joined_autoteam" "%s1 was automatically assigned to team %s2"
"game_player_joined_autoteam_party_leader" "%s1 was automatically assigned to %s2"
"game_player_changed_name"	"%s1 changed name to %s2"
You see these strings and I can print them with PrintToChatAll("#game_player_joined_game"). But there is one little problem. I can't do this
PHP Code:
PrintToChatAll("#game_player_joined_game"client); 
but this prints:
HTML Code:
has joined the game
How can I use these format specifiers?
__________________
My plugins:
*None for now*


Steam:
naydef

Last edited by Naydef; 04-11-2016 at 08:55.
Naydef is offline
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Location: The Netherlands
Old 04-11-2016 , 09:17   Re: Problem with TF2 translation strings!
Reply With Quote #2

Is client a string? %s expects a string.
__________________
Advertisements | REST in Pawn - HTTP client for JSON REST APIs
Please do not PM me with questions. Post in the plugin thread.
DJ Tsunami is offline
Naydef
Senior Member
Join Date: Dec 2015
Location: Doom Town, Nevada
Old 04-11-2016 , 09:36   Re: Problem with TF2 translation strings!
Reply With Quote #3

Now a string, but still only "has joined the game"
__________________
My plugins:
*None for now*


Steam:
naydef
Naydef is offline
psychonic

BAFFLED
Join Date: May 2008
Old 04-11-2016 , 12:36   Re: Problem with TF2 translation strings!
Reply With Quote #4

For game-translated messages that take parameters, you'll need to build and send the TextMsg usermessage yourself, instead of using the PrintToChat native. The format parameters are just extra strings written to the message with BfWriteString.
psychonic is offline
Naydef
Senior Member
Join Date: Dec 2015
Location: Doom Town, Nevada
Old 04-11-2016 , 13:00   Re: Problem with TF2 translation strings!
Reply With Quote #5

Quote:
Originally Posted by psychonic View Post
For game-translated messages that take parameters, you'll need to build and send the TextMsg usermessage yourself, instead of using the PrintToChat native. The format parameters are just extra strings written to the message with BfWriteString.
Good! Thanks! I will report. And one more question. Is there some way to send Fake event to clients(does not trigger server event hooks)?
__________________
My plugins:
*None for now*


Steam:
naydef
Naydef is offline
psychonic

BAFFLED
Join Date: May 2008
Old 04-11-2016 , 13:19   Re: Problem with TF2 translation strings!
Reply With Quote #6

Not without creating an extension to poke at the engine. From the outside, only sending an event to server-only or server+clients is supported.
psychonic is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 04-12-2016 , 16:58   Re: Problem with TF2 translation strings!
Reply With Quote #7

Quote:
Originally Posted by psychonic View Post
For game-translated messages that take parameters, you'll need to build and send the TextMsg usermessage yourself, instead of using the PrintToChat native. The format parameters are just extra strings written to the message with BfWriteString.
I think I posted some stocks to send this UserMessage somewhere on the Snippets and Tutorials board.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
nosoop
Veteran Member
Join Date: Aug 2014
Old 04-13-2016 , 06:15   Re: Problem with TF2 translation strings!
Reply With Quote #8

Quote:
Originally Posted by Powerlord View Post
I think I posted some stocks to send this UserMessage somewhere on the Snippets and Tutorials board.
Google says you posted a few PrintValveTranslation stocks in this post under Scripting.
__________________
I do TF2, TF2 servers, and TF2 plugins.
I don't do DMs over Discord -- PM me on the forums regarding inquiries.
AlliedModders Releases / Github / TF2 Server / Donate (BTC / BCH / coffee)

Last edited by nosoop; 04-13-2016 at 06:15. Reason: a word
nosoop is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 04-13-2016 , 06:19   Re: Problem with TF2 translation strings!
Reply With Quote #9

[Cs:s & Cs:go] Forgotten C4 announcements
__________________
Do not Private Message @me
Bacardi 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 09:01.


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