15.05.2014, 18:34
It would not login if I enter the right or wrong password (Showing dialog incorrect password).
I'm also doing a debug. It's look like it's not loading user's data when a user is connected. Here u can see
First we're on OnPlayerConnect
Then it's going here
Next, it load this
I'm also doing a debug. It's look like it's not loading user's data when a user is connected. Here u can see
First we're on OnPlayerConnect
pawn Код:
public OnPlayerConnect(playerid)
{
if(fexist(UserPath(playerid)))
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"Type your password below to login.","Login","Quit");
printf("Password check : %d",PlayerInfo[playerid][Password]); //This is my debug code. This should displaying password, right?
}
else
{
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registering...",""COL_WHITE"Type your password below to register a new account.","Register","Quit");
}
return 1;
}
pawn Код:
case DIALOG_LOGIN: //for loging
{
if ( !response ) return Kick ( playerid );
if( response )
{
if(udb_hash(inputtext) == PlayerInfo[playerid][Password])
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
SetSpawnInfo(playerid,-1,1,2000.6132,1560.1454,15.3672,0.7534,0,0,0,0,0,0);
SpawnPlayer(playerid);
SetPlayerMoneyEx(playerid, PlayerInfo[playerid][Money]);
SetPlayerScoreEx(playerid, PlayerInfo[playerid][Score]);
ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"You have successfully logged in!","Ok","");
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"You have entered an incorrect password.\n"COL_WHITE"Type your password below to login.","Login","Quit");
return 1;
}
}
}
pawn Код:
public LoadUser_data(playerid,name[],value[])
{
INI_Int("Password",PlayerInfo[playerid][Password]);
INI_Int("Score",PlayerInfo[playerid][Score]);
INI_Int("Money",PlayerInfo[playerid][Money]);
INI_Int("Skin",PlayerInfo[playerid][Skin]);
INI_Int("Money",PlayerInfo[playerid][Money]);
INI_Int("Language",PlayerInfo[playerid][Language]);
INI_Int("Admin",PlayerInfo[playerid][Admin]);
INI_Int("DMKills",PlayerInfo[playerid][DMKills]);
INI_Int("DMDeaths",PlayerInfo[playerid][DMDeaths]);
INI_Int("OWin",PlayerInfo[playerid][OWin]);
INI_Int("OLoose",PlayerInfo[playerid][OLoose]);
INI_Int("RWin",PlayerInfo[playerid][RWin]);
INI_Int("RLoose",PlayerInfo[playerid][RLoose]);
INI_Int("VIP",PlayerInfo[playerid][VIP]);
INI_Int("TimeOnline",PlayerInfo[playerid][TimeOnline]);
INI_Int("Warns",PlayerInfo[playerid][Warns]);
INI_Int("Banned",PlayerInfo[playerid][Banned]);
INI_Int("IP",PlayerInfo[playerid][IP]);
return 1;
}