02.03.2010, 18:23
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
And it gives error (109) : error 035: argument type mismatch (argument 1)
The error line is if(udb_hash(pass) == rpass)
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!");
}
The error line is if(udb_hash(pass) == rpass)

