14.05.2012, 08:27
After checking if the dialog box is empty (if(!strlen(inputtext)) checks if box is empty), you still continue with the script. You will have to put a return when the dialog box is empty so the rest of the code doesn't get processed.
pawn Код:
if(dialogid == 1)
{
if(!strlen(inputtext)) {
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");
return 1;
}
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);
}