error 030: compound statement not closed at the end of file
#1

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
Reply
#2

The last line in the whole script
Reply
#3

Didn't do anything
Reply
#4

Here : http://pastebin.com/d114353a
Reply
#5

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;
}
Reply
#6

Thanks guys

Both of yours worked.
Reply
#7

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;
		  }
  }
Reply
#8

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

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

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)