Project Zomboid

Project Zomboid

Zousug Dec 30, 2021 @ 3:50am
Dedicated server auto restarts
Hey all,

A friend runs a dedicated server for us.. Was wondering if there is away to have the server send a message to all players x time before the server is set to restart?
< >
Showing 1-12 of 12 comments
Beard Dec 30, 2021 @ 4:02am 
There is a command /servermsg "Message" to send messages to the players, depending on how you set up your automatic restart script it should be possible,
Zousug Dec 30, 2021 @ 3:04pm 
Originally posted by Beard:
There is a command /servermsg "Message" to send messages to the players, depending on how you set up your automatic restart script it should be possible,

how would you set it up? the auto restart they have atm is just from the web hud the host provided
Beard Dec 31, 2021 @ 2:38am 
If you are using some kind of game server service you would have to contact them if it would be even possible (if they allow running any custom scripts / commands to the console)
Zousug Dec 31, 2021 @ 2:34pm 
Originally posted by Beard:
If you are using some kind of game server service you would have to contact them if it would be even possible (if they allow running any custom scripts / commands to the console)
no worries thank you :).. i was thinking that would be the case but wanted to check..
Genebris Jan 28, 2022 @ 10:32am 
Originally posted by Beard:
If you are using some kind of game server service you would have to contact them if it would be even possible (if they allow running any custom scripts / commands to the console)
I can run any scripts or commands. How can I restart the server?
Beard Jan 28, 2022 @ 11:22am 
just type "quit" in the console, then start the server again.
Genebris Jan 28, 2022 @ 2:42pm 
I misunderstood the thred.
What I mean is, how can I make the server automatically restart once a day? I tried to fiddle with a bat file, but no luck.
Last edited by Genebris; Jan 28, 2022 @ 2:43pm
Beard Jan 29, 2022 @ 4:35am 
You would have to use some kind of script file to do that, I am not familiar with scripts so you would have to search up some, some people already created a few.
lRecon Dec 21, 2022 @ 2:53pm 
Originally posted by Genebris:
I misunderstood the thred.
What I mean is, how can I make the server automatically restart once a day? I tried to fiddle with a bat file, but no luck.
I made another .bat file with a few lines of code that restarts my server every 24 hours if this helps.

@echo off
:loop

"C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\Project Zomboid Dedicated Server\StartServer64.bat"

timeout /t 86400

goto loop
Nex Mar 13, 2023 @ 9:09am 
Originally posted by Beard:
You would have to use some kind of script file to do that, I am not familiar with scripts so you would have to search up some, some people already created a few.
is it possible to detect workshop desync kicks and restart on them?
The Dirty Mailman Jun 15, 2023 @ 10:23am 
Originally posted by .exe:
Originally posted by Beard:
You would have to use some kind of script file to do that, I am not familiar with scripts so you would have to search up some, some people already created a few.
is it possible to detect workshop desync kicks and restart on them?


also wondering this. Anyone have any luck doing something similar?
You'd need to hash your workshop files and keep them somewhere. Then compare them to the latest run. If a hash of a file changed then restart the server,

Otherwise, restart every 8 hours like this after making a Zomboid screen (screen -R Zomboid)

55 1,9,17 * * * screen -S zomboid -p 0 -X stuff "servermsg \"----- Server Restarting in 5 Minutes -----\"^M"
0 2,10,18 * * * screen -S zomboid -p 0 -X stuff "quit^M"
1 2,10,18 * * * screen -S zomboid -p 0 -X stuff "./pzserver/start-server.sh -servername XXXXX^M"

stuff = paste and ^M sends an enter.
< >
Showing 1-12 of 12 comments
Per page: 1530 50