Weird Error but why?
#1

Edit: Go here instead: http://forum.sa-mp.com/showpost.php?...4&postcount=14

pawn Код:
for(new dialogID = 1; dialogID <= MAX_DIALOGS; dialogID++) {
        if(Dialog[dialogID][SK94_dialogCreated] == 0) { // Line 535
I'm getting an error with these lines.

Код:
C:\Users\TheLazySloth\Desktop\San Andreas Multiplayer\Server\pawno\include\SKFunctions.inc(535) : error 001: expected token: ")", but found "["
C:\Users\TheLazySloth\Desktop\San Andreas Multiplayer\Server\pawno\include\SKFunctions.inc(535) : error 029: invalid expression, assumed zero
C:\Users\TheLazySloth\Desktop\San Andreas Multiplayer\Server\pawno\include\SKFunctions.inc(535) : warning 215: expression has no effect
C:\Users\TheLazySloth\Desktop\San Andreas Multiplayer\Server\pawno\include\SKFunctions.inc(535) : error 001: expected token: ";", but found "]"
C:\Users\TheLazySloth\Desktop\San Andreas Multiplayer\Server\pawno\include\SKFunctions.inc(535) : fatal error 107: too many error messages on one line
Reply
#2

Can you paste the whole section of that code, please?
Reply
#3

Certainly...

pawn Код:
stock CreateDialog(Type, Format[], {Float,_}:...) {
    if(Type != DIALOG_STYLE_MSGBOX && Type != DIALOG_STYLE_LIST && Type != DIALOG_STYLE_INPUT && Type != DIALOG_STYLE_PASSWORD) {
        return 0;
    }

    for(new dialogID = 1; dialogID <= MAX_DIALOGS; dialogID++) {
        if(Dialog[dialogID][SK94_dialogCreated] == 0) { // Line 535
            new Title[MAX_DIALOG_STRING],
                Arg = 2;
   
            for(new FormatPos = 0; FormatPos < strlen(Format); FormatPos++) {
                if(Format[FormatPos] == '%') {
                    switch(Format[(FormatPos + 1)]) {
                        case 's': {
                            for(new Index = 0; getarg(Arg, Index); Index++) {
                                Title[strlen(Title)] = getarg(Arg, Index);
                            }
                           
                            FormatPos++;
                            Arg++;
                        }
                        case 'd', 'i': {
                            new Result = getarg(Arg);
                           
                            if(strlen(Title)) {
                                format(Title, MAX_DIALOG_STRING, "%s%d", Title, Result);
                            }
                            else {
                                format(Title, MAX_DIALOG_STRING, "%d", Result);
                            }
                           
                            FormatPos++;
                            Arg++;
                        }
                        case 'f': {
                            new Float: Result = Float: getarg(Arg);
                           
                            if(strlen(Title)) {
                                format(Title, MAX_DIALOG_STRING, "%s%f", Title, Result);
                            }
                            else {
                                format(Title, MAX_DIALOG_STRING, "%f", Result);
                            }
                           
                            FormatPos++;
                            Arg++;
                        }
                        default: {
                            Title[strlen(Title)] = Format[FormatPos];
                        }
                    }
                }
                else {
                    Title[strlen(Title)] = Format[FormatPos];
                }
            }
   
            Dialog[dialogID][SK94_dialogCreated] = true;
            Dialog[dialogID][SK94_dialogType] = Type;
            format(Dialog[dialogID][SK94_dialogTitle], MAX_DIALOG_STRING, "%s", Title);
            return dialogID;
        }
    }
    return 0;
}
Reply
#4

Is it the include? because the error is on your include
Reply
#5

Quote:
Originally Posted by IceMeteor
Посмотреть сообщение
you forgot the ;
pawn Код:
for(new dialogID = 1; dialogID <= MAX_DIALOGS; dialogID++) {
        if(Dialog[dialogID][SK94_dialogCreated] == 0;) {
You don't end a if statement with a ; in any scripting language,
I just tried it incase you were right and I'm still getting the same error.

Quote:
Originally Posted by IceMeteor
Посмотреть сообщение
Is it the include? because the error is on your include
It is my custom include, I've compiled the include and it shows no errors.

So it has to be the gamemode, the gamemode is the one showing the errors when compiling.
Reply
#6

Quote:
Originally Posted by Sniper Kitty
Посмотреть сообщение
You don't end a if statement with a ; in any scripting language,
I just tried it incase you were right and I'm still getting the same error.
Sorry i made a mistake XD
Reply
#7

Quote:
Originally Posted by IceMeteor
Посмотреть сообщение
Sorry i made a mistake XD
It's okay.
Reply
#8

Can you show the line 535 in your include ?
Reply
#9

The if statement you tried correcting me on is line 535
Reply
#10

Show us how you have made this array.

pawn Код:
Dialog[dialogID][SK94_dialogCreated]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)