03.07.2016, 16:19
Quote:
You need to get connection handle when you connect to mysql-server and then use that every time you use any mysql funciton. Example:
PHP код:
|
Thats is my close:
Код:
mysql_close(ConnectMYSQL);
Код:
ConnectMYSQL = mysql_connect(MYSQL_HOST,MYSQL_USER,MYSQL_DB,MYSQL_PASS);
Quote:
If there is only 1 connection, it is by default 1.
The error about the invalid connection handle is given because you close the connection to the mysql server before server is restarted but when "gmx" is used, it calls OnGameModeExit which you most likely call mysql functions in there too to save. The plugin will wait until all queued queries are executed (R36+) so just let it save them in OnGameModeExit normally. From what I see, you have reached the limit in "max_user_connections". Unless you willingly have multiple connections for whatever reasons, make sure you close the connection to the mysql server before creating a new one. |
Quote:
Should use the native: https://sampwiki.blast.hk/wiki/GameModeExit
|
Quote:
Код:
public OnGMX() { SaveHouses(); SaveORGs(); SaveServer(); mysql_close(); // vai fechar a conexгo com o mysql (entгo nгo vai salvar os players qnd der o GMX) SendRconCommand("gmx"); } Код:
public OnGMX() { SendRconCommand("gmx"); } Код:
SaveHouses(); SaveORGs(); SaveServer(); mysql_close(); // vai fechar a conexгo com o mysql (entгo nгo vai salvar os players qnd der o GMX) |
Код:
[12:10:30] [ERROR] CMySQLConnection::Connect - (error #1226) User 'port_2538' has exceeded the 'max_user_connections' resource (current value: 5) [12:10:30] [ERROR] CMySQLConnection::Connect - (error #1226) User 'port_2538' has exceeded the 'max_user_connections' resource (current value: 5)
Код:
public OnGMX() { GameModeExit(); }