Vice City: Multiplayer

VC:MP Discussion => General Discussion => Topic started by: ysc3839 on Jul 31, 2015, 11:06 AM

Title: ShutdownServer with exit code?
Post by: ysc3839 on Jul 31, 2015, 11:06 AM
I hope ShutdownServer can return a exit code. :D
Title: Re: ShutdownServer with exit code?
Post by: Xmair on Jul 31, 2015, 11:53 AM
I think you want this.
else if ( cmd == "shutdown" )
{
Message("[#ff0000]Server shutting down!")
ShutdownServer();
}
Title: Re: ShutdownServer with exit code?
Post by: KAKAN on Jul 31, 2015, 12:31 PM
It's showing
Title: Re: ShutdownServer with exit code?
Post by: MacTavish on Jul 31, 2015, 06:53 PM
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);
}

Title: Re: ShutdownServer with exit code?
Post by: . on Jul 31, 2015, 07:14 PM
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.
Title: Re: ShutdownServer with exit code?
Post by: ysc3839 on Aug 01, 2015, 09:17 AM
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! :)