Need help with OnDialogResponse -
Audiophr3ak - 05.03.2011
Player can log in and spawn without typing password in, whats the mistake:
if(dialogid == LOG)
{
if(response == 1)
{
new pass[256];
pass = dini_Get(file, "Password");
if(strcmp(inputtext, pass, true) == 0)
{
LoadPlayerData(playerid);
TogglePlayerSpectating(playerid,0);
SetPlayerColor(playerid,0xFFFFFFAA);
PlayerPlaySound(playerid,1186,0,0,0);
format(msg, sizeof(msg), "~w~welcome back~n~~p~%s", pname); GameTextForPlayer(playerid,msg,2000,0);
}
else
{
SendClientMessage(playerid, 0xFFFFFFAA, "{FFFF80}Wrong password.");
format(msg, sizeof(msg), "{80FFE8}Welcome back {80A2FF}%s{80FFE8}!\nInsert your password into the line below\nto log in to your account.", pname);
ShowPlayerDialog(playerid, LOG, DIALOG_STYLE_INPUT, " {8C80FF}Account Panel.", msg, "Login", "Cancel");
}
}
else
{
Kick(playerid);
}
}
Re: Need help with OnDialogResponse - rjjj - 05.03.2011
Maybe it is happening because the lack of
return 1;
I did it for you
:
pawn Код:
if(dialogid == LOG)
{
if(response == 1)
{
new pass[256];
format(pass,sizeof(pass),dini_Get(file, "Password"));
if(strcmp(inputtext, pass, true) == 0 && strlen(inputtext) > 0)
{
LoadPlayerData(playerid);
TogglePlayerSpectating(playerid,0);
SetPlayerColor(playerid,0xFFFFFFAA);
PlayerPlaySound(playerid,1186,0,0,0);
format(msg, sizeof(msg), "~w~welcome back~n~~p~%s", pname); GameTextForPlayer(playerid,msg,2000,0);
}
else
{
SendClientMessage(playerid, 0xFFFFFFAA, "{FFFF80}Wrong password.");
format(msg, sizeof(msg), "{80FFE8}Welcome back {80A2FF}%s{80FFE8}!\nInsert your password into the line below\nto log in to your account.", pname);
ShowPlayerDialog(playerid, LOG, DIALOG_STYLE_INPUT, " {8C80FF}Account Panel.", msg, "Login", "Cancel");
}
}
else
{
Kick(playerid);
}
return 1;
}
I hope that i have helped
Re: Need help with OnDialogResponse -
Audiophr3ak - 05.03.2011
Oh crap that was so stupid and easy, thanks a lot! :P