24.07.2011, 14:25
(
Последний раз редактировалось loginreks; 24.07.2011 в 15:03.
)
Hello, I have problem my system badly reads items, here is the code
arrays:
AND
database:
Please of help .
Quote:
public MySQLLoadItems() { new str[128],itemid; mysql_query("SELECT * FROM `items`"); mysql_store_result(); while(mysql_fetch_row(str, "|")) { sscanf(str, "p<|>ddddfff",itemid, Products[itemid][iName], Products[itemid][iObject], Products[itemid][iIlosc], Products[itemid][Pos_x], Products[itemid][Pos_y], Products[itemid][Pos_z]); Create3DTextLabel(ItemName[Products[itemid][iName]], -1, Products[itemid][Pos_x], Products[itemid][Pos_y], Products[itemid][Pos_z], 10.0, 0); } return 1; } |
Quote:
enum dInfo { Float:rot_x, Float:rot_y, Float:rot_z, Float:rot_d, Float:Pos_x, Float:Pos_y, Float:Pos_z, Float:Pos_d, iName, iObject, iIlosc, UID }; #define MAX_PRODUCTS 10 // new Products[MAX_PRODUCTS][dInfo]; |
Quote:
new ItemName[][48] = { {" "}, // 0 - Występuje błąd {"apple"}, // 1 {"notebook"} // 2 }; |
Quote:
CREATE TABLE `items` ( `Id` int(11) NOT NULL auto_increment, `Type` int(11) NOT NULL, `object` int(11) NOT NULL, `Ilosc` int(11) NOT NULL, `PosX` int(11) NOT NULL, `PosY` int(11) NOT NULL, `PosZ` int(11) NOT NULL, `UID` int(11) NOT NULL, PRIMARY KEY (`Id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=43 ; -- -- Zrzut danych tabeli `items` -- INSERT INTO `items` VALUES (42, 42, 42, 0, 1749, -1855, 13, 0); |