stock SaveVehicle(vehicleID) { format(szQuery, sizeof(szQuery), "UPDATE `vehicles` SET `veh_Taken` = '%d', `veh_Int` = '%d', `veh_VW` = '%d', `veh_Model` = '%d', `veh_Color1` = '%d', `veh_Color2` = '%d', `veh_Job` = '%d', `veh_PosX` = '%f'", VehicleData[vehicleID][veh_Taken], VehicleData[vehicleID][veh_INT], VehicleData[vehicleID][veh_VW], VehicleData[vehicleID][veh_Model], VehicleData[vehicleID][veh_Color1], VehicleData[vehicleID][veh_Color2], VehicleData[vehicleID][veh_Job], VehicleData[vehicleID][veh_OutsidePosition][0]); format(szQuery, sizeof(szQuery), "%s, `veh_PosY` = '%f', `veh_PosZ` = '%f', `veh_PosA` = '%f', `veh_Faction` = '%i', `veh_Family` = '%d', `veh_Kilometros` = '%d'", szQuery, VehicleData[vehicleID][veh_OutsidePosition][1], VehicleData[vehicleID][veh_OutsidePosition][2], VehicleData[vehicleID][veh_OutsidePosition][3], VehicleData[vehicleID][veh_Faction], VehicleData[vehicleID][veh_Family], VehicleData[vehicleID][veh_Staff], VehicleData[vehicleID][veh_Kilometros]); format(szQuery, sizeof(szQuery), "%s, `veh_Metros` = '%d' WHERE `vehicleIDz` = '%d", szQuery, VehicleData[vehicleID][veh_Metros], vehicleID); return mysql_function_query(MainPipeline, szQuery, true, "OnQueryFinish", "ii", THREAD_NO_RESULT, vehicleID); }
Код:
stock SaveVehicle(vehicleID) { format(szQuery, sizeof(szQuery), "UPDATE `vehicles` SET `veh_Taken` = '%d', `veh_Int` = '%d', `veh_VW` = '%d', `veh_Model` = '%d', `veh_Color1` = '%d', `veh_Color2` = '%d', `veh_Job` = '%d', `veh_PosX` = '%f'", VehicleData[vehicleID][veh_Taken], VehicleData[vehicleID][veh_INT], VehicleData[vehicleID][veh_VW], VehicleData[vehicleID][veh_Model], VehicleData[vehicleID][veh_Color1], VehicleData[vehicleID][veh_Color2], VehicleData[vehicleID][veh_Job], VehicleData[vehicleID][veh_OutsidePosition][0]); format(szQuery, sizeof(szQuery), "%s, `veh_PosY` = '%f', `veh_PosZ` = '%f', `veh_PosA` = '%f', `veh_Faction` = '%i', `veh_Family` = '%d', `veh_Kilometros` = '%d'", szQuery, VehicleData[vehicleID][veh_OutsidePosition][1], VehicleData[vehicleID][veh_OutsidePosition][2], VehicleData[vehicleID][veh_OutsidePosition][3], VehicleData[vehicleID][veh_Faction], VehicleData[vehicleID][veh_Family], VehicleData[vehicleID][veh_Staff], VehicleData[vehicleID][veh_Kilometros]); format(szQuery, sizeof(szQuery), "%s, `veh_Metros` = '%d' WHERE `vehicleIDz` = '%d", szQuery, VehicleData[vehicleID][veh_Metros], vehicleID); return mysql_function_query(MainPipeline, szQuery, true, "OnQueryFinish", "ii", THREAD_NO_RESULT, vehicleID); } |
"`veh_PosY` = '%f', `veh_PosZ` = '%f', `veh_PosA` = '%f', `veh_Faction` = '%i', `veh_Family` = '%d', `veh_Kilometros` = '%d', `veh_Metros` = '%f' WHERE `vehicleIDz` = '%d" |
Vocк esta formatando a query mas na ultima linha a string sу tem isso armazenado.
Faltou usar strcat Alias, o problema esta na concatenaзгo da string szQuery. |
Da pra fazer por format tbm... Se a sintaxe SQL ta incorreta provavelmente foi mesmo nessa concatenacao.
@Edit nao falta um ' no final? Talvez a string esteja pequena caso tenha colocado... |
Da pra fazer por format tbm... Se a sintaxe SQL ta incorreta provavelmente foi mesmo nessa concatenacao.
@Edit nao falta um ' no final? Talvez a string esteja pequena caso tenha colocado... |