17.03.2012, 14:38
I've started to create a RP gamemode and need some help with my register/login script. I managed to get it working without any pawno errors but when I load the game up, it tells me that I have the wrong password. (Even if the password is correct.)
Here is the login command:
and here is the 667 dialog box:
It's most likely a simple mixup error..
Here is the login command:
pawn Код:
CMD:login(playerid, params[])
{
if(fexist(UserPath(playerid)))
{
if(gPlayerLogged[playerid] == 0){
ShowPlayerDialog(playerid, 667, DIALOG_STYLE_INPUT, "Login", "Type your password here.", "Submit", "Cancel");
}
else
{
SCM(playerid, COLOR_RED, "You are already logged in.");
}
return 1;}
else
{
SCM(playerid, COLOR_RED, "Account not found. Please use /register.");
}
return 1;
}
pawn Код:
if(dialogid == 667)
{
if(response)
{
if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
gPlayerLogged[playerid] = 1;
GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
SCM(playerid, COLOR_RED, "You have logged in. You may now spawn.");
}
else
{
gPlayer[playerid] += 1;
if(gPlayer[playerid] == 1)
{
SCM(playerid, COLOR_RED, "Wrong Password. 1/3");
}
if(gPlayer[playerid] == 2)
{
SCM(playerid, COLOR_RED, "Wrong Password. 2/3");
}
if(gPlayer[playerid] == 3)
{
SCM(playerid, COLOR_RED, "Wrong Password. 3/3. You have been kicked.");
Kick(playerid);
}
}
}
}
return 1;
}