14.05.2012, 08:11
Hello, i have a problem with the login dialog
Everything is fine, if a player types wrong password it tells that he did it, if he types the right password then he loggs in
but one problem is there, if player types nothing in the dialog, it automatically loggs him in by reading from the user file
How can i fix it?
Everything is fine, if a player types wrong password it tells that he did it, if he types the right password then he loggs in
but one problem is there, if player types nothing in the dialog, it automatically loggs him in by reading from the user file
pawn Код:
if(dialogid == 1)
{
if(strlen(inputtext) == 0) {
SendClientMessage(playerid, COLOR_WHITE, "");
new string[185];
format(string, sizeof(string),"{FFFFFF}Inkorrekte Password Eingabe {FFD700}%s{FFFFFF},\n\nBitte gebe dein Passwort ein um dich zu authentifizieren.",GetName(playerid));
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT,"Authentifizierung",string, "Login", "Abbrechen");
}
new file[128],string[128];
format(file,sizeof(file),"/racuni/%s.txt",GetName(playerid));
if(fexist(file))
{
new password[130];
INI_ParseFile(file, "PlayerPassword", false, true, playerid, true, false );
GetPVarString(playerid, "pPass", password, sizeof password);
if(!strcmp(inputtext, password, true))
{
IsLogged[playerid] = 1;
ClearChat(playerid);
SendClientMessage(playerid, COLOR_GREEN, "||-Erfolg-|| Du hast dich erfolgreich eingeloggt!");
SendClientMessage(playerid, COLOR_GREEN, "");
format(string, sizeof(string), "[SERVER] %s hat sich erfolgreich eingeloggt!", GetName(playerid) );
printf(string);
LoadSpieler(playerid);
}