Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

Strange password bug.

$
0
0
Hello all,

I have a small problem with saving passwords since a few days(it used to work fine this way)

It does not save the password from the user when registering, it saves it as 0..
This is quite strange because i have a /changepass command which works fine.
I checked my onplayerconnect en some other functions i can't find anything which sets it to 0. What could be the problem?

using udb_hash

Code:

//this saves the pass on register but does not work.
if(dialogid==REGISTER)
        {
                new string[128];
                  new Year,Month,Day;
                  getdate(Year,Month,Day);
                if(!response) return Kick(playerid);
                format(string,128,"{FFFFFF}Welcome {A9C4E4}%s{FFFFFF},enter your password below to register account",PlayerName(playerid));
                if(strlen(inputtext)<6)return
                SendClientMessage(playerid,LRED,"The password needs to contain atleast 6 characters/letters")&&
                ShowPlayerDialog(playerid,REGISTER,DIALOG_STYLE_INPUT,"Registration",string,"Register","");
                  SetPlayerPos(playerid,3603.6953,-1503.7928,9.6853);
                  SetPlayerPos(playerid,3603.6953,-1503.7928,9.6853);
                IsLogged[playerid]=1;
        registered[playerid]=1;
            INI_Create(Acc(playerid));
                Password[playerid]=udb_hash(inputtext);
                SpawnPlayer(playerid);
        PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
                format(string,128,"%d/%d/%d",Day,Month,Year);
                INI_Set(Acc(playerid),"Registered",string);
                format(string,128,"You succesfully registered the account {FFFF00}'%s' {FFFFFF}with the password {FFFF00}'%s'",PlayerName(playerid),inputtext);
                SendClientMessage(playerid,-1,string);
                StartBeginner(playerid);
                return 1;
        }


//this is the /changepass part which works just fine.
CMD:changepass(playerid,params[])
{
        new  string[128];
          if(!IsPlayerConnectedEx(playerid)) return 0;
        if(sscanf(params,"s[25]",params)) return SendClientMessage(playerid,GREY,"USAGE: /changepass [password]");
        if(strlen(params) > 25) return SendClientMessage(playerid,GREY,"Password can't be longer than 25 characters");
        Password[playerid]=udb_hash(params);
        PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
        format(string,sizeof(string),"You have changed your password to '%s'",params);
        SendClientMessage(playerid,YELLOW,string);
        return 1;
}


Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>