SA-MP Forums Archive
error 030: compound statement not closed at the end of file - 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: error 030: compound statement not closed at the end of file (/showthread.php?tid=114563)



error 030: compound statement not closed at the end of file - Sergio Leone - 19.12.2009

Hey,

i am currently making a DM script.

When i try and compile i get this error message :

Quote:

Sa-mp test server\gamemodes\LDMv1.0.pwn(83) : error 030: compound statement not closed at the end of file (started at line 54)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

Here is the bit of script it is saying :

Quote:

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/help", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid, YELLOW, "It is very simple,");
SendClientMessage(playerid, YELLOW, "The more you kill, the more money you earn to buy weapons.");
SendClientMessage(playerid, YELLOW, "Use /buygun to buy a weapon.");
return 1;
}
if (strcmp("/buygun", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid, YELLOW, "Use - /buygun [weaponname]");
SendClientMessage(playerid, YELLOW, "baseballbat - $50 | sdpistol - $200 | deagle - $500 | mp5 - $600");
SendClientMessage(playerid, YELLOW, "ak47 - $1250 | m4 - $1500 | Sniper Rifle - $2000");
return 1;
}

if (strcmp("/buygun baseballbat", cmdtext, true, 10) == 0)
{
if(GetPlayerMoney(playerid) < 50)
{
SendClientMessage(playerid, YELLOW, "You do not have enough cash.");
}

Please help me out, i think i may have missed a bracket somewhere but i cant find it anywhere


Re: error 030: compound statement not closed at the end of file - Sergio Leone - 19.12.2009

The last line in the whole script


Re: error 030: compound statement not closed at the end of file - Sergio Leone - 19.12.2009

Didn't do anything


Re: error 030: compound statement not closed at the end of file - Sergio Leone - 19.12.2009

Here : http://pastebin.com/d114353a


Re: error 030: compound statement not closed at the end of file - Abernethy - 19.12.2009

You didn't return false. (or 0. either way works).
pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/help", cmdtext, true, 5) == 0)
    {
    SendClientMessage(playerid, YELLOW, "It is very simple,");
    SendClientMessage(playerid, YELLOW, "The more you kill, the more money you earn to buy weapons.");
    SendClientMessage(playerid, YELLOW, "Use /buygun to buy a weapon.");
    return true;
    }
    if (strcmp("/buygun", cmdtext, true) == 0)
    {
    SendClientMessage(playerid, YELLOW, "Use - /buygun [weaponname]");
    SendClientMessage(playerid, YELLOW, "baseballbat - $50 | sdpistol - $200 | deagle - $500 | mp5 - $600");
    SendClientMessage(playerid, YELLOW, "ak47 - $1250 | m4 - $1500 | Sniper Rifle - $2000");
    return true;
    }
    return false;
}



Re: error 030: compound statement not closed at the end of file - Sergio Leone - 19.12.2009

Thanks guys

Both of yours worked.


Re: error 030: compound statement not closed at the end of file - [Modern] Sonny - 06.04.2011

Guys can any1 help me i have the same problem.

C:\Users\Admin\Desktop\Modern DM\Modern DM skripta\gamemodes\ModernDM.pwn(230) : error 030: compound statement not closed at the end of file (started at line 177)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

Heres the lines

Code:
{

if(dialogid == dialog_buy)//Kupovina guna, dijalog 100
{
	if(response)
  		  {
      	  if(listitem == 0)//M4
   	      {
	  	  GivePlayerWeapon(playerid, 31, 150);
		  GivePlayerMoney(playerid, -600);
	  	  return 1;
 	      }
	  	  if(listitem == 1)//AK-47
	      {
		  GivePlayerWeapon(playerid, 30, 150);
		  GivePlayerMoney(playerid, -600);
		  return 1;
		  }
   		  if(listitem == 2)//Deagle
	      {
		  GivePlayerWeapon(playerid, 24, 50);
		  GivePlayerMoney(playerid, -300);
		  return 1;
		  }
		  if(listitem == 3)//Shotgun
		  {
		  GivePlayerWeapon(playerid, 25, 50);
		  GivePlayerMoney(playerid, -600);
		  return 1;
		  }
		  if(listitem == 4)//Uzi
		  {
		  GivePlayerWeapon(playerid, 32, 150);
		  GivePlayerMoney(playerid, -400);
		  return 1;
		  }
		  if(listitem == 5)//Tec9
		  {
		  GivePlayerWeapon(playerid, 29, 150);
		  GivePlayerMoney(playerid, -400);
		  return 1;
		  }
		  if(listitem == 6)//Granata
		  {
		  GivePlayerWeapon(playerid, 16, 1);
		  GivePlayerMoney(playerid, -50);
		  return 1;
		  }
		  if(listitem == 7)//Smokebang
		  {
		  GivePlayerWeapon(playerid, 17, 1);
		  GivePlayerMoney(playerid, -50);
		  return 1;
		  }
  }



Re: error 030: compound statement not closed at the end of file - [LvZ]Free - 11.08.2011

Change the return 1; with return true;
Something like this
Quote:

GivePlayerWeapon(playerid, 17, 1);
GivePlayerMoney(playerid, -50);
return true;
}
return false;
}