ShutdownServer with exit code?

Started by ysc3839, Jul 31, 2015, 11:06 AM

Previous topic - Next topic

ysc3839

I hope ShutdownServer can return a exit code. :D

Xmair

I think you want this.
else if ( cmd == "shutdown" )
{
Message("[#ff0000]Server shutting down!")
ShutdownServer();
}

Credits to Boystang!

VU Full Member | VCDC 6 Coordinator & Scripter | EG A/D Contributor | Developer of VCCNR | Developer of KTB | Ex-Scripter of EAD

KAKAN

oh no

MacTavish

Just tested an it worked @ysc3839 you can use timer
else if(cmd=="shutitdown")
{
Message("abra ka dabra, server gonna shutdown in 5secs");
NewTimer("ShutdownServer",5000,1);
}


Grand Hunting Project
Join #SLC, #KAKAN, #Doom, #GHP @LUnet

Retired VC:MP Player/Scripter :P

.

#4
He means passing an integer with an arbitrary number that allows the wrapper who executed the server to be informed of the shutdown reason. Allowing you to know why your server shutdown from an external software through certain codes known by the script and the server launcher.

Example:
ShutdownServer(3);
Return code is 3, which could signal that we want to restart 1 hour later.

Example:
ShutdownServer(-2);
Return code is -2, which could signal that the script couldn't access the database.

etc.
.

ysc3839

Quote from: S.L.C on Jul 31, 2015, 07:14 PMHe means passing an integer with an arbitrary number that allows the wrapper who executed the server to be informed of the shutdown reason. Allowing you to know why your server shutdown from an external software through certain codes known by the script and the server launcher.

Example:
ShutdownServer(3);
Return code is 3, which could signal that we want to restart 1 hour later.

Example:
ShutdownServer(-2);
Return code is -2, which could signal that the script couldn't access the database.

etc.
Yes! :)