Need help
#1

I created a makeadmin command and i want to add that when the password is 0987654321 he gets the admin status
and when its not..then not ^^

But I get these errors->

warning 206: redundant test: constant expression is non-zero
error 029: invalid expression, assumed zero
warning 215: expression has no effect
error 001: expected token: ";", but found ")"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line


Код:
	if(strcmp("madmin",cmd,true) == 0)
	{
	new pass[256];
	
	format(string,sizeof(string),"0987654321");
	
	pass = strtok(cmdtext,index);
  if(!strlen(pass))
  {
  SendClientMessage(playerid,COLOR_RED,"Usage:/madmin[password]");
	return 1;
	}
	if(pass,string,true) == 0) //this line !
	{
	pAdmin[playerid] = 1;
	SendClientMessage(playerid,COLOR_WHITE,"Succesful indentified as Admin!");
	}
	else if(pass,string,false) == 0)
	{
	SendClientMessage(playerid,COLOR_RED,"->!WRONG PASSWORD!<-");
	}
	return 1;
  }



SOLUTION FOUND !!

TOPIC CAN BE CLOSED
Reply
#2

Once you have num_hashed or done w/e to the password, use strcmp:

if(!strcmp(password, "0987654321")) //This guy used the correct password
else //this tard is not worthy.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)