25.05.2013, 18:53
Here is my SQL result:
Here is the PAWN code:
The problem, as I hope described in title, is that server continuously prints "Item sscanf executed without all fields." I'm sure there's just some stupid thing I've done, but I'm really scratching my head on this one.
PS - This is obviously not my full OnGameModeInit(), just making sure I don't get any lazy answers.
Код:
[Sat May 25 13:51:14 2013] Function: mysql_fetch_row executed with result: "2,Bandage,1,0,0,0,0,0,64,0,1,100,Bandage,100,NULL,NULL,NULL,NULL".
Код:
#define MAX_ITEMS 200 enum itmEnum { entID, entName[32], itemID, relID, wepID, wepLvl, fxID, fxLvl, itemAmount, bagID, safeID, quality, itemName[32], maxStack, wepName[32], gameID, wepBaseDmg, fxName[32] }; new ItemStats[MAX_ITEMS][itmEnum]; public OnGameModeInit() { mysql_query("SELECT itement.entID, itement.entName, itement.itemID, itement.relID, itement.wepID, itement.wepLvl, itement.fxID, itement.fxLvl, itement.amount, itement.charID, itement.safeID, itement.quality, itemtmp.itemName, itemtmp.itemMaxStack, weptmp.wepName, weptmp.gameID, weptmp.wepBaseDmg, wepfx.fxName FROM itement LEFT JOIN itemtmp ON itement.itemID = itemtmp.itemID LEFT JOIN weptmp ON itement.wepID = weptmp.wepID LEFT JOIN wepfx ON itement.fxID = wepfx.fxID WHERE safeid != 0"); mysql_store_result(); i=1; while(mysql_fetch_row(data, ",")) { if(sscanf(data, "p<,>is[32]iiiiiiiiiiS(test)[32]I(0)S(test)[32]I(0)I(0)S(test)[32]", ItemStats[i][entID], ItemStats[i][entName], ItemStats[i][itemID], ItemStats[i][relID], ItemStats[i][wepID], ItemStats[i][wepLvl], ItemStats[i][fxID], ItemStats[i][fxLvl], ItemStats[i][itemAmount], ItemStats[i][bagID], ItemStats[i][safeID], ItemStats[i][quality], ItemStats[i][itemName], ItemStats[i][maxStack], ItemStats[i][wepName], ItemStats[i][gameID], ItemStats[i][wepBaseDmg], ItemStats[i][fxName])) return print("ERROR: Item sscanf executed without all fields."); i++; } mysql_free_result(); }
PS - This is obviously not my full OnGameModeInit(), just making sure I don't get any lazy answers.