File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -257,6 +257,37 @@ public override void onInit()
257257 }
258258 SendPlayerChatMessage ( player , $ "{ plr . Username } : { plr . FisherID } - SteamID: { plr . SteamId . m_SteamID } ") ;
259259 } ) ;
260+
261+ RegisterCommand (
262+ command : "joinmessage" ,
263+ aliases : [ "motd" , "joinmsg" ] ,
264+ callback : ( player , args ) =>
265+ {
266+ if ( ! IsPlayerAdmin ( player ) )
267+ {
268+ SendPlayerChatMessage (
269+ player ,
270+ Server . displayJoinMessage ? Server . joinMessage : "Message not set!"
271+ ) ;
272+ }
273+ else if ( args . Length == 0 )
274+ {
275+ SendPlayerChatMessage (
276+ player ,
277+ $ """ { Server . joinMessage } { ( Server . displayJoinMessage ? "" : "(DISABLED)" ) } """
278+ ) ;
279+ }
280+ else
281+ {
282+ Server . joinMessage = string . Join ( " " , args ) ;
283+ SendPlayerChatMessage (
284+ player ,
285+ $ "Successfully updated the message: { Server . joinMessage } "
286+ ) ;
287+ }
288+ }
289+ ) ;
290+ SetCommandDescription ( "joinmessage" , "Show OR set the lobby's join message" ) ;
260291 }
261292
262293 private List < WFPlayer > lastToUseChalk = new ( ) ;
@@ -299,5 +330,6 @@ public override void onEnd()
299330 UnregisterCommand ( "reload" ) ;
300331 UnregisterCommand ( "plugins" ) ;
301332 UnregisterCommand ( "steam" ) ;
333+ UnregisterCommand ( "joinmessage" ) ;
302334 }
303335}
You can’t perform that action at this time.
0 commit comments