Automated server messages are an easy way to send important information directly to your players in-game: server rules, event announcements, tips, or reminders about your Discord server, at regular intervals and without an admin needing to be online.
There’s no built-in feature for this in the dashboard on your VPS. You can set up recurring messages using a game plugin or mod, or use Windows Task Scheduler to send a command to the server at regular intervals. Both options require the game to support a suitable command or scripting interface. This guide explains how it works with open.mp.
With open.mp, the most reliable way to send recurring messages is directly through the server: use a small filterscript that sends a message to all players at regular intervals using a timer. This works whether or not an admin is online and doesn’t require any additional programs on your VPS.
Alternatively, you can use Windows Task Scheduler to run an RCON program at regular intervals with the say [text] command. This takes more work and depends on whether your RCON program can send commands from the command line.
- Connect to your VPS using Remote Desktop.
- In the
C:\ZapX-GameServers\openmp\server\filterscripts\folder, create a file namedankuendigungen.pwnwith the following contents:
#include <open.mp>
forward Ankuendigung();
public OnFilterScriptInit()
{
SetTimer("Ankuendigung", 600000, true);
return 1;
}
public Ankuendigung()
{
SendClientMessageToAll(0xFFFFFFFF, "Besuche auch unseren Discord!");
return 1;
}
- Compile the script into
ankuendigungen.amxusing the Pawn compiler included in the open.mp download. - Stop the server using
open.mp (openmp) - Stopand add the filterscript topawn.side_scriptsinconfig.json, for example:"side_scripts": ["filterscripts/ankuendigungen"]. - Start the server using
open.mp (openmp) - Start.
The value 600000 is the interval in milliseconds, which means every 10 minutes. Edit the message in SendClientMessageToAll to change its text.
Common uses include:
- Displaying server rules every few minutes
- Announcing upcoming events
- Sending gameplay tips to new players
- Reminding players about Discord or website links
To change the interval or message, edit the script, compile it again, and restart the server. To rotate through multiple messages, you can add a list of messages to the script and display them one after another.
With /rcon say [text], the message always appears as "Admin: [text]". A filterscript lets you choose the message and its color. Learn more about commands in open.mp: Server Commands, and about config.json in open.mp: Server Configuration. Before making changes, create a backup using the open.mp (openmp) - Backup shortcut; filterscripts are included in the backup.
