Sscanf Isn't Setting Enum
#1

Hey I've been having this problem where sscanf doesnt seem to want to apply the mySQL row to an enum, and I just cant figure out what is wrong. I've tried searching but all the threads with this problem never get answered and are abandoned.

Here is the query:
pawn Код:
mysql_query("SELECT * FROM samp_houses", THREAD_LOADHOUSES);
Here is the enum:
pawn Код:
enum hInfo
{
    hDBID,
    Float:hEntrancex,
    Float:hEntrancey,
    Float:hEntrancez,
    Float:hExitx,
    Float:hExity,
    Float:hExitz,
    hOwner[MAX_PLAYER_NAME],
    hDescription[MAX_PLAYER_NAME],
    hValue,
    hHel,
    hArm,
    hInt,
    hLock,
    hOwned,
    hRent,
    hRentabil,
    hTakings,
    hVec,
    hVcol1,
    hVcol2,
    hLevel,
    hWorld,
    hSetted,
    hDrugs,
    hMaterials,
    hWeapon1,
    hAmmo1,
    hWeapon2,
    hAmmo2,
    hWeapon3,
    hAmmo3,
    hWeapon4,
    hAmmo4,
    hWeapon5,
    hAmmo5,
    hWeapon6,
    hAmmo6,
    hDate,
    hMessage[64],
};
new HouseInfo[MAX_HOUSES][hInfo];
Here is where the magic happens:
pawn Код:
case THREAD_LOADHOUSES:
        {
            mysql_store_result();
            new row[4000];
            while(mysql_fetch_row(row))
            {
                printf(row);
                sscanf(row, "p<|>e<iffffffs[24]s[24]iiiiiiiiiiiiiiiiiiiiiiiiiis[64]>", HouseInfo[1]);
                new checking[40];
                format(checking,sizeof(checking),"%d %s",HouseInfo[1][hDBID],HouseInfo[1][hOwner]);
                printf(checking);
            }
            mysql_free_result();
        }
printf(row); prints the row correctly
printf(checking); prints "0 ". It should be "1 No-one"
House isnt IG.

I've tried changing the i's to d's, putting p<|> inside of e<>. I've checked multiple times that the database = the enum = sscanf (same order and made sure all fields were accounted for) but to no avail.

If I could get some help that would be greatly appreciated.
Thanks,
Josh
Reply


Messages In This Thread
Sscanf Isn't Setting Enum - by DaRkM - 10.07.2012, 22:45
Re: Sscanf Isn't Setting Enum - by coole210 - 10.07.2012, 22:50
Re: Sscanf Isn't Setting Enum - by DaRkM - 10.07.2012, 22:56
Re: Sscanf Isn't Setting Enum - by DaRkM - 11.07.2012, 22:53
Re: Sscanf Isn't Setting Enum - by DaRkM - 14.07.2012, 02:52

Forum Jump:


Users browsing this thread: 1 Guest(s)