Send a message to all players before the server restarts

I’m trying to figure out if there is a way to send a message to all players notifying them that the server is about to restart.

It’s possible to intercept a server restart with the match_terminate() function, but in my case this is not ideal because players can have multiple matches and would then receive multiple messages, and also because I’d like to notify connected players not currently in a match.

Is there a way to intercept the server restart event outside of the match loop?

Hello @totebo

What I’d suggest is to have a match handler specifically for this case and create a single instance within InitModule that implements match_terminate() invoking notification_send_all to notify all users of the server termination.

Hope this helps.

That’s a clever way of doing it and a a great suggestion, thanks!