allways same problems
#1

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

Код:
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;
}
Reply


Messages In This Thread
allways same problems - by Lajko1 - 20.06.2010, 18:21
Re: allways same problems - by Hiddos - 20.06.2010, 18:23
Re: allways same problems - by Sascha - 20.06.2010, 18:25
Re: allways same problems - by Hiddos - 20.06.2010, 18:29
Re: allways same problems - by DowNlOaD_ - 20.06.2010, 18:32
Re: allways same problems - by Lajko1 - 20.06.2010, 18:33

Forum Jump:


Users browsing this thread: 1 Guest(s)