14.12.2012, 21:52
Hello, i just finished my registration system with the help of some members around here, but got a problem.
Everything works except for the login, it says everytime "Wrong password" even if i put the CORRECT password:
Everything works except for the login, it says everytime "Wrong password" even if i put the CORRECT password:
pawn Код:
CMD:login(playerid, params[])
{
new filestring[128];
new name[24];
GetPlayerName(playerid, name, 24);
format(filestring, sizeof(filestring), "/Users/%s.ini", name);
if(!fexist(filestring)) return SCM(playerid, COLOR_YELLOW, "You are not registered. Please /register.");
new lpass[64];
if(PlayerInfo[playerid][pLogged] == 1) return SCM(playerid, COLOR_YELLOW, "You are already logged in.");
if(sscanf(params, "s[64]", lpass)) return SCM(playerid, -1, "{F70505}Usage: {FFFFFF}/login [password]");
if(udb_hash(lpass) == PlayerInfo[playerid][pPass])
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
SetPlayerCash(playerid, PlayerInfo[playerid][pCash]);
SetPlayerScore(playerid, PlayerInfo[playerid][pKills]);
SetPlayerWantedLevel(playerid, PlayerInfo[playerid][pRank]);
PlayerInfo[playerid][pLogged] += 1;
SCM(playerid,0x0080C0FF,"System: Account data loaded! Welcome back!");
}
else
{
SCM(playerid,0x0080C0FF,"System: Wrong password!");
}
return 1;
}