3 different errors
#1

I am getting these errors;

(16627) : error 029: invalid expression, assumed zero
(16627) : warning 215: expression has no effect
(16627) : error 001: expected token: ";", but found "]"
(16627) : fatal error 107: too many error messages on one line

On this code:

pawn Код:
SaveHouses() {

    new
        szFileStr[2048],
        File: fHandle = fopen("houses.cfg", io_write);

    for(new iIndex; iIndex < MAX_HOUSES; iIndex++) {
        format(szFileStr, sizeof(szFileStr), "%d|%d|%d|%s|%s|%f|%f|%f|%f|%f|%f|%f|%f|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%f|%f|%f|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d\r\n",
            HouseInfo[iIndex][hOwned],
            HouseInfo[iIndex][hLevel],
            HouseInfo[iIndex][hHInteriorWorld],
            HouseInfo[iIndex][hDescription],
            HouseInfo[iIndex][hOwner],
            HouseInfo[iIndex][hExteriorX],
            HouseInfo[iIndex][hExteriorY],
            HouseInfo[iIndex][hExteriorZ],
            HouseInfo[iIndex][hExteriorR],
            HouseInfo[iIndex][hInteriorX],
            HouseInfo[iIndex][hInteriorY],
            HouseInfo[iIndex][hInteriorZ],
            HouseInfo[iIndex][hInteriorR],
            HouseInfo[iIndex][hLock],
            HouseInfo[iIndex][hRentable],
            HouseInfo[iIndex][hRentFee],
            HouseInfo[iIndex][hValue],
            HouseInfo[iIndex][hSafeMoney],
            HouseInfo[iIndex][hPot],
            HouseInfo[iIndex][hCrack],
            HouseInfo[iIndex][hMaterials],
            HouseInfo[iIndex][hWeapons][0],
            HouseInfo[iIndex][hWeapons][1],
            HouseInfo[iIndex][hWeapons][2],
            HouseInfo[iIndex][hWeapons][3],
            HouseInfo[iIndex][hWeapons][4],
            HouseInfo[iIndex][hGLUpgrade],
            HouseInfo[iIndex][hPickupID],
            HouseInfo[iIndex][hCustomInterior],
            HouseInfo[iIndex][hCustomExterior],
            HouseInfo[iIndex][hMailboxX],
            HouseInfo[iIndex][hMailboxY],
            HouseInfo[iIndex][hMailboxZ],
            HouseInfo[iIndex][hMail1Sender][26],  //THE ERROR LINE
            HouseInfo[iIndex][hMail1Topic][30],
            HouseInfo[iIndex][hMail1Message][150],
            HouseInfo[iIndex][hMail2Sender][26],
            HouseInfo[iIndex][hMail2Topic][30],
            HouseInfo[iIndex][hMail2Message][150],
            HouseInfo[iIndex][hMail3Sender][26],
            HouseInfo[iIndex][hMail3Topic][30],
            HouseInfo[iIndex][hMail3Message][150],
            HouseInfo[iIndex][hMail4Sender][26],
            HouseInfo[iIndex][hMail4Topic][30],
            HouseInfo[iIndex][hMail4Message][150],
            HouseInfo[iIndex][hMail5Sender][26],
            HouseInfo[iIndex][hMail5Topic][30],
            HouseInfo[iIndex][hMail5Message][150],
            HouseInfo[iIndex][hMail6Sender][26],
            HouseInfo[iIndex][hMail6Topic][30],
            HouseInfo[iIndex][hMail6Message][150],
        );
        fwrite(fHandle, szFileStr);
    }
    return fclose(fHandle);
}
Reply
#2

pawn Код:
SaveHouses() {

    new
        szFileStr[2048],
        File: fHandle = fopen("houses.cfg", io_write);

    for(new iIndex; iIndex < MAX_HOUSES; iIndex++) {
        format(szFileStr, sizeof(szFileStr), "%d|%d|%d|%s|%s|%f|%f|%f|%f|%f|%f|%f|%f|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%f|%f|%f|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d\r\n",
            HouseInfo[iIndex][hOwned],
            HouseInfo[iIndex][hLevel],
            HouseInfo[iIndex][hHInteriorWorld],
            HouseInfo[iIndex][hDescription],
            HouseInfo[iIndex][hOwner],
            HouseInfo[iIndex][hExteriorX],
            HouseInfo[iIndex][hExteriorY],
            HouseInfo[iIndex][hExteriorZ],
            HouseInfo[iIndex][hExteriorR],
            HouseInfo[iIndex][hInteriorX],
            HouseInfo[iIndex][hInteriorY],
            HouseInfo[iIndex][hInteriorZ],
            HouseInfo[iIndex][hInteriorR],
            HouseInfo[iIndex][hLock],
            HouseInfo[iIndex][hRentable],
            HouseInfo[iIndex][hRentFee],
            HouseInfo[iIndex][hValue],
            HouseInfo[iIndex][hSafeMoney],
            HouseInfo[iIndex][hPot],
            HouseInfo[iIndex][hCrack],
            HouseInfo[iIndex][hMaterials],
            HouseInfo[iIndex][hWeapons][0],
            HouseInfo[iIndex][hWeapons][1],
            HouseInfo[iIndex][hWeapons][2],
            HouseInfo[iIndex][hWeapons][3],
            HouseInfo[iIndex][hWeapons][4],
            HouseInfo[iIndex][hGLUpgrade],
            HouseInfo[iIndex][hPickupID],
            HouseInfo[iIndex][hCustomInterior],
            HouseInfo[iIndex][hCustomExterior],
            HouseInfo[iIndex][hMailboxX],
            HouseInfo[iIndex][hMailboxY],
            HouseInfo[iIndex][hMailboxZ],
            HouseInfo[iIndex][hMail1Sender][26],  //THE ERROR LINE
            HouseInfo[iIndex][hMail1Topic][30],
            HouseInfo[iIndex][hMail1Message][150],
            HouseInfo[iIndex][hMail2Sender][26],
            HouseInfo[iIndex][hMail2Topic][30],
            HouseInfo[iIndex][hMail2Message][150],
            HouseInfo[iIndex][hMail3Sender][26],
            HouseInfo[iIndex][hMail3Topic][30],
            HouseInfo[iIndex][hMail3Message][150],
            HouseInfo[iIndex][hMail4Sender][26],
            HouseInfo[iIndex][hMail4Topic][30],
            HouseInfo[iIndex][hMail4Message][150],
            HouseInfo[iIndex][hMail5Sender][26],
            HouseInfo[iIndex][hMail5Topic][30],
            HouseInfo[iIndex][hMail5Message][150],
            HouseInfo[iIndex][hMail6Sender][26],
            HouseInfo[iIndex][hMail6Topic][30],
            HouseInfo[iIndex][hMail6Message][150]
        );
        fwrite(fHandle, szFileStr);
    }
    return fclose(fHandle);
}
Reply
#3

Quote:
Originally Posted by Ironboy
Посмотреть сообщение
pawn Код:
SaveHouses() {

    new
        szFileStr[2048],
        File: fHandle = fopen("houses.cfg", io_write);

    for(new iIndex; iIndex < MAX_HOUSES; iIndex++) {
        format(szFileStr, sizeof(szFileStr), "%d|%d|%d|%s|%s|%f|%f|%f|%f|%f|%f|%f|%f|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%f|%f|%f|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d\r\n",
            HouseInfo[iIndex][hOwned],
            HouseInfo[iIndex][hLevel],
            HouseInfo[iIndex][hHInteriorWorld],
            HouseInfo[iIndex][hDescription],
            HouseInfo[iIndex][hOwner],
            HouseInfo[iIndex][hExteriorX],
            HouseInfo[iIndex][hExteriorY],
            HouseInfo[iIndex][hExteriorZ],
            HouseInfo[iIndex][hExteriorR],
            HouseInfo[iIndex][hInteriorX],
            HouseInfo[iIndex][hInteriorY],
            HouseInfo[iIndex][hInteriorZ],
            HouseInfo[iIndex][hInteriorR],
            HouseInfo[iIndex][hLock],
            HouseInfo[iIndex][hRentable],
            HouseInfo[iIndex][hRentFee],
            HouseInfo[iIndex][hValue],
            HouseInfo[iIndex][hSafeMoney],
            HouseInfo[iIndex][hPot],
            HouseInfo[iIndex][hCrack],
            HouseInfo[iIndex][hMaterials],
            HouseInfo[iIndex][hWeapons][0],
            HouseInfo[iIndex][hWeapons][1],
            HouseInfo[iIndex][hWeapons][2],
            HouseInfo[iIndex][hWeapons][3],
            HouseInfo[iIndex][hWeapons][4],
            HouseInfo[iIndex][hGLUpgrade],
            HouseInfo[iIndex][hPickupID],
            HouseInfo[iIndex][hCustomInterior],
            HouseInfo[iIndex][hCustomExterior],
            HouseInfo[iIndex][hMailboxX],
            HouseInfo[iIndex][hMailboxY],
            HouseInfo[iIndex][hMailboxZ],
            HouseInfo[iIndex][hMail1Sender][26],  //THE ERROR LINE
            HouseInfo[iIndex][hMail1Topic][30],
            HouseInfo[iIndex][hMail1Message][150],
            HouseInfo[iIndex][hMail2Sender][26],
            HouseInfo[iIndex][hMail2Topic][30],
            HouseInfo[iIndex][hMail2Message][150],
            HouseInfo[iIndex][hMail3Sender][26],
            HouseInfo[iIndex][hMail3Topic][30],
            HouseInfo[iIndex][hMail3Message][150],
            HouseInfo[iIndex][hMail4Sender][26],
            HouseInfo[iIndex][hMail4Topic][30],
            HouseInfo[iIndex][hMail4Message][150],
            HouseInfo[iIndex][hMail5Sender][26],
            HouseInfo[iIndex][hMail5Topic][30],
            HouseInfo[iIndex][hMail5Message][150],
            HouseInfo[iIndex][hMail6Sender][26],
            HouseInfo[iIndex][hMail6Topic][30],
            HouseInfo[iIndex][hMail6Message][150]
        );
        fwrite(fHandle, szFileStr);
    }
    return fclose(fHandle);
}
What did I do wrong in my code?
Reply
#4

You don't have to use ' , ' at the end.
pawn Код:
HouseInfo[iIndex][hMail6Message][150],
Correct code is

pawn Код:
HouseInfo[iIndex][hMail6Message][150]
Reply
#5

I fixed it, but I still receive the same errors on the same line. This is the error line:

HouseInfo[iIndex][hMail1Sender][26], //THE ERROR LINE
Reply
#6

can we see the enum?
Reply
#7

Is it because you have %d instead of a %s in the format line, because you can't really use %d on a string with a certain string length. Try this:
pawn Код:
SaveHouses() {

    new
        szFileStr[2048],
        File: fHandle = fopen("houses.cfg", io_write);

    for(new iIndex; iIndex < MAX_HOUSES; iIndex++) {
        format(szFileStr, sizeof(szFileStr), "%d|%d|%d|%s|%s|%f|%f|%f|%f|%f|%f|%f|%f|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%f|%f|%f|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s\r\n",
            HouseInfo[iIndex][hOwned],
            HouseInfo[iIndex][hLevel],
            HouseInfo[iIndex][hHInteriorWorld],
            HouseInfo[iIndex][hDescription],
            HouseInfo[iIndex][hOwner],
            HouseInfo[iIndex][hExteriorX],
            HouseInfo[iIndex][hExteriorY],
            HouseInfo[iIndex][hExteriorZ],
            HouseInfo[iIndex][hExteriorR],
            HouseInfo[iIndex][hInteriorX],
            HouseInfo[iIndex][hInteriorY],
            HouseInfo[iIndex][hInteriorZ],
            HouseInfo[iIndex][hInteriorR],
            HouseInfo[iIndex][hLock],
            HouseInfo[iIndex][hRentable],
            HouseInfo[iIndex][hRentFee],
            HouseInfo[iIndex][hValue],
            HouseInfo[iIndex][hSafeMoney],
            HouseInfo[iIndex][hPot],
            HouseInfo[iIndex][hCrack],
            HouseInfo[iIndex][hMaterials],
            HouseInfo[iIndex][hWeapons][0],
            HouseInfo[iIndex][hWeapons][1],
            HouseInfo[iIndex][hWeapons][2],
            HouseInfo[iIndex][hWeapons][3],
            HouseInfo[iIndex][hWeapons][4],
            HouseInfo[iIndex][hGLUpgrade],
            HouseInfo[iIndex][hPickupID],
            HouseInfo[iIndex][hCustomInterior],
            HouseInfo[iIndex][hCustomExterior],
            HouseInfo[iIndex][hMailboxX],
            HouseInfo[iIndex][hMailboxY],
            HouseInfo[iIndex][hMailboxZ],
            HouseInfo[iIndex][hMail1Sender][26],  //THE ERROR LINE
            HouseInfo[iIndex][hMail1Topic][30],
            HouseInfo[iIndex][hMail1Message][150],
            HouseInfo[iIndex][hMail2Sender][26],
            HouseInfo[iIndex][hMail2Topic][30],
            HouseInfo[iIndex][hMail2Message][150],
            HouseInfo[iIndex][hMail3Sender][26],
            HouseInfo[iIndex][hMail3Topic][30],
            HouseInfo[iIndex][hMail3Message][150],
            HouseInfo[iIndex][hMail4Sender][26],
            HouseInfo[iIndex][hMail4Topic][30],
            HouseInfo[iIndex][hMail4Message][150],
            HouseInfo[iIndex][hMail5Sender][26],
            HouseInfo[iIndex][hMail5Topic][30],
            HouseInfo[iIndex][hMail5Message][150],
            HouseInfo[iIndex][hMail6Sender][26],
            HouseInfo[iIndex][hMail6Topic][30],
            HouseInfo[iIndex][hMail6Message][150]
        );
        fwrite(fHandle, szFileStr);
    }
    return fclose(fHandle);
}
Reply
#8

Oh my God how did I make this mistake, or even worse, why did I not discover this!

Thank you!
Reply
#9

Still the same errors :/

This is the Enum:
pawn Код:
enum hInfo
{
    hOwned,
    hLevel,
    hHInteriorWorld,
    hCustomInterior,
    hDescription[128],
    hOwner[ MAX_PLAYER_NAME ],
    Float: hExteriorX,
    Float: hExteriorY,
    Float: hExteriorZ,
    Float: hExteriorR,
    Float: hExteriorA,
    Float: hInteriorX,
    Float: hInteriorY,
    Float: hInteriorZ,
    Float: hInteriorR,
    Float: hInteriorA,
    hLock,
    hRentable,
    hRentFee,
    hValue,
    hSafeMoney,
    hPot,
    hCrack,
    hMaterials,
    hWeapons[ 5 ],
    hGLUpgrade,
    hPickupID,
    Text3D: hTextID,
    hCustomExterior,
    Float: hMailboxX,
    Float: hMailboxY,
    Float: hMailboxZ,
    Mail1Sender[26],
    Mail1Topic[30],
    Mail1Message[150],
    Mail2Sender[26],
    Mail2Topic[30],
    Mail2Message[150],
    Mail3Sender[26],
    Mail3Topic[30],
    Mail3Message[150],
    Mail4Sender[26],
    Mail4Topic[30],
    Mail4Message[150],
    Mail5Sender[26],
    Mail5Topic[30],
    Mail5Message[150],
    Mail6Sender[26],
    Mail6Topic[30],
    Mail6Message[150],
};
Reply
#10

pawn Код:
enum hInfo
{
    hOwned,
    hLevel,
    hHInteriorWorld,
    hCustomInterior,
    hDescription[128],
    hOwner[ MAX_PLAYER_NAME ],
    Float: hExteriorX,
    Float: hExteriorY,
    Float: hExteriorZ,
    Float: hExteriorR,
    Float: hExteriorA,
    Float: hInteriorX,
    Float: hInteriorY,
    Float: hInteriorZ,
    Float: hInteriorR,
    Float: hInteriorA,
    hLock,
    hRentable,
    hRentFee,
    hValue,
    hSafeMoney,
    hPot,
    hCrack,
    hMaterials,
    hWeapons[ 5 ],
    hGLUpgrade,
    hPickupID,
    Text3D: hTextID,
    hCustomExterior,
    Float: hMailboxX,
    Float: hMailboxY,
    Float: hMailboxZ,
    Mail1Sender[26],
    Mail1Topic[30],
    Mail1Message[150],
    Mail2Sender[26],
    Mail2Topic[30],
    Mail2Message[150],
    Mail3Sender[26],
    Mail3Topic[30],
    Mail3Message[150],
    Mail4Sender[26],
    Mail4Topic[30],
    Mail4Message[150],
    Mail5Sender[26],
    Mail5Topic[30],
    Mail5Message[150],
    Mail6Sender[26],
    Mail6Topic[30],
    Mail6Message[150]
};
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)