Strcmp actually returns 0 if the two strings are the same.
!Strcmp will counter it.
pawn Код:
else if(dialogid == DIALOG_LOGIN)
{
if(!response)
{
ShowPlayerDialog(playerid, DIALOG_QUIT, DIALOG_STYLE_MSGBOX, "Cancelled", "Use /q to exit", "OK", "");
Kick(playerid);
}
else if(response)
{
new PlrFile[128], File:PlrFileOpen, pass[128];
format(PlrFile, sizeof(PlrFile), "/Users/%s.txt", RetPlrName(playerid));
PlrFileOpen = fopen(PlrFile, io_read);
fread(PlrFileOpen, pass);
if(!strcmp(inputtext, pass, false, 32))
{
SendClientMessage(playerid, 0xFFFFFFAA, "You have successfully logged-in");
}
else
{
ShowPlayerDialog(playerid, DIALOG_WRONGPASS, DIALOG_STYLE_MSGBOX, "Error", "You have typed wrong password", "OK", "");
}
fclose(PlrFileOpen);
}
}