Getting error when checking pass
#2

pawn Код:
dcmd_login(playerid,params[])
{
    new pass,rpass[256],name[MAX_PLAYER_NAME],file[23],string[76];
    if(logged[playerid] == 1) return SendClientMessage(playerid,COLOUR_RED,"You are already logged in!");
    GetPlayerName(playerid,name,sizeof(name));
    format(file,sizeof(file),"%s.ini",name);
    if(!fexist(file)) return SendClientMessage(playerid,COLOUR_RED,"You don't have an account! Register yourself with /register [Password]");
    if(sscanf(params,"s",pass)) return SendClientMessage(playerid,COLOUR_RED,"Usage: /login [Password]");
    format(rpass,sizeof(rpass),"%s",dini_Str(file,"Password")); // Check this out... did not knot what is te dini cmd for Strings...
    if(!strcmp(udb_hash(pass),rpass))
    {
      pi[playerid][Adminlevel] = dini_Int(file,"Adminlevel");
      pi[playerid][Stat] = dini_Int(file,"Stat");
      format(string,sizeof(string),"Welcome back %s! You have been succesfully been logged in",name);
      SendClientMessage(playerid,COLOUR_GREEN,string);
      logged[playerid] = 1;
      return 1;
      }
    else return SendClientMessage(playerid,COLOUR_RED,"The password was incorrect!");
}
Reply


Messages In This Thread
Getting error when checking pass - by Desert - 02.03.2010, 18:23
Re: Getting error when checking pass - by wafffllesss - 02.03.2010, 18:28
Re: Getting error when checking pass - by Desert - 02.03.2010, 18:40

Forum Jump:


Users browsing this thread: 1 Guest(s)