I decide to download an admin system, and i have problems with security question.
When you fail to login, and it ask you for the security answer, you can pass even without anything wrote!
pawn Код:
if (dialogid == DIALOG_TYPE_QUESTION+1)
{
if(response == 0)
{
AccInfo[playerid][NoQuestion] = dUserSetINT(PlayerName2(playerid)).("NoQuestion",1);
}
if(response)
{
new file[256],name[MAX_PLAYER_NAME];
if(strlen(inputtext) < 1 || strlen(inputtext) > 40)
{
new rstring[256];
format(file,sizeof(file),"/LuxAdmin/Accounts/%s.sav",udb_encode(name));
GetPlayerName(playerid,name,sizeof(name));
new tmp[256];
dini_Get(file,"Question");
AccInfo[playerid][NoQuestion] = dUserSetINT(PlayerName2(playerid)).("NoQuestion",0);
format(rstring,256,"Your security question answer:\n\n \"%s\"",tmp);
return ShowPlayerDialog(playerid,DIALOG_TYPE_QUESTION+1,DIALOG_STYLE_INPUT,"Security Question - ANSWER",rstring,"Acept","Cancel");
}
//This part its supossed to save the answer in a dini variable, but when i check the user
account theres nothing saved. Just a QuestionR=0. t
new fileans[256],nameans[MAX_PLAYER_NAME];
format(fileans,sizeof(fileans),"/LuxAdmin/Accounts/%s.sav",udb_encode(nameans));
GetPlayerName(playerid,nameans,sizeof(nameans));
dini_Set(file,"QuestionR",inputtext);
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
}
return 1;
}