1 error.
#1

Ignore the warning only error.

PHP код:
C:\Users\yan\Desktop\AVT\gamemodes\AVT.pwn(346) : warning 217loose indentation
C
:\Users\yan\Desktop\AVT\gamemodes\AVT.pwn(350) : error 002only a single statement (or expressioncan follow each "case"
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
1 Error

PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
  switch (
dialogid)
  {
    case  
DialogReg:
    {
      if(!
response) return Kick(playerid);
      if(
strlen(inputtext) < 6) return ShowPlayerDialog(playeridDialogRegDIALOG_STYLE_INPUT"Register""{FF0000}Your passwords has to be atleast 6 characters long!\nPlease put your password below""Register""Bye");
      if(
response)
      {
        new 
INI:File INI_Open(UserPath(playerid));
        
INI_SetTag(File"Information");
        
INI_WriteInt(File,"Password",udb_hash(inputtext));
        
INI_WriteInt(File"Cash"0);
        
INI_WriteInt(File"Admin"0);
        
INI_WriteInt(File"Kills"0);
        
INI_WriteInt(File"Deaths"0);
        
INI_WriteInt(File"Score"0);
        
INI_Close(File);
        
        
SetSpawnInfo(playerid001958.331343.1215.36269.15000000);
        
SpawnPlayer(playerid);
        
ShowPlayerDialog(playeridDialogRegSuccessDIALOG_STYLE_INPUT"Successfully registered!""You have successfully registered an account! Please relog to save your stats.""Ok""");
      }
    }
      case 
DialogLog:
      {
        if(!
response) return Kick(playerid);
        if(
response)
        {
              if(
udb_hash(inputtext) == PlayerInfo[playerid][Password])
              {
                    
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra true, .extra playerid);
                    
GivePlayerMoney(playeridPlayerInfo[playerid][Cash]);
                    
SetPlayerScore(playeridPlayerInfo[playerid][Score]);
                    
ShowPlayerDialog(playeridDialogLogSuccessDIALOG_STYLE_INPUT"Success""You have successfully logged in! Enjoy playing""Okay""");
              }
              else
              {
                   
ShowPlayerDialog(playeridDialogLogDIALOG_STYLE_INPUT"Wrong password""{FF0000}You have entered incorrect password""Login""Bye");
              }
         }
         return 
1;

The line doesn't exists..
Reply
#2

Put the strlen condition inside the if(response) condition

How can they have an input without responding?
Reply
#3

Same
Reply
#4

Try this

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch (dialogid)
    {
        case  DialogReg:
        {
            if(!response) return Kick(playerid);
            if(strlen(inputtext) < 6) return ShowPlayerDialog(playerid, DialogReg, DIALOG_STYLE_INPUT, "Register", "{FF0000}Your passwords has to be atleast 6 characters long!\nPlease put your password below", "Register", "Bye");
            if(response)
            {
                new INI:File = INI_Open(UserPath(playerid));
                INI_SetTag(File, "Information");
                INI_WriteInt(File,"Password",udb_hash(inputtext));
                INI_WriteInt(File, "Cash", 0);
                INI_WriteInt(File, "Admin", 0);
                INI_WriteInt(File, "Kills", 0);
                INI_WriteInt(File, "Deaths", 0);
                INI_WriteInt(File, "Score", 0);
                INI_Close(File);

                SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
                SpawnPlayer(playerid);
                ShowPlayerDialog(playerid, DialogRegSuccess, DIALOG_STYLE_INPUT, "Successfully registered!", "You have successfully registered an account! Please relog to save your stats.", "Ok", "");
            }
        }
        case DialogLog:
        {
            if(!response) return Kick(playerid);
            if(response)
            {
                if(udb_hash(inputtext) == PlayerInfo[playerid][Password])
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    GivePlayerMoney(playerid, PlayerInfo[playerid][Cash]);
                    SetPlayerScore(playerid, PlayerInfo[playerid][Score]);
                    ShowPlayerDialog(playerid, DialogLogSuccess, DIALOG_STYLE_INPUT, "Success", "You have successfully logged in! Enjoy playing", "Okay", "");
                }
                else
                {
                    ShowPlayerDialog(playerid, DialogLog, DIALOG_STYLE_INPUT, "Wrong password", "{FF0000}You have entered incorrect password", "Login", "Bye");
                }
            }
        }
    }
    return 1;
}
Reply
#5

You didn't close your switch statement.
Reply
#6

Quote:
Originally Posted by UploaD
Посмотреть сообщение
Try this

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch (dialogid)
    {
        case  DialogReg:
        {
            if(!response) return Kick(playerid);
            if(strlen(inputtext) < 6) return ShowPlayerDialog(playerid, DialogReg, DIALOG_STYLE_INPUT, "Register", "{FF0000}Your passwords has to be atleast 6 characters long!\nPlease put your password below", "Register", "Bye");
            if(response)
            {
                new INI:File = INI_Open(UserPath(playerid));
                INI_SetTag(File, "Information");
                INI_WriteInt(File,"Password",udb_hash(inputtext));
                INI_WriteInt(File, "Cash", 0);
                INI_WriteInt(File, "Admin", 0);
                INI_WriteInt(File, "Kills", 0);
                INI_WriteInt(File, "Deaths", 0);
                INI_WriteInt(File, "Score", 0);
                INI_Close(File);

                SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
                SpawnPlayer(playerid);
                ShowPlayerDialog(playerid, DialogRegSuccess, DIALOG_STYLE_INPUT, "Successfully registered!", "You have successfully registered an account! Please relog to save your stats.", "Ok", "");
            }
        }
        case DialogLog:
        {
            if(!response) return Kick(playerid);
            if(response)
            {
                if(udb_hash(inputtext) == PlayerInfo[playerid][Password])
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    GivePlayerMoney(playerid, PlayerInfo[playerid][Cash]);
                    SetPlayerScore(playerid, PlayerInfo[playerid][Score]);
                    ShowPlayerDialog(playerid, DialogLogSuccess, DIALOG_STYLE_INPUT, "Success", "You have successfully logged in! Enjoy playing", "Okay", "");
                }
                else
                {
                    ShowPlayerDialog(playerid, DialogLog, DIALOG_STYLE_INPUT, "Wrong password", "{FF0000}You have entered incorrect password", "Login", "Bye");
                }
            }
        }
    }
    return 1;
}
ooh finally thanks
Reply
#7

I usually do like this!
pawn Код:
if(dialogid == DIALOGREG)
{
     //CODE
}
Try like this it work for me! .
Reply
#8

Ah guys i got problem, when i login it says wrong pass..
Reply
#9

If you followed the kush's tutorial then you forgot to add the return

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch (dialogid)
    {
        case  DialogReg:
        {
            if(!response) return Kick(playerid);
            if(strlen(inputtext) < 6) return ShowPlayerDialog(playerid, DialogReg, DIALOG_STYLE_INPUT, "Register", "{FF0000}Your passwords has to be atleast 6 characters long!\nPlease put your password below", "Register", "Bye");
            if(response)
            {
                new INI:File = INI_Open(UserPath(playerid));
                INI_SetTag(File, "Information");
                INI_WriteInt(File,"Password",udb_hash(inputtext));
                INI_WriteInt(File, "Cash", 0);
                INI_WriteInt(File, "Admin", 0);
                INI_WriteInt(File, "Kills", 0);
                INI_WriteInt(File, "Deaths", 0);
                INI_WriteInt(File, "Score", 0);
                INI_Close(File);

                SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
                SpawnPlayer(playerid);
                ShowPlayerDialog(playerid, DialogRegSuccess, DIALOG_STYLE_INPUT, "Successfully registered!", "You have successfully registered an account! Please relog to save your stats.", "Ok", "");
            }
        }
        case DialogLog:
        {
            if(!response) return Kick(playerid);
            if(response)
            {
                if(udb_hash(inputtext) == PlayerInfo[playerid][Password])
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    GivePlayerMoney(playerid, PlayerInfo[playerid][Cash]);
                    SetPlayerScore(playerid, PlayerInfo[playerid][Score]);
                    ShowPlayerDialog(playerid, DialogLogSuccess, DIALOG_STYLE_INPUT, "Success", "You have successfully logged in! Enjoy playing", "Okay", "");
                }
                else
                {
                    ShowPlayerDialog(playerid, DialogLog, DIALOG_STYLE_INPUT, "Wrong password", "{FF0000}You have entered incorrect password", "Login", "Bye");
                }
                return 1;
            }
        }
    }
    return 1;
}
Reply
#10

Same, and i found another prob. if i reg but i hit "quit" and i log in again it says login.. but i pressed quit
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)