(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
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;
}
(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
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);
//There should be a check here to see if the password is between 6 and 129 characters
{
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);
}
}
}
//Everything from case DialogLogin until the line before return 1 should be here
}
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;
}
I have no idea how you even managed to come up with this code.
pawn Код:
|
if(strlen(inputtext) < 6 || strlen(inputtext) > 129)
For example
pawn Код:
|
warning 219: local variable "query" shadows a variable at a preceding level (220) : warning 219: local variable "query" shadows a variable at a preceding level (237) : warning 219: local variable "query" shadows a variable at a preceding level (366) : warning 219: local variable "query" shadows a variable at a preceding level (381) : warning 219: local variable "query" shadows a variable at a preceding level (416) : warning 219: local variable "query" shadows a variable at a preceding level (430) : error 002: only a single statement (or expression) can follow each "case" (430) : warning 215: expression has no effect (431) : warning 209: function "OnDialogResponse" should return a value (432) : error 010: invalid function or declaration (434) : error 010: invalid function or declaration (437) : error 021: symbol already defined: "mysql_format" (439) : error 010: invalid function or declaration (441) : error 010: invalid function or declaration (446) : error 010: invalid function or declaration (451) : error 010: invalid function or declaration (460) : error 010: invalid function or declaration (686) : warning 203: symbol is never used: "LoginAttempt" (686) : warning 203: symbol is never used: "query"