[PROBLEM] Splitting rows with sscanf
#1

This is the code I have:
pawn Код:
new Query[80];
    for(new i=0; i < MAX_BIZ; i++)
    {
        format(Query, sizeof(Query), "SELECT * FROM `Business` WHERE 'bID' = '%d' ",i);
        mysql_query(Query);
        mysql_store_result();
        mysql_fetch_row_format(Query, "|");
        sscanf(Query, "e<p<|>iiis[24]iiiffffffffiiiiiis[128]>", BusinessInfo[i]);
        BusinessInfo[i][bOutsideIcon] = CreateDynamicPickup(1272, 1, BusinessInfo[i][bEntranceX], BusinessInfo[i][bEntranceY], BusinessInfo[i][bEntranceZ], BusinessInfo[i][bWorld]); //Creates a pickup at the business entrance.
        BusinessInfo[i][bInsideIcon] = CreateDynamicPickup(1272, 1, BusinessInfo[i][bExitX], BusinessInfo[i][bExitY], BusinessInfo[i][bExitZ], BusinessInfo[i][bInsideWorld]); //Creates a pickup at the exit(Inside the interior)
        printf("EntranceX: %f\nEntranceY: %f\nEntranceZ: %f",BusinessInfo[i][bEntranceX],BusinessInfo[i][bEntranceY],BusinessInfo[i][bEntranceZ]);
        mysql_free_result();
    }
And the enum:
pawn Код:
enum bInfo {
    bID,
    bOwned,
    bPrice,
    bOwner[MAX_PLAYER_NAME],
    bType,
    bLocked,
    bMoney,
    Float:bEntranceX,
    Float:bEntranceY,
    Float:bEntranceZ,
    Float:bEntranceA,
    Float:bExitX,
    Float:bExitY,
    Float:bExitZ,
    Float:bExitA,
    bInt,
    bWorld,
    bInsideInt,
    bInsideWorld,
    bInsideIcon,
    bOutsideIcon,
    bName[128]
}
When loading, the X,Y and Z positions are always 0 and I have no idea why
Reply


Messages In This Thread
[PROBLEM] Splitting rows with sscanf - by zombieking - 28.03.2013, 19:11
Re: [PROBLEM] Splitting rows with sscanf - by InfiniTy. - 28.03.2013, 19:20
Re: [PROBLEM] Splitting rows with sscanf - by zombieking - 28.03.2013, 19:24
Re: [PROBLEM] Splitting rows with sscanf - by InfiniTy. - 28.03.2013, 19:26
Re: [PROBLEM] Splitting rows with sscanf - by zombieking - 28.03.2013, 19:29
Re: [PROBLEM] Splitting rows with sscanf - by Riddy - 28.03.2013, 19:32
Re: [PROBLEM] Splitting rows with sscanf - by InfiniTy. - 28.03.2013, 19:35
Re: [PROBLEM] Splitting rows with sscanf - by zombieking - 28.03.2013, 19:35

Forum Jump:


Users browsing this thread: 3 Guest(s)