Error on compile
#1

The Error :
Код:
C:\Documents and Settings\Claudiu\Desktop\Chestii !\Pro-gaming by PuNaNi\filterscripts\Vama.pwn(157) : error 030: compound statement not closed at the end of file (started at line 131)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
And The Lines:
Код:
//----------------------------------------------------------------------------------------------------
public OnPlayerCommandText(playerid, cmdtext[])
{
	if(strcmp(cmdtext,"/members",true)==0)
	{
    if(IsPlayerConnected(playerid))
    {
      if (PlayerInfo[playerid][pLeader] != 0) teamnumber = PlayerInfo[playerid][pLeader];
		  else if (PlayerInfo[playerid][pMember] != 0) teamnumber = PlayerInfo[playerid][pMember];
		  else
		  {
      SendClientMessage(playerid, COLOR_LIGHTRED, "You are not a member of a team!");
      return 1;
      }
      SendClientMessage(playerid, COLOR_LIGHTRED, "* Members Online *");
      for(new i = 0; i < MAX_PLAYERS; i++)
      {
	    if (IsPlayerConnected(i))
		  {
  	  GetPlayerName(i, sendername, sizeof(sendername));
  	  format(string, sizeof(string), "");
	    if (PlayerInfo[i][pLeader] == teamnumber) format(string, sizeof(string), "%s ( LEADER )",sendername);
		  else if (PlayerInfo[i][pMember] == teamnumber) format(string, sizeof(string), "%s - Rank : %d.",sendername, PlayerInfo[i][pRank]);
		  if (strlen(string) > 1) SendClientMessage(playerid, 0xF5DEB3AA, string);
				 }
			 }
		 }
		return 1;
	}
I tried for an hour to make the error, but in vain I did,can ye help me? Tanks
Reply
#2

Learn how to indent and you'll find your error
Reply
#3

Код:
if(strcmp(cmdtext,"/members",true)==0)
The line 131


Reply
#4

As far as I can see, the following will fix your error.

Код:
//----------------------------------------------------------------------------------------------------
public OnPlayerCommandText(playerid, cmdtext[])
{
	if(strcmp(cmdtext,"/members",true)==0)
	{
    if(IsPlayerConnected(playerid))
    {
      if (PlayerInfo[playerid][pLeader] != 0) teamnumber = PlayerInfo[playerid][pLeader];
		  else if (PlayerInfo[playerid][pMember] != 0) teamnumber = PlayerInfo[playerid][pMember];
		  else
		  {
      SendClientMessage(playerid, COLOR_LIGHTRED, "You are not a member of a team!");
      return 1;
      }
      SendClientMessage(playerid, COLOR_LIGHTRED, "* Members Online *");
      for(new i = 0; i < MAX_PLAYERS; i++)
      {
	    if (IsPlayerConnected(i))
		  {
  	  GetPlayerName(i, sendername, sizeof(sendername));
  	  format(string, sizeof(string), "");
	    if (PlayerInfo[i][pLeader] == teamnumber) format(string, sizeof(string), "%s ( LEADER )",sendername);
		  else if (PlayerInfo[i][pMember] == teamnumber) format(string, sizeof(string), "%s - Rank : %d.",sendername, PlayerInfo[i][pRank]);
		  if (strlen(string) > 1) SendClientMessage(playerid, 0xF5DEB3AA, string);
				 }
			 }
		 }
		return 1;
	}


return 0;
}
OnPlayerCommandText itself needs to return 0;.

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{

return 0;
}
Like that, all your commands go inbetween the public OnPlayerCommandText and the return 0;

Hope that helped.


PS: the code tags make the indentation horrid lol.
Reply
#5

That error means that youre missing a closing Bracket "}"
Reply
#6

Tanks is works BEST
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)