Hey guys,
Do excuse me if there is something terribly wrong with this code, just switched to C# from Lua c: .
I want to make a simple message that only the player that joined receives when they join the server, this is that I currently have:
But this just throws me an error whenever a player joins.Code:void OnPlayerConnected(BasePlayer ply) { ply.ChatMessage("Welcome to the server!"); }
Any assistance appreciated!
Cheers,
Heroic
Solved Chat messages (C#)
Discussion in 'Rust Development' started by HeroicHD, Jul 8, 2015.
-
Code:
void OnPlayerConnected(BasePlayer player) { SendReply(player, "Welcome to the server!"); }
-
Ah great! Is there any way I can send a reply and change the chat image from the default Rust one?
Cheers,
Heroic -
Code:SendReply(player, "MyMessage", null, "76561198127163614");
-
Code:void OnPlayerConnected(BasePlayer ply) { SendReply(ply, "Welcome to the server!", null, 76561198127163614); } }
"Failed to call hook 'OnPlayerConnected' on plugin 'GRHungerGames-Test' (ArgumentException: failed to convert parameters)" -
-
Code:
void OnPlayerConnected(BasePlayer ply) { SendReply(ply, "Welcome to the server!", null, "76561198127163614"); }
-
I dont really remember how it goes.. maybe somenow who know can help him
Code:void OnPlayerConnected(BasePlayer ply) { SendReply(ply, "Welcome to the server!", "76561198127163614"); }
Code:void OnPlayerConnected(BasePlayer ply) { var message = string.Format("{0} has joined the server", ply.displayName); PrintToChat(message, null, "76561198127163614"); // or PrintToChat(message, "76561198127163614"); }
-
The parameter for OnPlayerConnected is not a BasePlayer... Check doc.
-
Oh my bad! It's OnPlayerInit(), correct? Haha, thanks so much for picking up on that. I was pretty confused..
Cheers,
HeroicLast edited by a moderator: Jul 8, 2015 -
LOL i forgot too.. its Packet Connection or sth like that.. what a fail.