Posts: 737
Threads: 338
Joined: Jan 2013
Hi,
When i do mysql close, can i do that?
mysql_close();
SendRconCommand("exit");
I meen sendrconcommand("exit).
Posts: 6,129
Threads: 36
Joined: Jan 2009
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.
Posts: 737
Threads: 338
Joined: Jan 2013
No.. I mean can i close mysql connection, and then exit from gm, does mysql will be closed? i give codes in first post..
Posts: 737
Threads: 338
Joined: Jan 2013
Posts: 807
Threads: 10
Joined: Jan 2013
Reputation:
0
Whatever you put in OnGameModeExit() will be called before the gamemode shuts down. So yes, the connection wil be closed.
Posts: 6,129
Threads: 36
Joined: Jan 2009
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