Ondialogresponse
#1

Anyone know whats wrong with the code?
Quote:

C:\Users\x3990.003\Desktop\samp server\gamemodes\PZ.pwn(1647) : error 014: invalid statement; not in switch
C:\Users\x3990.003\Desktop\samp server\gamemodes\PZ.pwn(1647) : warning 215: expression has no effect
C:\Users\x3990.003\Desktop\samp server\gamemodes\PZ.pwn(1647) : error 001: expected token: ";", but found ":"
C:\Users\x3990.003\Desktop\samp server\gamemodes\PZ.pwn(1647) : error 029: invalid expression, assumed zero
C:\Users\x3990.003\Desktop\samp server\gamemodes\PZ.pwn(1647) : fatal error 107: too many error messages on one line

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


4 Errors.

Reply
#2

show us the code?
Reply
#3

Give us line 1647 Please, Not just your code. we need the line the error is in
Reply
#4

Click the text ;d
line 1647 is the case 2;
Reply
#5

We need the line genius, Its stating the you have placed a : instead of a ; but we cannot see that error. Please give us line 1647
Reply
#6

Quote:
Originally Posted by Ciandlah
Посмотреть сообщение
We need the line genius, Its stating the you have placed a : instead of a ; but we cannot see that error. Please give us line 1647
line 1647 is the case 2;
Reply
#7

You had to many indents in the code, try using Notepad++ next time to fix those

Код:
Pastebin
http://pastebin.com/EphsJKZH
Reply
#8

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    new string[124];
    switch(dialogid)
    {
        case 1:
        {
            if(!response) return Kick(playerid);

            if(strlen(inputtext) < 6 || strlen(inputtext) > 32)
            {
                SendClientMessage(playerid, COL_GREY, "Please enter a password that is greater than 6 characters or less than 32 characters.");
                ShowPlayerDialog(playerid, 1, DIALOG_STYLE_PASSWORD,
                 "Welcome to "ServerName"",
                 "Enter your desired password below to sucessfully register.",
                 "Continue", "Cancel"
                );
                return 1;
            }
            else
            {
                RegisterPlayer(playerid, inputtext);
                PlayerVar[playerid][Authenticated] = 1;
                format(PlayerVar[playerid][Name], MAX_PLAYER_NAME, GetPlayersNameWithUnderScore(playerid));
                format(PlayerVar[playerid][Password], 32, "%s", inputtext);
                format(PlayerVar[playerid][Accent], 32, "American");
                GetPlayerIp(playerid, PlayerVar[playerid][IP], 32);
            }
        }
        case 2:
        {
            if(!response) return Kick(playerid);
            format(string, sizeof(string), "PlayerAccounts/%s.ini", GetPlayersNameWithUnderScore(playerid));
            if(fexist(string))
            {
                if(!strcmp(PlayerVar[playerid][Password], inputtext , false))
                {
                    INI_ParseFile(string, "LoadPlayer_%s", .bExtra = true, .extra = playerid);
                    PlayerVar[playerid][Authenticated] = 1;
                    LoginPlayer(playerid);
                }
                else
                {
                    SendClientMessage(playerid, COL_GREY, "The password you entered does not match, please reconnect for another try.");
                    Kick(playerid);
                }
            }
        }
    }
    return 1;
}
your switch statemen wasnt right
Reply
#9

Quote:
Originally Posted by Ciandlah
Посмотреть сообщение
You had to many indents in the code, try using Notepad++ next time to fix those

Код:
Pastebin
http://pastebin.com/EphsJKZH
Thanks
Reply
#10

Quote:
Originally Posted by NicholasA
Посмотреть сообщение
Thanks
Anytime bud
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)