[Ajuda] Sistema MySlq nгo salva
#1

Estou com esse problema de quando reinicio o server e somo um novo valor ao banco de dados й como se eu soma-se o novo valor a zero! Se o GM estiver rodando normal nгo tenho o problema sу ocorre isso quando reinicio. O valor no bando de dados soma normalmente e se reinicio o GM o valor que ta na tabela й simplesmente ignorado e somando a ZERO

logmysql
Код:
[16:28:45] [DEBUG] mysql_connect - host: "127.0.0.1", user: "root", database: "server2", password: "****", port: 3306, autoreconnect: true, pool_size: 0
[16:28:45] [DEBUG] CMySQLHandle::Create - creating new connection..
[16:28:45] [DEBUG] CMySQLHandle::CMySQLHandle - constructor called
[16:28:45] [DEBUG] CMySQLHandle::Create - connection created (id: 1)
[16:28:45] [DEBUG] CMySQLConnection::Connect - establishing connection to database...
[16:28:45] [DEBUG] CMySQLConnection::Connect - connection was successful
[16:28:45] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
[16:28:45] [DEBUG] mysql_errno - connection: 1
[16:28:45] [DEBUG] mysql_format - connection: 1, len: 1024, format: "UPDATE `bancoorg` SET `OMaconha` = %d,`OCocaina` = %d,`OCrack` =%d,`OArmas`=%d,`ODinheiro`=%d WHERE `OID` = %i"
[16:28:45] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE `bancoorg` SET `OMaconha` = 0,`OCocaina` = 0,`OCrack` =0,", callback: "(null)", format: "(null)"
[16:28:45] [DEBUG] CMySQLConnection::Connect - establishing connection to database...
[16:28:45] [DEBUG] CMySQLConnection::Connect - connection was successful
[16:28:45] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
[16:28:45] [DEBUG] CMySQLQuery::Execute[] - starting query execution
[16:28:45] [DEBUG] CMySQLQuery::Execute[] - query was successfully executed within 41.117 milliseconds
[16:28:45] [DEBUG] CMySQLQuery::Execute[] - no callback specified, skipping result saving
Comando que soma os valores
Код:
if(strcmp(cmd, "/descarregar", true) == 0)//descarregar nas HQ'S com um veiculo
	{
	   new Veh = GetPlayerVehicleID(playerid);
	   new query[1204];                 //apenas essas orgs \/
 	   
           for(new i = 0; i < MAX_ORG; i ++)
           {
	      if(VehTrafico[Veh][Tipo] == 1)//maconha
	      {
	    new VehCarga = VehTrafico[Veh][Carregado];
	    new CargaExis = oInfo[i][OMaconha];
	    oInfo[i][OMaconha] = VehCarga + CargaExis;
             mysql_format(mysql, query, sizeof(query), "UPDATE `bancoorg` SET `OMaconha` = %d WHERE `OID` = %i", oInfo[i][OMaconha], pInfo[playerid][Org]);
             mysql_tquery(mysql, query,"","",i);
             format(string,sizeof(string),"Vocк descarregou:[%d] de Maconha no Banco da Org",oInfo[i][OMaconha]);
             SendClientMessage(playerid,COR_ERROCMDADM,string);
             VehTrafico[Veh][Tipo] = 0;
             VehTrafico[Veh][Ocupado] = 0;
             VehTrafico[Veh][Carregado] = 0;
             return 1;
          }
       }
}
fiz pra tentar salvar ao finalizar o server.
Код:
stock SalvarEmpresas()
{
   new query[1024];
   for(new i = 0; i < MAX_ORG; i ++)
   {
     new Mac = oInfo[i][OMaconha];
     new Coc = oInfo[i][OCocaina];
     new Cra = oInfo[i][OCrack];
     new Arm = oInfo[i][OArmas];
     new Din = oInfo[i][ODinheiro];
     mysql_format(mysql, query, sizeof(query), "UPDATE `bancoorg` SET `OMaconha` = %d,`OCocaina` = %d,`OCrack` =%d,`OArmas`=%d,`ODinheiro`=%d WHERE `OID` = %i",\
	 Mac,Coc,Cra,Arm,Din,oInfo[i][OID]);
     mysql_tquery(mysql, query,"","",i);
     return 1;
   }
   return 1;
}
Reply
#2

Certifique que esteja fechando o mysql em ongamemodeexit

pawn Код:
mysql_close(mysql);
Reply
#3

Quote:
Originally Posted by Cleyson
Посмотреть сообщение
Certifique que esteja fechando o mysql em ongamemodeexit

pawn Код:
mysql_close(mysql);
Nгo estб fechando!
Mas se sim
Код:
[16:45:21] [DEBUG] CMySQLConnection::Disconnect - connection was closed
[16:45:21] [DEBUG] CMySQLHandle::~CMySQLHandle - deconstructor called
Nгo tenho acesso ao banco de dados
Reply
#4

Consegui reconecta automaticamente a reiniciar o server mas mesmo assim nгo ta salvando!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)