error 029: invalid expression, assumed zero
#1

Error:-
Quote:

C:\Users\BladeGamingYT\Desktop\X-Gang.pwn(895) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

Code:-
Код:
COMMAND:okickmember(playerid, params[])
{
	new TempName[MAX_PLAYER_NAME];
	if(Player[playerid][PlayerStatus] == GANG_STAFF)
	{
		if(sscanf(params, "s[24]", TempName))
		{
			SendClientMessage(playerid, COLOR_WHITE, "[SYNTAX] '/okickmember' <member name>");
		}
		else
		{
			new query[256], i = Player[playerid][PlayerGang];
			format(query, sizeof(query), "SELECT * FROM `member` WHERE `name` = '%s'", Escape(TempName));
			mysql_query(query, -1, 0, connection);
			mysql_store_result(connection);
			if(mysql_num_rows(connection) != 0)
			{
				mysql_fetch_field("gang", query, connection);
				if(strval(query) == Gang[i][GangID])
				{
					mysql_fetch_field("id", query, connection);
					if(strval(query) != Player[playerid][PlayerID])
					{
						mysql_fetch_field("status", query, connection);
						if(strval(query) != GANG_LEADER)
						{
							format(query, sizeof(query), "UPDATE `member` SET `gang` = -1, `status` = 1 WHERE `name` = '%s'", Escape(TempName));
							mysql_query(query, -1, 0, connection);
							format(query, sizeof(query), "{FF0000}(Gang Chat) %s has been kicked from gang!", TempName);
							SendGangMessage(i, query);
							new p = GetID(TempName);
							if(IsPlayerConnected(p))
							{
								SendClientMessage(p, COLOR_WHITE, "[HINT] You have been kicked from gang!");
								Player[p][PlayerGang] = -1;
								Player[p][PlayerStatus] = GANG_MEMBER;
							}
						}
						else
							SendClientMessage(playerid, COLOR_RED, "You can't kick gang leader!");
					}
					else
						SendClientMessage(playerid, COLOR_RED, "You can't kick yourself!");
				}
				else
					SendClientMessage(playerid, COLOR_RED, "That player isn't in your gang!");
			}
			else
			SendClientMessage(playerid, COLOR_RED, "ERROR 404: Name not found!");
			mysql_free_result(connection);
		}
		//Line No.895
                else
		{
			SendClientMessage(playerid, COLOR_RED, "You must be a gang leader or gang staff to use this command!");
		}
	}
	return 1;
}
Full Filterscript:- https://pastebin.com/bUjyqJHr
Reply
#2

That last else is line no.895 :/ please help
Reply
#3

Guys please help!
Reply
#4

I guess no one will help :/
Reply
#5

Did u define Player[][]?
Reply
#6

Because your code is like this:
Код:
if ()
{
    if ()
    {
    }
    else
    {
    }
    else
    {
    }
}
return 1;
Re-structure it. Add a closed bracket before the last else and remove the closed bracket above return.
Код:
if ()
{
    if ()
    {
    }
    else
    {
    }
}
else
{
}
return 1;
Quote:
Originally Posted by BladeGamingYT
Посмотреть сообщение
Guys please help!
Quote:
Originally Posted by BladeGamingYT
Посмотреть сообщение
I guess no one will help :/
Also please do not be impatient. It takes few minutes to read a thread, write a good post with explanation and the most important, each thread poster wants to solve their problem quickly -- if every one of them bumped every 5 minute, you can understand what would happen.
Reply
#7

Quote:
Originally Posted by Calisthenics
Посмотреть сообщение
Because your code is like this:
Код:
if ()
{
    if ()
    {
    }
    else
    {
    }
    else
    {
    }
}
return 1;
Re-structure it. Add a closed bracket before the last else and remove the closed bracket above return.
Код:
if ()
{
    if ()
    {
    }
    else
    {
    }
}
else
{
}
return 1;




Also please do not be impatient. It takes few minutes to read a thread, write a good post with explanation and the most important, each thread poster wants to solve their problem quickly -- if every one of them bumped every 5 minute, you can understand what would happen.
Bro Thank you so much <3 +REP
Reply
#8

Код:
			else
			SendClientMessage(playerid, COLOR_RED, "ERROR 404: Name not found!");
			mysql_free_result(connection);
that's something else i noticed.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)