20.09.2017, 14:50
Hi, why -> if(strcmp(password, inputtext)) .... is not working ? Player give false password and is connecting?
PHP код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 2)
{
if(response == 1)
{
mysql_format(SqlGM, samp, sizeof(samp), "SELECT `password` FROM `players` WHERE `nick` LIKE BINARY `%s`", GetPlayerNick(playerid));
mysql_query(SqlGM, samp, true);
cache_get_field_content(0, "password", password);
if(strcmp(password, inputtext))
{
format(samp, sizeof(samp), ""RED"Wrong password!");
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_PASSWORD, ""ORANGE"Loging", samp, ""GREEN"next", ""RED"back");
return 1;
}
else
{
format(string,sizeof(string),""RED"[LOGING]: "WHITE" your password is correct!, account "GREEN" is connecting.");
SendClientMessage(playerid, -1, string);
TogglePlayerSpectating(playerid, 0);
SpawnPlayer(playerid);
}
}
}
...