error 029: invalid expression, assumed zero
#1

Код:
CMD:changepass(playerid,params[])
{
	new pass[128];
	if(sscanf(params, "s[128]", pass))
	{
		SendClientMessage(playerid,COLOR_RED,"Usage: /changepass <new pass>");
	        return 1;
	}
	if(strlen(pass) < MIN_PASS_LEN || strlen(pass) > MAX_PASS_LEN);
	{
		SendClientMessage(playerid,COLOR_RED,"SERVER: Incorrect password length.");
		return 1;
	}
	new string[128];
        UpdatePlayerPass(playerid, pass);
	PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
        format(string, sizeof(string),"SERVER: You have successfully changed your password to \"%s\"",pass);
	SendClientMessage(playerid,COLOR_YELLOW,string);
	return 1;
}
Код:
error 029: invalid expression, assumed zero
When i try to compile this, it give's those annoying errors, which i don't know how fix.. tried many times but nothing.
Reply
#2

What's the error line?
Reply
#3

Quote:
Originally Posted by redneckvideogamer
Посмотреть сообщение
What's the error line?
8342
8345
8347
Reply
#4

Show the lines...
Reply
#5

I feel like I know what it is.

Try replacing this line:

Код:
format(string, sizeof(string),"SERVER: You have successfully changed your password to \"%s\"",pass);
with:

Код:
format(string, sizeof(string),"SERVER: You have successfully changed your password to %s",pass);
Reply
#6

Код:
if(strlen(pass) < MIN_PASS_LEN || strlen(pass) > MAX_PASS_LEN);
There's your mistake, statement ending in semicolon
Reply
#7

Quote:
Originally Posted by CuervO
Посмотреть сообщение
Код:
if(strlen(pass) < MIN_PASS_LEN || strlen(pass) > MAX_PASS_LEN);
There's your mistake, statement ending in semicolon
Hah, luckily it isn't valid. In a language such as Java, you would just wonder why your code wasn't checking conditions correctly.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)