RoomService v2.3.1
Loading...
Searching...
No Matches
RoomService.SetServerMessage Class Reference

Lua function to set a server message on screen.

Member Function Documentation

◆ Implementation()

void RoomService.SetServerMessage.Implementation ( string message,
float time )
inlineprivate

Usage:

RoomService.SetServerMessage("<size=200%><color=green>Welcome to the Lobby</color></size>", 0);
Lua function to set a server message on screen.
Definition RoomServiceLuaFunctions.cs:573
Definition MyPluginInfo.cs:2

Supports Rich Text

Parameters
messageThe message to display on the server.
timeThe duration in seconds to display the message. 0 is a persistant display

Source Code

590 {
591 if (!RoomServiceUtils.IsOnlineHost())
592 {
593 return;
594 }
595
596 if (string.IsNullOrEmpty(message.Trim()))
597 {
598 return;
599 }
600
601 ChatApi.SendMessage($"/servermessage white {time.ToString()} {message}");
602 }