20.06.2010, 18:21
again those dialogs
PROBLEM:when i register an account and i relog and enter the NOT CORRECT password it still login me wtf
here is the code
PROBLEM:when i register an account and i relog and enter the NOT CORRECT password it still login me wtf
here is the code
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { new name[MAX_PLAYERS]; new file[128]; new str[256]; GetPlayerName(playerid,name,sizeof name); format(file,sizeof(file),"/Accounts/%s.ini",name); if(response) { if(dialogid == 1) // Login Dialog { if(!strlen(inputtext)) { format(str, sizeof(str), "Welcome back %s!Please type in your password!\nEnjoy", name); ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Login",str,"Login","Cancel"); return SendClientMessage(playerid,0xAA3333AA,"[System]:Please enter the password!"); } if(strcmp(inputtext,dini_Get(file,"Password")) == 0) { AccInfo[playerid][AdminLevel] = dini_Int(file,"AdminLevel"); PlayerInfo[playerid][Kills] = dini_Int(file,"Kills"); PlayerInfo[playerid][Deaths] = dini_Int(file,"Deaths"); GivePlayerMoney(playerid,dini_Int(file,"Money")); SetPlayerScore(playerid,dini_Int(file,"Score")); AccInfo[playerid][LoggedIn] = 1; //player is logged in now SendClientMessage(playerid,0x33AA33AA,"[System]:You have been sucessfully logged in."); } if(strcmp(!inputtext,dini_Get(file,"Password")) == 0) { format(str, sizeof(str), "Welcome back %s!Please type in your password!\nEnjoy", name); ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Login",str,"Login","Cancel"); SendClientMessage(playerid,0xAA3333AA,"[System]:You typed wrong password,please enter the correct password!"); } } if(dialogid == 2) { if(!strlen(inputtext)) { format(str, sizeof(str), "Hello %s!\nYou are not registered on this server.\nso please enter the password in the box\nto register a new account!", name); ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Rp Registration",str,"Register","Cancel"); return SendClientMessage(playerid,0xAA3333AA,"[System]:This password is to short!"); } dini_Create(file); dini_Set(file,"Password",inputtext); AccInfo[playerid][AdminLevel] = 0 ; AccInfo[playerid][LoggedIn] = 1; SendClientMessage(playerid,0x33AA33AA,"[System]:You sussessfuly registered your account!"); } } return 1; }