Replacing a SayText message with arguments
PHP Code:
PHP Code:
|
Re: Replacing a SayText message with arguments
Code:
byte DestinationType |
Re: Replacing a SayText message with arguments
So, how would I format the message acording to the number of substrings? I know that I can find their number with get_msg_args(), but how to add them in the message?
PHP Code:
|
Re: Replacing a SayText message with arguments
I tried using format_args(), but it returns a blank string. Not even sure if this function is used here.
|
Re: Replacing a SayText message with arguments
You need to rebuild the message being sent by mapping out what the
final message text is being processed by the client. In your example here, the bomb drop TextMsg #Game_bomb_drop is sent to the client, who then looks up the entry in cstrike/titles.txt which is another localized string: #Cstrike_TitlesTXT_Game_bomb_drop which is then looked up in resource/cstrike_english.txt . Simplify this process so that you get the final msg from the TextMsg by using you own function to map out the messages being sent. CS doesn't seem to use more than 3 of the 4 optional substrings BTW. The code below is untested, but you get the picture.
Spoiler
|
Re: Replacing a SayText message with arguments
So basically I'll need to check the number of parameters 1 by 1 and form the messages with all the checks again. I guess I can do that if there's no easier way.
|
Re: Replacing a SayText message with arguments
Oh, I actually came up with an automized way to do this using a simple loop:
PHP Code:
|
Re: Replacing a SayText message with arguments
You can progresively add them to the message. Something like:
PHP Code:
|
Re: Replacing a SayText message with arguments
1 minute too late. :) Thanks anyways.
|
| All times are GMT -4. The time now is 21:03. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.