SA-MP Forums Archive
Ondialogresponse - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Ondialogresponse (/showthread.php?tid=432997)



Ondialogresponse - NicholasA - 25.04.2013

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.




Re: Ondialogresponse - [HK]Ryder[AN] - 25.04.2013

show us the code?


Re: Ondialogresponse - Ciandlah - 25.04.2013

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


Re: Ondialogresponse - NicholasA - 25.04.2013

Click the text ;d
line 1647 is the case 2;


Re: Ondialogresponse - Ciandlah - 25.04.2013

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


Re: Ondialogresponse - NicholasA - 25.04.2013

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;


Re: Ondialogresponse - Ciandlah - 25.04.2013

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

Код:
Pastebin
http://pastebin.com/EphsJKZH



Re: Ondialogresponse - Frede - 25.04.2013

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


Re: Ondialogresponse - NicholasA - 25.04.2013

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


Re: Ondialogresponse - Ciandlah - 25.04.2013

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