[HELP]How can I check a password
#1

Hello.I have an simple admin FS(created by me) using YSI:INI,but I have an problem.When I type an randomly password (another than I save) the server allow player to login in without any restriction,EVEN IT'S ANOTHER PASSWORD!Now,my question it's:How can I check password?If it's possible,can you make an tutorial?Thanks

P.S:Probaly my english it's bad.That's because I am Romanian!!Hai Romania!!!
Reply
#2

How about posting the command/dialog?
Reply
#3

Quote:
Originally Posted by DiGiTaL_AnGeL
Посмотреть сообщение
How about posting the command/dialog?
If you say that...
Код:
if(dialogid == 1)
	{
	if(!response)
	{
	SendClientMessage(playerid,0xFF0000FF,"Nu te-ai logat!Vei primi KICK!!!");
	Kick(playerid);
	}
	else
	{
	INI_Open(file);
	new password;
	new password2[128];
	password = inputtext[23];
	INI_ReadString("Parola",password2);
	if() != 0)
	{
	SendClientMessage(playerid,0xFF0000FF,"Parola introdusa este gresita!");
	INI_Close();
	}
	PInfo[playerid][level] = INI_ReadInt("Level");
	PInfo[playerid][cash] =  INI_ReadInt("Cash");
	PInfo[playerid][coins] = INI_ReadInt("Coins");
    PInfo[playerid][score] = INI_ReadInt("Score");
	}
	}
	return 1;
}
Reply
#4

You defined two variables: password, password2;
You choose that password will be the inputtext, but instead you compare the password2 variable.
->
pawn Код:
INI_ReadString("Parola",password);
Reply
#5

Quote:
Originally Posted by zxc1
Посмотреть сообщение
You defined two variables: password, password2;
You choose that password will be the inputtext, but instead you compare the password2 variable.
->
pawn Код:
INI_ReadString("Parola",password);
So,can you put the entire script modyfied by YOUTHX
Reply
#6

pawn Код:
if() != 0)//huh?
Use strcmp to compare the inputtext with the password:
pawn Код:
if(!strcmp(password2, inputtext))
But before, try it on a host if you're testing it on your pc now.

EDIT : you're using any plugin/function to encrypt the password?
Reply
#7

Quote:
Originally Posted by DiGiTaL_AnGeL
Посмотреть сообщение
pawn Код:
if() != 0)//huh?
Use strcmp to compare the inputtext with the password:
pawn Код:
if(!strcmp(password2, inputtext))
But before, try it on a host if you're testing it on your pc now.

EDIT : you're using any plugin/function to encrypt the password?
1.
pawn Код:
if() != 0)//huh?
About that...I used strcmp(string compare) but I don't remove entire "If" and it remain <<<<THAT
2.I doesn't using any encription,to see user's passwords)
3.I used again corectly strcmp,and IT'S WORK!!!(yet just in script but I'll try in server!!).I'll come with an EDIT SOON!!!THX
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)