SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 04/06/2012, 07:55 AM   #1
the_zohan
Big Clucker
 
Join Date: Apr 2012
Posts: 123
Reputation: 1
Default Error message: : error 030: compound statement not closed at the end of file (started at line 170)

PHP Code:
#pragma unused ret_memcpy
#include <a_samp>
#include <colors>
#include <Dudb>
#include <Dini>
#include <MidoStream>
#include <a_npc>
#include <foreach>
#include <JunkBuster> // Anti cheat
#include <VehicleHealthBar>
#include <bodyparts>

// Define all the callbacks I need
#define TEAM_USA 1
#define TEAM_COLOR_USA COLOR_BLUE
#define TEAM_JAPAN 2
#define TEAM_COLOR_JAPAN COLOR_WHITE
#define TEAM_GERMANY 3
#define TEAM_COLOR_GERMANY COLOR_BROWN
#define TEAM_RUSSIA 4
#define TEAM_COLOR_RUSSIA COLOR_RED
#define TEAM_ENGLAND 5
#define TEAM_COLOR_ENGLAND COLOR_PLUM
#define TEAM_PAKISTAN 6
#define TEAM_COLOR_PAKISTAN COLOR_LIMEGREEN
#define TEAM_INDIA 7
#define TEAM_COLOR_INDIA COLOR_CORAL
#define TEAM_BRAZIL 8
#define TEAM_COLOR_BRAZIL COLOR_AQUA
#define TEAM_FRANCE 9
#define TEAM_COLOR_FRANCE COLOR_INDIGO
#define TEAM_INDONESIA 10
#define TEAM_COLOR_INDONESIA COLOR_BISQUE

// ----- Variables

#define MAX_GANGZONES   15

new Checkpoint[MAX_PLAYERS];
new 
gangzone;
new 
timer;
new 
gTeam[MAX_PLAYERS];
// ----- Callbacks

public OnFilterScriptInit()
{
    
gangzone GangZoneCreate(841.90671674.3941076.1982007.047); // Creating the GangZone
    
return 1;
}

public 
OnFilterScriptExit()
{
    
GangZoneDestroy(gangzone);
    return 
1;
}

public 
OnPlayerSpawn(playerid)
{
    
SetPlayerCheckpoint(playerid970.76671976.103155); //PINK
    
return 1;
}

public 
OnPlayerEnterCheckpoint(playerid// If the player enters a particluar checkpoint
{
    
SendClientMessage(playerid0x00FF007A"Wait 30 Seconds - To Caputre this gangzone."); // Telling the player to wait 30 seconds.
    
GangZoneFlashForAll(gangzone,  0xFF80FF76); // Makes the turf Flash Pink ( telling everyone its being taken over )
    
SendClientMessageToAll(0xFF80FFFF"The gangzone is being taken over"); // Sending Message to all players.
    
timer SetTimerEx("SetZone"30000false"i"playerid); // Setting the Timer... ( 30 seconds )
    
Checkpoint[playerid] = 1// Telling the variable that the player is in the checkpoint.
    
return 1;
}

public 
OnPlayerLeaveCheckpoint(playerid)
{
    if(
Checkpoint[playerid] == 1)
    {
        
SendClientMessage(playerid0x00FF007A" You have left the checkpoint , You have failed to capture");
        
GangZoneStopFlashForAll(gangzone);
        
SendClientMessageToAll(0x00FF007A"gangzone was not taken over");
        
KillTimer(timer);
        
Checkpoint[playerid] = 0;
    }
    else
    {
        
// nothing
    
}
    return 
1;
}

// Custom Callbacks

forward SetZone(playerid);
public 
SetZone(playerid)
{
        
gTeam[playerid] = TEAM_USA;
        {
        
GangZoneShowForAll(gangzone,TEAM_COLOR_USA);
    }
        if(
gTeam[playerid] == TEAM_JAPAN)
    {
        
GangZoneShowForAll(gangzone,TEAM_COLOR_JAPAN);
    }
        if(
gTeam[playerid] == TEAM_GERMANY)
    {
        
GangZoneShowForAll(gangzone,TEAM_COLOR_GERMANY);
    }
        if(
gTeam[playerid] == TEAM_RUSSIA)
    {
        
GangZoneShowForAll(gangzone,TEAM_COLOR_RUSSIA);
    }
        if(
gTeam[playerid] == TEAM_ENGLAND)
    {
        
GangZoneShowForAll(gangzone,TEAM_COLOR_ENGLAND);
    }
        if(
gTeam[playerid] == TEAM_PAKISTAN)
    {
        
GangZoneShowForAll(gangzone,TEAM_COLOR_PAKISTAN);
    }
        if(
gTeam[playerid] == TEAM_FRANCE)
    {
        
GangZoneShowForAll(gangzone,TEAM_COLOR_FRANCE);
    }
        if(
gTeam[playerid] == TEAM_INDIA)
    {
        
GangZoneShowForAll(gangzone,TEAM_COLOR_INDIA);
    }
        if(
gTeam[playerid] == TEAM_BRAZIL)
    {
        
GangZoneShowForAll(gangzone,TEAM_COLOR_BRAZIL);
    }
        if(
gTeam[playerid] == TEAM_INDONESIA)
    {
        
GangZoneShowForAll(gangzone,TEAM_COLOR_INDONESIA);
        return 
1;
    }
        if(
Checkpoint[TEAM_USA]  == 1)
    {
        
GangZoneShowForAll(gangzoneCOLOR_BLUE ); // Showing the GangZone with the new colour
        
        
if(Checkpoint[TEAM_JAPAN]  == 1)
    {
        
GangZoneShowForAll(gangzoneCOLOR_WHITE ); 
        
        
Checkpoint[playerid] = 0;
        
        if(
Checkpoint[TEAM_GERMANY]  == 1)
    {
        
GangZoneShowForAll(gangzoneCOLOR_BROWN );

        
Checkpoint[playerid] = 0;
        
        if(
Checkpoint[TEAM_RUSSIA]  == 1)
    {
        
GangZoneShowForAll(gangzoneCOLOR_RED );

        if(
Checkpoint[TEAM_ENGLAND]  == 1)
    {
        
GangZoneShowForAll(gangzoneCOLOR_PLUM );

        
Checkpoint[playerid] = 0;

        if(
Checkpoint[TEAM_PAKISTAN]  == 1)
    {
        
GangZoneShowForAll(gangzoneCOLOR_LIMEGREEN );

        
Checkpoint[playerid] = 0;

        if(
Checkpoint[TEAM_INDIA]  == 1)
    {
        
GangZoneShowForAll(gangzoneCOLOR_CORAL );

        if(
Checkpoint[TEAM_BRAZIL]  == 1)
    {
        
GangZoneShowForAll(gangzoneCOLOR_AQUA );

        
Checkpoint[playerid] = 0;

        if(
Checkpoint[TEAM_FRANCE]  == 1)
    {
        
GangZoneShowForAll(gangzoneCOLOR_INDIGO );

        
Checkpoint[playerid] = 0;
        
        if(
Checkpoint[TEAM_INDONESIA]  == 1)
    {
        
GangZoneShowForAll(gangzoneCOLOR_BISQUE );
        
Checkpoint[playerid] = 0;
        
GangZoneStopFlashForAll(gangzone); // Stopping it Flashing.
        
GangZoneHideForAll(gangzone); // Hiding the GangZone
        
SendClientMessageToAll(0x00FF007A"gangzone Has Been Captured By Attacker");
        
SetPlayerScore(playerid,GetPlayerScore(playerid)+);
        
GivePlayerMoney(playerid,6000);
        
SendClientMessage(playerid,0xFFFFFFFF,"You've capture the zone and receive 500 $ and 5 score");
        
Checkpoint[playerid] = 1
the_zohan is offline   Reply With Quote
Old 04/06/2012, 08:05 AM   #2
iggy1
High-roller
 
iggy1's Avatar
 
Join Date: Mar 2009
Location: One past the end.
Posts: 2,421
Reputation: 273
Default Re: Error message: : error 030: compound statement not closed at the end of file (started at line 170)

Do you actually want help? Use [pawn] tags not [php]. And at LEAST put a comment on the line the error starts. I know it's line 170 but i don't want to count through.
iggy1 is offline   Reply With Quote
Old 04/06/2012, 08:13 AM   #3
the_zohan
Big Clucker
 
Join Date: Apr 2012
Posts: 123
Reputation: 1
Default Re: Error message: : error 030: compound statement not closed at the end of file (started at line 170)

there u go
http://pastebin.com/u1CnaYrB
the_zohan is offline   Reply With Quote
Old 04/06/2012, 08:23 AM   #4
iggy1
High-roller
 
iggy1's Avatar
 
Join Date: Mar 2009
Location: One past the end.
Posts: 2,421
Reputation: 273
Default Re: Error message: : error 030: compound statement not closed at the end of file (started at line 170)

http://wiki.sa-mp.com/wiki/Scripting_Basics
http://wiki.sa-mp.com/wiki/PAWN_for_Beginners
http://wiki.sa-mp.com/wiki/PAWN_tutorial

http://en.wikipedia.org/wiki/Talk%3AIndent_style

You need to learn to script. And indent.

If the code was decently indented you probably would have prevented this error. One thing i seen straight away is that you don't have a closing brace on your "SetZone" function, which made me instantly think there will be a hell of a lot more wrong with the code.

There's no point in people helping you, if you wont help yourself. You need to learn.
iggy1 is offline   Reply With Quote
Old 04/06/2012, 08:25 AM   #5
ricardo178
High-roller
 
ricardo178's Avatar
 
Join Date: Dec 2010
Posts: 1,598
Reputation: 91
Default Re: Error message: : error 030: compound statement not closed at the end of file (started at line 170)

pawn Code:
{
        GangZoneShowForAll(gangzone, COLOR_BISQUE );
        Checkpoint[playerid] = 0;
        GangZoneStopFlashForAll(gangzone); // Stopping it Flashing.
        GangZoneHideForAll(gangzone); // Hiding the GangZone
        SendClientMessageToAll(0x00FF007A, "gangzone Has Been Captured By Attacker");
        SetPlayerScore(playerid,GetPlayerScore(playerid)+5 );
        GivePlayerMoney(playerid,6000);
        SendClientMessage(playerid,0xFFFFFFFF,"You've capture the zone and receive 500 $ and 5 score");
        Checkpoint[playerid] = 1;  
    }
}
ricardo178 is offline   Reply With Quote
Old 04/06/2012, 08:38 AM   #6
the_zohan
Big Clucker
 
Join Date: Apr 2012
Posts: 123
Reputation: 1
Default Re: Error message: : error 030: compound statement not closed at the end of file (started at line 170)

still i get error here http://pastebin.com/JApbBeSz
Code:
D:\sampserver\pawno\capturezoneneedtobefixed.pwn(197) : error 030: compound statement not closed at the end of file (started at line 174)
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
the_zohan is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error message: : error 030: compound statement not closed at the end of file (started at line 503) David5290 Scripting Help 5 13/04/2012 03:50 AM
test.pwn(248) : error 030: compound statement not closed at the end of file (started at line 234) davelord Scripting Help 3 09/01/2012 09:01 PM
(35065) : error 030: compound statement not closed at the end of file (started at line 34889) random123 Scripting Help 2 02/10/2011 06:02 AM
error 030: compound statement not closed at the end of file Sergio Leone Help Archive 7 11/08/2011 03:34 PM
error 030: compound statement not closed at the end of file (started at line 240 w00tNew Help Archive 4 23/12/2009 08:15 AM


All times are GMT. The time now is 09:17 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.