It actually hasn't changed in... many months really. The only recent change was more than a month ago, but it was a cosmetic change. It's likely that the way C# accessed it changed, but the function itself hasn't really changed. Like I said though, you should be calling directly anyways.![]()
Solved Rust.BroadcastChat({ }); does not work
Discussion in 'Rust Development' started by ItsAnderson, Mar 30, 2015.
-
Wulf Community Admin
-
Ohhh.
Just one more question: Why do we need the string.*Format* there? Why can't we do string("{0}", "SERVER"); or something?
Sorry for so many different questions in one topic lol.. I did "*Format*" because that's what I'm not sure why we need, I want to know why it's there.
EDIT: I don't know why my signature showed up all of a sudden... lol -
Wulf Community Admin
You don't have to use it that way, you can use it like Bombardir posted in one of his last posts. -
I know but I use it for OnPlayerInit and I just generally want to know.
-
You should be using `PrintToChat` in C# plugins for printing chat messages. Example usage:
Print a message to a single player:
You can do the same thing using C# 6 string interpolation syntax:Code:PrintToChat(player, "Hello {0}", player.displayName);
You can also broadcast a message to all player:Code:PrintToChat(player, $"Hello {player.displayName}");
Code:PrintToChat("Hello everyone"); -
I do use PrintToChat, but I didn't know you can print to everyone by not putting in 'player' thnanks!
