SA-MP Forums Archive
Problem loading MySQL. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Problem loading MySQL. (/showthread.php?tid=274144)



Problem loading MySQL. - loginreks - 04.08.2011

Hi, I have problem, no loading items in game, problem create loop while, code:


Quote:


new str[250],uid;
mysql_query("SELECT * FROM `items`");
mysql_store_result();

while(mysql_fetch_row(str, "|"))
{
sscanf(str, "p<|>d", uid);
sscanf(str, "p<|>is[32]iiiiiiffffff",
Items[uid][pUID],
...

I use include <mysql>

Please help me.


Re: Problem loading MySQL. - MadeMan - 04.08.2011

pawn Код:
while(mysql_fetch_row(str, "|"))
{
sscanf(str, "p<|>dis[32]iiiiiiffffff",
uid,
Items[uid][pUID],



Re: Problem loading MySQL. - loginreks - 04.08.2011

unfortunately doesn't work.


Re: Problem loading MySQL. - MadeMan - 04.08.2011

Show your 'Items' enum and MySQL table structure.


Re: Problem loading MySQL. - loginreks - 04.08.2011

enum:
Quote:

enum pItems {

pUID,
pType,
pName[32],
pUsing,
pModel,
pAmount,
pWeight,
pTrash,
pValue,
FloatPosX,
FloatPosY,
FloatPosZ,
FloatPotX,
FloatRotY,
FloatRotZ,
pVW,
Text3D:TextLabel,
pModelid

};

stock Items[MAX_ITEMS][pItems];
};

Structure:

Quote:

CREATE TABLE `items` (
`UID` int(11) NOT NULL auto_increment,
`Name` varchar(32) NOT NULL,
`Using` int(11) NOT NULL,
`Model` int(11) NOT NULL,
`Amount` int(11) NOT NULL,
`Weight` int(4) NOT NULL,
`Trash` int(1) NOT NULL,
`Value` int(11) NOT NULL,
`PosX` float NOT NULL,
`PosY` float NOT NULL,
`PosZ` float NOT NULL,
`RotX` float NOT NULL,
`RotY` float NOT NULL,
`RotZ` float NOT NULL,
`VW` int(11) NOT NULL,
PRIMARY KEY (`UID`)
) ENGINE=MyISAM DEFAULT CHAR