27.10.2012, 04:06
(
Последний раз редактировалось Jarnu; 27.10.2012 в 05:34.
Причина: FIXED
)
---Fixed--
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;
}
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;
}
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;
}
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;
}
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;
}