Getting error when checking pass
#1

I was working on an account filterscript. This is my second time trying to make 1. And last time it all went very buggy. So i didn't want to copy paste it and i wanted to make it with dcmd as im shit at strcmp.

I came up with this script

Код:
dcmd_login(playerid,params[])
{
	new pass,rpass,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]");
	rpass = dini_Int(file,"Password");
	if(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!");
}
And it gives error (109) : error 035: argument type mismatch (argument 1)


The error line is if(udb_hash(pass) == rpass)
Reply
#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
#3

EDIT: Problem fixed! Thanks waffffllesss you inspired me to make the solution
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)