Put this under your Owner commands in commands.java
Code:
if(playerCommand.startsWith("restart") && (c.playerName.equalsIgnoreCase("YOURNAMEGOESHERE"))) {
for(Player p : PlayerHandler.players) {
if(p == null)
continue;
PlayerSave.saveGame((Client)p);
}
System.exit(0);
}
Here's an auto restarter you can also use if your server has memory leaks - Make sure you put this where your run.bat is and name the file to something like AutoRestarter.bat, make sure it's .bat or it will not work.
Code:
::Copyright © MMVIII all rights reserved 2008
@echo off
title Server Automated Restarter
:start
set time=10800 //time in seconds
start run.bat
:loop
cls
IF %time% GTR 0 (
set /a time=%time% - 1
set /a min=%time%/60
echo Next Restart In %time% Seconds.
echo %time% Seconds is %min% Minutes.
ping YOURIPADDRESS -n 2 > NUL
goto loop
)
taskkill /f /im java.exe
cls
goto start
::Made By RSC/Logical
Hope I helped.