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
#2

Код:
if(strcmp(!inputtext,dini_Get(file,"Password")) == 0)
Should be:

Код:
if(strcmp(inputtext,dini_Get(file,"Password")))
Reply
#3

Quote:
Originally Posted by Hiddos
Код:
if(strcmp(!inputtext,dini_Get(file,"Password")) == 0)
Should be:

Код:
if(strcmp(inputtext,dini_Get(file,"Password")))
I guess
Код:
if(!strcmp(inputtext,dini_Get(file,"Password")) == 0)
would be less to change
Reply
#4

Quote:
Originally Posted by Sascha
Quote:
Originally Posted by Hiddos
Код:
if(strcmp(!inputtext,dini_Get(file,"Password")) == 0)
Should be:

Код:
if(strcmp(inputtext,dini_Get(file,"Password")))
I guess
Код:
if(!strcmp(inputtext,dini_Get(file,"Password")) == 0)
would be less to change
if(!IsPlayerAdmin(playerid)) << Check is IsPlayerAdmin returns 0;
if(IsPlayerAdmin(playerid) == 0) << Checks if IsPlayerAdmin returns 0;

So ehm, if not if not

if(!IsPlayerAdmin == 0) << If the player isn't an admin doesn't returns 0

D:
Reply
#5

Quote:
Originally Posted by Hiddos
if(!IsPlayerAdmin == 0) << If the player isn't an admin doesn't returns 0
lol? it DOES return 0 if the players isnt an admin...
Reply
#6

thank yo uguys
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)