Help my register cmd dont work normally -
TheDeath - 10.07.2012
Hello.
I have problem with my register command:
When i reggister there is all but no password
Код:
[data]
Cash = 0
Score = 0
Lang = 0
Admin = 0
VIP = 0
So here is my code:
Код:
case DIALOG_REGISTER:
{
if (!response) return Kick(playerid);
if(response)
{
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Registering...","You have entered an invalid password.\nType your password below to register a new account.","Register","Quit");
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Password",udb_hash(inputtext));
INI_WriteInt(File,"Cash",0);
INI_WriteInt(File,"Score",0);
INI_WriteInt(File,"Lang",0);
INI_WriteInt(File,"Admin",0);
INI_WriteInt(File,"VIP",0);
INI_Close(File);
}
}
I have followed this tutorial -
https://sampforum.blast.hk/showthread.php?tid=273088
Re: Help my register cmd dont work normally -
Roko_foko - 10.07.2012
Why even bother with INT if you can INI_WriteString() and INI_ReadString()? I suggest you to change
INI_WriteInt(File,"Password",udb_hash(inputtext));
with
INI_WriteString(File,"Password",inputtext);
Re: Help my register cmd dont work normally -
RedJohn - 10.07.2012
Try with
this tutorial!
Re: Help my register cmd dont work normally -
TheDeath - 10.07.2012
Quote:
Originally Posted by ******
Could you try change the order so password comes after something else and see what happens? Also, don't use udb_hash - it's as good as no hash!
|
Then what is better to use?
--------------------------------------------
Quote:
Originally Posted by Roko_foko
Why even bother with INT if you can INI_WriteString() and INI_ReadString()? I suggest you to change
INI_WriteInt(File,"Password",udb_hash(inputtext));
with
INI_WriteString(File,"Password",inputtext);
|
ok tryed it but when its not hashed i must change it in the login dialog but when i change it there it gives me error
Код:
case DIALOG_LOGIN:
{
if ( !response ) return Kick ( playerid );
if( response )
{
if(inputtext == PlayerInfo[playerid][pPass])
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Login","You have entered an incorrect password.\nType your password below to login.","Login","Quit");
}
return 1;
}
}
Gives me this error
Код:
...... : error 033: array must be indexed (variable "inputtext")
--------------------------------------------
Quote:
Originally Posted by RedJohn
|
i think this is better its simple i dont need so advanced login system... im with drift server
Re: Help my register cmd dont work normally -
Roko_foko - 10.07.2012
EDIT: Now when I saw ****** post, Better use udb_hash. Firstly I didn't know what it does.
Re: Help my register cmd dont work normally -
TheDeath - 10.07.2012
****** then can u help me fixing it...I think u will help me by the best way because the Y_INI is your..
So i want to hash it but if there are need ill not gonna hash it..I just wanna understand why it wont store the password ?
It doesn't even store it with WriteString();
Re: Help my register cmd dont work normally -
TheDeath - 10.07.2012
Called my brother (he is a programmer not on pawn

)
and he fixed my code
