SA-MP Forums Archive
invalid expression, assumed zero - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: invalid expression, assumed zero (/showthread.php?tid=163191)



invalid expression, assumed zero - mariokumanovac - 26.07.2010

Why on this command

pawn Код:
CMD:changepassword(playerid, params[])
{
    if(!UserExists(playerid))
    else //line 774
    {
        if (IgracInfo[playerid][Jezik] == 1)
        {
        SendClientMessage(playerid, COLOR_LIGHTBLUE, "/changepassword [nova lozinka]");
        }
        if (IgracInfo[playerid][Jezik] == 2)
        {
        SendClientMessage(playerid, COLOR_LIGHTBLUE, "/changepassword [novi password]");
        }
        if (IgracInfo[playerid][Jezik] == 3)
        {
        SendClientMessage(playerid, COLOR_LIGHTBLUE, "/changepassword [new password]");
        }
    }
    if(isnull(params)) return SendClientMessage(playerid, COLOR_RED, "Tocnije: /changepassword [nova lozinka]");
    if(PlayerInfo[playerid][LoggedIn] == 0) return SendClientMessage(playerid, COLOR_RED,"Nisi ulogiran!");

    new FilePath[128];
    format(FilePath, sizeof(FilePath), "Korisnici/%s.ini", PlayerName(playerid));

    new password = num_hash(params);
    PlayerInfo[playerid][Password] = password;

    dini_IntSet(FilePath,"Password",PlayerInfo[playerid][Password]);
    if (IgracInfo[playerid][Jezik] == 1)
    {
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Информација:");
    new string[256]; format(string, sizeof(string), "Успешно ја променивте вашата лозинка, новата лозинка е: \'%s\'.", params);
    SendClientMessage(playerid, COLOR_WHITE, string);
    }
    if (IgracInfo[playerid][Jezik] == 2)
    {
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Informacije:");
    new string[256]; format(string, sizeof(string), "Uspesno ste promenili password, novi password je: \'%s\'.", params);
    SendClientMessage(playerid, COLOR_WHITE, string);
    }
    if (IgracInfo[playerid][Jezik] == 3)
    {
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Information:");
    new string[256]; format(string, sizeof(string), "Successful change your password, your new password is: \'%s\'.", params);
    SendClientMessage(playerid, COLOR_WHITE, string);
    }
    return PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
}
this error?

Код:
E:\SAMP Server\PitBull Freeroam\gamemodes\pitbull.pwn(774) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.



Re: invalid expression, assumed zero - eDz0r - 26.07.2010

Quote:
Originally Posted by mariokumanovac
Посмотреть сообщение
Why on this command

pawn Код:
CMD:changepassword(playerid, params[])
{
    if(!UserExists(playerid))
    else //line 774
    {
        if (IgracInfo[playerid][Jezik] == 1)
        {
        SendClientMessage(playerid, COLOR_LIGHTBLUE, "/changepassword [nova lozinka]");
        }
        if (IgracInfo[playerid][Jezik] == 2)
        {
        SendClientMessage(playerid, COLOR_LIGHTBLUE, "/changepassword [novi password]");
        }
        if (IgracInfo[playerid][Jezik] == 3)
        {
        SendClientMessage(playerid, COLOR_LIGHTBLUE, "/changepassword [new password]");
        }
    }
    if(isnull(params)) return SendClientMessage(playerid, COLOR_RED, "Tocnije: /changepassword [nova lozinka]");
    if(PlayerInfo[playerid][LoggedIn] == 0) return SendClientMessage(playerid, COLOR_RED,"Nisi ulogiran!");

    new FilePath[128];
    format(FilePath, sizeof(FilePath), "Korisnici/%s.ini", PlayerName(playerid));

    new password = num_hash(params);
    PlayerInfo[playerid][Password] = password;

    dini_IntSet(FilePath,"Password",PlayerInfo[playerid][Password]);
    if (IgracInfo[playerid][Jezik] == 1)
    {
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Информација:");
    new string[256]; format(string, sizeof(string), "Успешно ја променивте вашата лозинка, новата лозинка е: \'%s\'.", params);
    SendClientMessage(playerid, COLOR_WHITE, string);
    }
    if (IgracInfo[playerid][Jezik] == 2)
    {
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Informacije:");
    new string[256]; format(string, sizeof(string), "Uspesno ste promenili password, novi password je: \'%s\'.", params);
    SendClientMessage(playerid, COLOR_WHITE, string);
    }
    if (IgracInfo[playerid][Jezik] == 3)
    {
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Information:");
    new string[256]; format(string, sizeof(string), "Successful change your password, your new password is: \'%s\'.", params);
    SendClientMessage(playerid, COLOR_WHITE, string);
    }
    return PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
}
this error?

Код:
E:\SAMP Server\PitBull Freeroam\gamemodes\pitbull.pwn(774) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
i thintk that "else" is not good there.... delet and try compile


Re: invalid expression, assumed zero - Last_Stand_Guardian - 26.07.2010

Two possibilities:
1:
Replace:
pawn Код:
if(!UserExists(playerid))
by:
pawn Код:
if(UserExists(playerid))
And remove the >else<

2:
Replace:
pawn Код:
if(!UserExists(playerid))
by:
pawn Код:
if(!UserExists(playerid)) { }
And you can keep your else

=D


Re: invalid expression, assumed zero - Toni - 26.07.2010

In plain words, just remove else.


Re: invalid expression, assumed zero - mariokumanovac - 26.07.2010

Here is how out in the end is not my mistakes but when I write my command so many messages out of all messages and plus a cancel my password.

Код:
CMD:changepassword(playerid, params[])
{
	if(UserExists(playerid)) {
	if(IgracInfo[playerid][Jezik] == 1)
	{
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "Оваа корисничко име не е регистирано.");
	}
	if (IgracInfo[playerid][Jezik] == 2)
	{
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "Ovo korisnicko ime nije registirano.");
 	}
	if (IgracInfo[playerid][Jezik] == 3)
	{
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "This username is not registred.");
	}
	}
	if(isnull(params)) {
	if(IgracInfo[playerid][Jezik] == 1)
	{
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "/changepassword [нова лозинка]");
	}
	if (IgracInfo[playerid][Jezik] == 2)
	{
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "/changepassword [novi password]");
 	}
	if (IgracInfo[playerid][Jezik] == 3)
	{
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "/changepassword [new password]");
	}
	}
   	if(PlayerInfo[playerid][LoggedIn] == 0) return SendClientMessage(playerid, COLOR_RED,"Nisi ulogiran!");

   	new FilePath[128];
	format(FilePath, sizeof(FilePath), "Korisnici/%s.ini", PlayerName(playerid));

   	new password = num_hash(params);
    PlayerInfo[playerid][Password] = password;

	dini_IntSet(FilePath,"Password",PlayerInfo[playerid][Password]);
	if (IgracInfo[playerid][Jezik] == 1)
	{
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "Информација:");
	new string[256]; format(string, sizeof(string), "Успешно ја променивте вашата лозинка, новата лозинка е: \'%s\'.", params);
	SendClientMessage(playerid, COLOR_WHITE, string);
	}
	if (IgracInfo[playerid][Jezik] == 2)
	{
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "Informacije:");
	new string[256]; format(string, sizeof(string), "Uspesno ste promenili password, novi password je: \'%s\'.", params);
	SendClientMessage(playerid, COLOR_WHITE, string);
 	}
	if (IgracInfo[playerid][Jezik] == 3)
	{
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "Information:");
	new string[256]; format(string, sizeof(string), "Successful change your password, your new password is: \'%s\'.", params);
	SendClientMessage(playerid, COLOR_WHITE, string);
	}
	return PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
}



Re: invalid expression, assumed zero - mariokumanovac - 26.07.2010

Here is how out in the end is not my mistakes but when I write my command so many messages out of all messages and plus a cancel my password.

Код:
CMD:changepassword(playerid, params[])
{
	if(UserExists(playerid)) {
	if(IgracInfo[playerid][Jezik] == 1)
	{
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "Оваа корисничко име не е регистирано.");
	}
	if (IgracInfo[playerid][Jezik] == 2)
	{
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "Ovo korisnicko ime nije registirano.");
 	}
	if (IgracInfo[playerid][Jezik] == 3)
	{
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "This username is not registred.");
	}
	}
	if(isnull(params)) {
	if(IgracInfo[playerid][Jezik] == 1)
	{
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "/changepassword [нова лозинка]");
	}
	if (IgracInfo[playerid][Jezik] == 2)
	{
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "/changepassword [novi password]");
 	}
	if (IgracInfo[playerid][Jezik] == 3)
	{
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "/changepassword [new password]");
	}
	}
   	if(PlayerInfo[playerid][LoggedIn] == 0) return SendClientMessage(playerid, COLOR_RED,"Nisi ulogiran!");

   	new FilePath[128];
	format(FilePath, sizeof(FilePath), "Korisnici/%s.ini", PlayerName(playerid));

   	new password = num_hash(params);
    PlayerInfo[playerid][Password] = password;

	dini_IntSet(FilePath,"Password",PlayerInfo[playerid][Password]);
	if (IgracInfo[playerid][Jezik] == 1)
	{
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "Информација:");
	new string[256]; format(string, sizeof(string), "Успешно ја променивте вашата лозинка, новата лозинка е: \'%s\'.", params);
	SendClientMessage(playerid, COLOR_WHITE, string);
	}
	if (IgracInfo[playerid][Jezik] == 2)
	{
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "Informacije:");
	new string[256]; format(string, sizeof(string), "Uspesno ste promenili password, novi password je: \'%s\'.", params);
	SendClientMessage(playerid, COLOR_WHITE, string);
 	}
	if (IgracInfo[playerid][Jezik] == 3)
	{
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "Information:");
	new string[256]; format(string, sizeof(string), "Successful change your password, your new password is: \'%s\'.", params);
	SendClientMessage(playerid, COLOR_WHITE, string);
	}
	return PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
}