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



Help with: Error 030: compound statement not closed at the end of file - Bestkid - 01.07.2012

Hey All,

I'm new to the Scripting world of SA:MP and like I came across loads of problem with Pawn while I was scripting, but with the help of this wonderful forum, I was able to solve it (by reading other posts). However, two problems that I cannot really resolve is this:

Error 030: compound statement not closed at the end of file

Warning 217: loose indentation


These two problems have just occured to me as I was following this thread:

https://sampforum.blast.hk/showthread.php?tid=231987

As you can see it is about How to add cars to your SA:MP server. As a result of implying the code from the first link on that thread, I have encountered one Error 030 problem and about 40 Warning 217 problems.

Here is my scripting for the Error 030:

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
        #if ADMINS_ONLY == true
        if(IsPlayerAdmin(playerid)) {
        #endif

        #if SKIN_SELECT == true
        dcmd(s, 1, cmdtext);
        dcmd(ssel, 4, cmdtext);
        dcmd(skin, 4, cmdtext);
        #endif

        #if VEHI_SELECT == true
        dcmd(v, 1, cmdtext);
        dcmd(vsel, 4, cmdtext);
        dcmd(vehicle, 7, cmdtext);
        #endif

        #if WORL_SELECT == true
        dcmd(w, 1, cmdtext);
        dcmd(t, 1, cmdtext);
        dcmd(g, 1, cmdtext);
        dcmd(wsel, 4, cmdtext);
        dcmd(time, 4, cmdtext);
        dcmd(weather, 7, cmdtext);
        dcmd(gravity, 7, cmdtext);
        #endif

        #if MISCEL_CMDS == true
        dcmd(w2, 2, cmdtext);
        dcmd(goto, 4, cmdtext);
        dcmd(bring, 5, cmdtext);
        dcmd(warpto, 6, cmdtext);
        dcmd(weapon, 6, cmdtext);
        dcmd(setloc, 6, cmdtext);
        #endif

        #if CAME_SELECT == true
        dcmd(csel, 4, cmdtext);
        dcmd(camera, 6, cmdtext);
        #endif

        dcmd(osel, 4, cmdtext);
        dcmd(object, 6, cmdtext);
        dcmd(debug, 5, cmdtext);

        #if ADMINS_ONLY == true
        }
		#endif

	if (strcmp("/mycommand", cmdtext, true, 10) == 0)

	{
		return 1;
}
The "Compile/run" said : error 030: compound statement not closed at the end of file (started at line 2212).

Line 2212 is "dcmd(s, 1, cmdtext);"

If you could please tell me what to add or do it would be an honour as I really want to add some cars to my server.


Peace
Bestkid


Re: Help with: Error 030: compound statement not closed at the end of file - Vince - 01.07.2012

Isn't it like totally obvious that you missed a bracket on the second to last line?


Re: Help with: Error 030: compound statement not closed at the end of file - .FuneraL. - 01.07.2012

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
        #if ADMINS_ONLY == true
        if(IsPlayerAdmin(playerid)) {
        #endif

        #if SKIN_SELECT == true
        dcmd(s, 1, cmdtext);
        dcmd(ssel, 4, cmdtext);
        dcmd(skin, 4, cmdtext);
        #endif

        #if VEHI_SELECT == true
        dcmd(v, 1, cmdtext);
        dcmd(vsel, 4, cmdtext);
        dcmd(vehicle, 7, cmdtext);
        #endif

        #if WORL_SELECT == true
        dcmd(w, 1, cmdtext);
        dcmd(t, 1, cmdtext);
        dcmd(g, 1, cmdtext);
        dcmd(wsel, 4, cmdtext);
        dcmd(time, 4, cmdtext);
        dcmd(weather, 7, cmdtext);
        dcmd(gravity, 7, cmdtext);
        #endif

        #if MISCEL_CMDS == true
        dcmd(w2, 2, cmdtext);
        dcmd(goto, 4, cmdtext);
        dcmd(bring, 5, cmdtext);
        dcmd(warpto, 6, cmdtext);
        dcmd(weapon, 6, cmdtext);
        dcmd(setloc, 6, cmdtext);
        #endif

        #if CAME_SELECT == true
        dcmd(csel, 4, cmdtext);
        dcmd(camera, 6, cmdtext);
        #endif

        dcmd(osel, 4, cmdtext);
        dcmd(object, 6, cmdtext);
        dcmd(debug, 5, cmdtext);

        #if ADMINS_ONLY == true
        }
        #endif

    if (strcmp("/mycommand", cmdtext, true, 10) == 0)

    {
        return 1;
        }
        return 1;
}
Try this.


Re: Help with: Error 030: compound statement not closed at the end of file - Bestkid - 01.07.2012

@Vince, Can't you read I'm a noob at scripting. I've had no tutorials or anything and I know how to start up a server and all. It's just this stuff...

@.FuneraL., I'll try and I'll tell you...


Re: Help with: Error 030: compound statement not closed at the end of file - Bestkid - 01.07.2012

Thanks guys, it worked that's +1 reputation point to both of you! Great Job but I have another problem...