#1

Hello guys i have a problem whenever i compile my script this is the part where errors appear
Код:
        case DIALOG_SERVER:
        {
            if(response)
            {
                assert(IsPlayerAdmin(playerid));
                switch(listitem)
                {
                	case 0: ShowPlayerDialog(playerid, DIALOG_SERVER+1, DIALOG_STYLE_INPUT, " ", "Enter the Master Key to continue...\n\n\t If not close this dialog.", ">>", "X");
					case 1: ShowPlayerDialog(playerid, DIALOG_SERVER+3, DIALOG_STYLE_INPUT, " ", "Enter the Master Key to continue...\n\n\t If not close this dialog.", ">>", "X");
					case 2: ShowPlayerDialog(playerid, DIALOG_SERVER+5, DIALOG_STYLE_INPUT, " ", "Enter the Master Key to continue...\n\n\t If not close this dialog.", ">>", "X");
					case 3: ShowPlayerDialog(playerid, DIALOG_SERVER+7, DIALOG_STYLE_INPUT, " ", "Enter the Master Key to continue...\n\n\t If not close this dialog.", ">>", "X");
					case 4: ShowPlayerDialog(playerid, DIALOG_SERVER+9, DIALOG_STYLE_INPUT, " ", "Enter the Master Key to continue...\n\n\t If not close this dialog.", ">>", "X");
            }
        }

        case DIALOG_SERVER+1:
        {
            if(response)
            {
                assert(IsPlayerAdmin(playerid));
                if(isNumeric(inputtext))
                {
                    if(strval(inputtext) == MASTER_KEY)
                    {
                        ShowPlayerDialog(playerid, DIALOG_SERVER+2, DIALOG_STYLE_INPUT, " ", "Introduzca el nuevo nombre del servidor...", ">>", "X");
                    }
                    else SendClientMessage(playerid, -1, "Contraseсa incorrecta");
                }
                else SendClientMessage(playerid, -1, "Contraseсa incorrecta");
            }
        }
        
        case DIALOG_SERVER+2:
        {
            if(response)
            {
                assert(IsPlayerAdmin(playerid));
				if(strlen(inputtext) < 3) return SendClientMessage(playerid, -1, "Error,It should contain more than 3 letters");
				new str[128];
				format(str, 128, "hostname %s", inputtext);
				SendRconCommand(str);
				SendClientMessageEx(playerid, -1, "New Server Name.... {00CCFF}%s", inputtext);
            }
        }
i get these errors:

Код:
C:\....\example.pwn(18722) : warning 217: loose indentation
C:\....\example.pwn(18722) : error 014: invalid statement; not in switch
C:\....\example.pwn(18722) : warning 215: expression has no effect
C:\....\example.pwn(18722) : error 001: expected token: ";", but found ":"
C:\....\example.pwn(18722) : error 029: invalid expression, assumed zero
C:\....\example.pwn(18722) : fatal error 107: too many error messages on one line

Compilation aborted.
Pawn compiler 3.2.3664
Copyright © 1997-2006, ITB CompuPhase


4 Errors.
can someone please fix them it took me alot of hardwork to translate it and if it isn't fixed it'll ruin all the work please help me
and please ask me if any other info is needed
Reply
#2

Can you show us in which lines are the warnings and errors?
Reply
#3

case DIALOG_SERVER+1:
this one
Reply
#4

redefine the dialog with "DIALOG_SERVER_1" and change it under the "OnDialogResponse". Should work


EDIT :
And you have forgot a bracket
here
pawn Код:
switch(listitem)
{
          case 0: ShowPlayerDialog(playerid, DIALOG_SERVER+1, DIALOG_STYLE_INPUT, " ", "Enter the Master Key to  continue...\n\n\t If not close this dialog.", ">>", "X");
          case 1: ShowPlayerDialog(playerid, DIALOG_SERVER+3, DIALOG_STYLE_INPUT, " ", "Enter the Master Key to continue...\n\n\t If not close this dialog.", ">>", "X");
          case 2: ShowPlayerDialog(playerid, DIALOG_SERVER+5, DIALOG_STYLE_INPUT, " ", "Enter the Master Key to continue...\n\n\t If not close this dialog.", ">>", "X");
          case 3: ShowPlayerDialog(playerid, DIALOG_SERVER+7, DIALOG_STYLE_INPUT, " ", "Enter the Master Key to continue...\n\n\t If not close this dialog.", ">>", "X");
          case 4: ShowPlayerDialog(playerid, DIALOG_SERVER+9, DIALOG_STYLE_INPUT, " ", "Enter the Master Key to continue...\n\n\t If not close this dialog.", ">>", "X");
}
Reply
#5

pawn Код:
case DIALOG_SERVER:
        {
            if(response)
            {
                assert(IsPlayerAdmin(playerid));
                switch(listitem)
                {
                    case 0: ShowPlayerDialog(playerid, DIALOG_SERVER+1, DIALOG_STYLE_INPUT, " ", "Enter the Master Key to continue...\n\n\t If not close this dialog.", ">>", "X");
                    case 1: ShowPlayerDialog(playerid, DIALOG_SERVER+3, DIALOG_STYLE_INPUT, " ", "Enter the Master Key to continue...\n\n\t If not close this dialog.", ">>", "X");
                    case 2: ShowPlayerDialog(playerid, DIALOG_SERVER+5, DIALOG_STYLE_INPUT, " ", "Enter the Master Key to continue...\n\n\t If not close this dialog.", ">>", "X");
                    case 3: ShowPlayerDialog(playerid, DIALOG_SERVER+7, DIALOG_STYLE_INPUT, " ", "Enter the Master Key to continue...\n\n\t If not close this dialog.", ">>", "X");
                    case 4: ShowPlayerDialog(playerid, DIALOG_SERVER+9, DIALOG_STYLE_INPUT, " ", "Enter the Master Key to continue...\n\n\t If not close this dialog.", ">>", "X");
                } // You forgot this bracket ===> "warning 217: loose indentation"
            }
        }
Reply
#6

WOW thanks alot guys btw i have 24 posts can i rep+ you?
Reply
#7

no you need 50 posts to rep.
Reply
#8

okay
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)