06.09.2013, 08:37
(
Последний раз редактировалось Tomer!.$; 06.09.2013 в 09:30.
)
EDIT: Important addition in post #3.
The error:
The function(emphasised error line)
CheckPassword:
The error:
PHP код:
error 035: argument type mismatch (argument 1)
PHP код:
case 2: // Login
{
new name[MAX_PLAYER_NAME+1];
GetPlayerName(playerid, name, sizeof(name));
if(CheckPassword(name, inputtext) >= 1) // Error line
{
SendClientMessage(playerid, COLOR_WHITE, "[SUCCESS] You have successfully logged in!");
GetStats(playerid);
}
else
{
SendClientMessage(playerid, COLOR_RED, "[Error] Wrong password!");
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Login", "Wrong password, enter the correct one!", "Submit", "Cancel");
}
}
PHP код:
CheckPassword(name, inputtext)
{
new rows, fields, string[128];
format(string, sizeof(string), "SELECT * FROM users WHERE username = '%s' AND password = '%s'", name, inputtext);
mysql_function_query(dbHandle, string, false, "", "", "");
cache_get_data(rows, fields, dbHandle);
if(rows >= 1) return 1;
else return 0;
}