15.04.2015, 23:36
i made a system for saving and loading,it loads right but when i save it saves wrong ,everything gets messed,like num stays 3 while it has been set to 0,here is the code
NOTE:it prints the query right but saves wrong in database
pawn Код:
forward SaveIds();
public SaveIds()
{
for(new id = 0; id < MAX_IDS; id++)
{
new query[128];
mysql_format(mysqlquery, query, sizeof(query), "UPDATE `ids` SET `IDSet`=%d, `IDDone`=%d, `IDPosX`=%f, `IDPosY`=%f, `IDPosZ`=%f,`IDPosA`=%f, `IDNum`=%d, `IDAmount`=%d, `IDType`=%d, `IDTypename`='%s', `IDMoveX`=%f, `IDMoveY`=%f, `IDMoveZ`=%f WHERE `ID`=%d",
IdInfo[id][idset], IdInfo[id][iddone], IdInfo[id][idposx], IdInfo[id][idposy], IdInfo[id][idposz],
IdInfo[id][idposa], IdInfo[id][idnum], IdInfo[id][idamount], IdInfo[id][idtype], IdInfo[id][idtypename]
,IdInfo[id][idmovex], IdInfo[id][idmovey], IdInfo[id][idmovez], id);
printf("\n %s", query);
mysql_tquery(mysqlquery, query);
printf("Saved ID %d", id);
}
return 1;
}