SA-MP Forums Archive
Mysql close in r38 - 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: Mysql close in r38 (/showthread.php?tid=506391)



Mysql close in r38 - audriuxxx - 12.04.2014

Hi,

When i do mysql close, can i do that?

mysql_close();
SendRconCommand("exit");

I meen sendrconcommand("exit).


Re: Mysql close in r38 - Calgon - 12.04.2014

If you're asking to close the MySQL connection when the gamemode is exiting, then you can do this by using the OnGameModeExit() callback, which also calls when the server is shutting down.

pawn Код:
public OnGameModeExit() {
    mysql_close();
    return 1;
}
Make sure you use the handle for mysql_close if you use mysql_connect more than once.


Re: Mysql close in r38 - audriuxxx - 12.04.2014

No.. I mean can i close mysql connection, and then exit from gm, does mysql will be closed? i give codes in first post..


Re: Mysql close in r38 - audriuxxx - 13.04.2014

UP TRHRAD


Re: Mysql close in r38 - DobbysGamertag - 13.04.2014

Whatever you put in OnGameModeExit() will be called before the gamemode shuts down. So yes, the connection wil be closed.


Re: Mysql close in r38 - Calgon - 13.04.2014

Quote:
Originally Posted by audriuxxx
Посмотреть сообщение
No.. I mean can i close mysql connection, and then exit from gm, does mysql will be closed? i give codes in first post..
As I said, OnGameModeExit is a callback. It is called when the gamemode exits, so basically anything you add there will execute as soon as the gamemode is exiting.

http://www.computerhope.com/jargon/e/event.htm