20.04.2012, 22:18
Alright, so I have created a login script, but it does not appear to work, it saves the password, hashes it, but I think something may be wrong with my if statement that tells if the inputtext equals what is saved. But I cannot find the issue.
pawn Код:
case DIALOG_LOGIN:
{
if(!response) return pInfo[playerid][ForcedChange] = 1 && ShowPlayerDialog(playerid, DIALOG_NAMECHANGE, DIALOG_STYLE_INPUT, "Namechange...","Please select your new desired name","Select","Cancel");
if( response )
{
if(udb_hash(inputtext) == pInfo[playerid][pPass])
{
pInfo[playerid][pLogged] = 1;
SendClientMessage(playerid, -1, "You have been logged in!");
SpawnPlayer(playerid);
TogglePlayerControllable(playerid, 1);
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login...", "Please Login, if this is not your account his 'Change'", "Enter","Change");
SendClientMessage(playerid, 0x5F5F5FFF, "ERROR: You have entered an invalid password!");
}
}