SA-MP Forums Archive
Send a message once the server shuts down/crashes - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Send a message once the server shuts down/crashes (/showthread.php?tid=662380)



Send a message once the server shuts down/crashes - Amit1998 - 30.12.2018

Hi,
I'm trying to make the server send a message to the discord channel once it shuts down.

Currently I'm testing it on my local PC and I tried to demo a crash by closing the terminal that runs the server and the message isn't sent to the discord channel(tried calling it on ongamemodeexit but obviously it fails to catch any server crashes), any alternatives?


Re: Send a message once the server shuts down/crashes - d1git - 30.12.2018

This has nothing to do with samp scripting, but you could possibly create a 3rd party app (node for example) which pings the server + port every 10 seconds lets say, if it fails to get a response, then you know it's down.

OnGameModeExit's behavior is very inconsistent - especially if you don't peacefully shut down the samp server process.


Re: Send a message once the server shuts down/crashes - Chyakka - 30.12.2018

You can use discord connector to send a discord message from your script, just send the closing down message with the OnGameModeExit callback.