28.08.2014, 15:56
Hello,
I've have tried so much to fix this, but it seems impossible
I've have tried so much to fix this, but it seems impossible
Код:
(425) : warning 225: unreachable code (425) : error 029: invalid expression, assumed zero (432) : error 014: invalid statement; not in switch (432) : warning 215: expression has no effect (432) : error 001: expected token: ";", but found ":" (432) : error 029: invalid expression, assumed zero (432) : fatal error 107: too many error messages on one line
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case DialogRegister:
{
if(!response) return Kick(playerid);
{
new EncryptedPass[130], query[256];
WP_Hash(EncryptedPass, sizeof(EncryptedPass), inputtext);
{
new string[128];
SendClientMessage(playerid, COLOR_RED, "[ERROR]: Your password must be 6 to 129 characters long!");
format(string, sizeof(string), "This server requires you to register an account before playing\n\nUsername: %s\n\nEnter your desired password below then click ok.",PlayerName(playerid));
ShowPlayerDialog(playerid,DialogRegister,DIALOG_STYLE_INPUT,"{EDDC57}Registration required",string,"Register","Cancel");
return 1;
}else { // 425
mysql_format(MySQLCon, query, sizeof(query), "INSERT INTO `players` (`user`, `pass`, `IP`) VALUES ('%e', '%s', '%s')", PlayerName(playerid), EncryptedPass, PlayerIP(playerid));
mysql_tquery(MySQLCon, query, "OnPlayerRegister", "i", playerid);
}
}
}
}
case DialogLogin: // line 432
{
if(!response) return Kick(playerid);
{
new Lquery[256];
mysql_format(MySQLCon, Lquery, sizeof(query), "SELECT * FROM `players` WHERE `user` = '%e' LIMIT 1", PlayerName(playerid));
mysql_tquery(MySQLCon, Lquery, "OnPlayerLogin", "i", playerid);
} else {
LoginAttempt[playerid]++; new string[128];
if(LoginAttempt[playerid] == 1)
{
format(string, sizeof(string), "Before playing you must login\n\nUsername: %s\n\nEnter your password below and click login",PlayerName(playerid));
ShowPlayerDialog(playerid,DialogLogin,DIALOG_STYLE_PASSWORD,"{EDDC57}Login required",string,"Login","Cancel");
SendClientMessage(playerid, -1,"{B30000}[ERROR]: {FFFFFF}You have entered an incorrect password. [1/3]");
} else if(LoginAttempt[playerid] == 2)
{
format(string, sizeof(string), "Before playing you must login\n\nUsername: %s\n\nEnter your password below and click login",PlayerName(playerid));
ShowPlayerDialog(playerid,DialogLogin,DIALOG_STYLE_PASSWORD,"{EDDC57}Login required",string,"Login","Cancel");
SendClientMessage(playerid, -1,"{B30000}[ERROR] {FFFFFF}You have entered an incorrect password. [2/3]");
} else if(LoginAttempt[playerid] == 3)
{
SendClientMessage(playerid, -1,"{B30000}[ERROR] {FFFFFF}You have entered an incorrect password. [3/3]");
format(string,sizeof(string),"{208DD6}[SERVER] {FFFFFF}%s[%d] has been kicked from the server. (Max password attempts)",PlayerName(playerid),playerid);
SendClientMessageToAll(COLOR_WHITE,string);
Kick(playerid);
}
}
}
return 1;
}