Problem with sscanf warnings.
#1

Hello.

When I delete my LoadBusinesses(); from OnGameModeInIt I get no sscanf warnings: Format specifier does not match parameter count.

But when I add it once again, I get them.

I have been looking over the code and I can't really see the problem. Also my friend gave it to me so I can't really know whats wrong.. Anyway can anyone of you see the problem in this code..

pawn Код:
LoadBusinesses() {

    if(!fexist("businesses.cfg")) return 1;

    new
        szFileStr[1024],
        File: iFileHandle = fopen("businesses.cfg", io_read),
        iIndex;

    while(iIndex < sizeof(BizInfo) && fread(iFileHandle, szFileStr)) {
        sscanf(szFileStr, "p<|>iiis[128]s[24]ffffffffiiiff",
            BizInfo[iIndex][bOwned],
            BizInfo[iIndex][bLevel],
            BizInfo[iIndex][bHInteriorWorld],
            BizInfo[iIndex][bDescription],
            BizInfo[iIndex][bOwner],
            BizInfo[iIndex][bExteriorX],
            BizInfo[iIndex][bExteriorY],
            BizInfo[iIndex][bExteriorZ],
            BizInfo[iIndex][bExteriorR],
            BizInfo[iIndex][bInteriorX],
            BizInfo[iIndex][bInteriorY],
            BizInfo[iIndex][bInteriorZ],
            BizInfo[iIndex][bInteriorR],
            BizInfo[iIndex][bValue],
            BizInfo[iIndex][bPickupID],
            BizInfo[iIndex][bCustomInterior],
            BizInfo[iIndex][bCustomExterior],
            BizInfo[iIndex][bExteriorA],
            BizInfo[iIndex][bInteriorA]
        );

        if(BizInfo[iIndex][bOwned]) {
            format(szFileStr, sizeof(szFileStr), "%s\n[Owner: %s]\nLevel: %d\nID: %d",BizInfo[iIndex][bDescription],BizInfo[iIndex][bOwner],BizInfo[iIndex][bLevel],iIndex);

            DestroyDynamicPickup(BizInfo[iIndex][bPickupID]);
            BizInfo[iIndex][bPickupID] = CreateDynamicPickup(1274, 23, BizInfo[iIndex][bExteriorX], BizInfo[iIndex][bExteriorY], BizInfo[iIndex][bExteriorZ]);
        }
        else format(szFileStr, sizeof(szFileStr), "%s\n[Owner: None]\nCost: $%d\n Level: %d\nID: %d\nTo buy this business type /buybiz",BizInfo[iIndex][bDescription],BizInfo[iIndex][bValue],BizInfo[iIndex][bLevel],iIndex);

        DestroyDynamicPickup(BizInfo[iIndex][bPickupID]);
        BizInfo[iIndex][bPickupID] = CreateDynamicPickup(1274, 23, BizInfo[iIndex][bExteriorX], BizInfo[iIndex][bExteriorY], BizInfo[iIndex][bExteriorZ]);
        BizInfo[iIndex][bTextID] = CreateDynamic3DTextLabel(szFileStr, COLOR_LIGHTBLUE, BizInfo[iIndex][bExteriorX], BizInfo[iIndex][bExteriorY], BizInfo[iIndex][bExteriorZ]+0.5,30.0, .testlos = 1, .streamdistance = 30.0);
        ++iIndex;
    }
    return fclose(iFileHandle);
}
All help appreciated.
Reply


Messages In This Thread
Problem with sscanf warnings. - by DavidSparks - 28.01.2015, 15:22
Re: Problem with sscanf warnings. - by Kaperstone - 28.01.2015, 15:27
Re: Problem with sscanf warnings. - by DavidSparks - 28.01.2015, 15:30
Re: Problem with sscanf warnings. - by Kaperstone - 28.01.2015, 15:34
Re: Problem with sscanf warnings. - by DavidSparks - 28.01.2015, 15:38

Forum Jump:


Users browsing this thread: 1 Guest(s)