C:\Users\yan\Desktop\AVT\gamemodes\AVT.pwn(346) : warning 217: loose indentation
C:\Users\yan\Desktop\AVT\gamemodes\AVT.pwn(350) : error 002: only a single statement (or expression) can follow each "case"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Error.
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;
}
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;
}
Try this
pawn Код:
|
if(dialogid == DIALOGREG)
{
//CODE
}
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;
}