01.02.2015, 17:58
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
Comando que soma os valores
fiz pra tentar salvar ao finalizar o server.
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
Код:
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; } } }
Код:
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; }