[Fixed] - Jarnu - 27.10.2012
---Fixed--
Re: Problem with Y_INI Login/Register -
JaKe Elite - 27.10.2012
show me your LoadUser_data public function and the OnPlayerConnect.
Re: Problem with Y_INI Login/Register - Jarnu - 27.10.2012
Register Login stock
pawn Код:
stock RLPlayer(playerid)
{
new pName [ MAX_PLAYER_NAME ] ;
GetPlayerName ( playerid , pName , MAX_PLAYER_NAME ) ;
if(fexist(UserAccount(playerid)))
{
INI_ParseFile(UserAccount(playerid),"LoadUser_%s", .bExtra = true, .extra = playerid);
ShowPlayerDialog(playerid, L_DIALOG, DIALOG_STYLE_PASSWORD,""cgreen"Login",""corange"Your account is already registered\n"cgreen"Please type your password to login","Login","");
}
else
{
ShowPlayerDialog(playerid, R_DIALOG, DIALOG_STYLE_PASSWORD,""cgreen"Register",""corange"Your account is "cred"not "corange"registered\n"cgreen"Please type your password to register","Register","");
}
return 1;
}
LoadUser_data
pawn Код:
public LoadUser_data(playerid, name[], value[])
{
INI_String("Password", PlayerInfo[playerid][pPass], 129);
INI_Int("Scores", PlayerInfo[playerid][pScores]);
INI_Int("Money", PlayerInfo[playerid][pMoney]);
INI_Int("AdminLevel", PlayerInfo[playerid][pAdmin]);
INI_Int("Kills", PlayerInfo[playerid][pKills]);
INI_Int("Deaths", PlayerInfo[playerid][pDeaths]);
INI_Int("Helper", PlayerInfo[playerid][pHelper]);
INI_Int("Banned", PlayerInfo[playerid][pBanned]);
return 1;
}
Re: Problem with Y_INI Login/Register - Emmet_ - 27.10.2012
Try this maybe?
pawn Код:
if(dialogid == L_DIALOG)
{
if(!response) return Kick(playerid);
else if(response)
{
new HashPass[129];
WP_Hash(HashPass, sizeof(HashPass), inputtext);
INI_ParseFile(UserAccount(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
if(!strcmp(PlayerInfo [ playerid ] [ pPass ] , HashPass , true ))
{
INI_ParseFile(UserAccount(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
GivePlayerMoney(playerid, PlayerInfo[playerid][pMoney]);
SetPlayerScore(playerid, PlayerInfo[playerid][pScores]);
}
else
{
ShowPlayerDialog(playerid, L_DIALOG, DIALOG_STYLE_PASSWORD,""cwhite"Login",""cred"You have entered an incorrect password.\n"cwhite"Type your password below to login.","Login","");
}
}
}
return 1;
}
You are comparing pPass to the player's inputtext. Did you format the pPass variable with the player's password?
Re: Problem with Y_INI Login/Register -
Lordzy - 27.10.2012
Why Loaduser_%s? There's the mistake!
Use LoadUser_data and try.
Re: Problem with Y_INI Login/Register - Jarnu - 27.10.2012
Yes. and no it didn't worked.
EDIT: Lordz not working.
Re: Problem with Y_INI Login/Register -
Lordzy - 27.10.2012
Try this
pawn Код:
if(dialogid == L_DIALOG)
{
if(!response) return Kick(playerid);
else if(response)
{
new HashPass[129];
WP_Hash(HashPass, sizeof(HashPass), inputtext);
INI_ParseFile(UserAccount(playerid), "LoadUser_data", .bExtra = true, .extra = playerid);
if(strcmp(PlayerInfo [ playerid ] [ pPass ] , HashPass , true ))
{
INI_ParseFile(UserAccount(playerid), "LoadUser_data", .bExtra = true, .extra = playerid);
GivePlayerMoney(playerid, PlayerInfo[playerid][pMoney]);
SetPlayerScore(playerid, PlayerInfo[playerid][pScores]);
}
else
{
ShowPlayerDialog(playerid, L_DIALOG, DIALOG_STYLE_PASSWORD,""cwhite"Login",""cred"You have entered an incorrect password.\n"cwhite"Type your password below to login.","Login","");
}
}
}
return 1;
}
Or this:
pawn Код:
if(dialogid == L_DIALOG)
{
if(!response) return Kick(playerid);
else if(response)
{
new HashPass[129];
WP_Hash(HashPass, sizeof(HashPass), inputtext);
INI_ParseFile(UserAccount(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
if(strcmp(PlayerInfo [ playerid ] [ pPass ] , HashPass , true ))
{
INI_ParseFile(UserAccount(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
GivePlayerMoney(playerid, PlayerInfo[playerid][pMoney]);
SetPlayerScore(playerid, PlayerInfo[playerid][pScores]);
}
else
{
ShowPlayerDialog(playerid, L_DIALOG, DIALOG_STYLE_PASSWORD,""cwhite"Login",""cred"You have entered an incorrect password.\n"cwhite"Type your password below to login.","Login","");
}
}
}
return 1;
}
Re: Problem with Y_INI Login/Register - Jarnu - 27.10.2012
still not working. i don't know whats wrong ;-/ need ****** here.
Re: Problem with Y_INI Login/Register -
[HK]Ryder[AN] - 27.10.2012
In LoadUser_data
You need to SetTag first otherwise it will try loading data that is NOT in a tag and you haven't got anything there.
Read the Y_INI topic to know what i am talkign about..see the SetTag - Reading functions.