SA-MP Forums Archive
Only ONE error. Please?.. - 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: Only ONE error. Please?.. (/showthread.php?tid=208038)



Only ONE error. Please?.. - Facepunch - 07.01.2011

So i'm currently setting up restricted vehicles. But when I compile I get only ONE error:

Quote:

error 030: compound statement not closed at the end of file (started at line 269)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

1 Error.

I have marked the (296) just in case you need it to know where the prob is.
ALSO, I have tried return 1; and return true; but it didn't change anything.
Thanks in ADvance!


pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if (newstate == 2) // THIS IS THE 269, 299 IS THE END OF THE SCRIPT
    {
        new CarID = GetPlayerVehicleID(playerid);
        if (CarID==copcar1) {
            if (Member[playerid] == 1) {
            }else{
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid,COLOR_RED,"Your Not Authorization To Use This Cop Car!");
   }
    }

        if (CarID==copcar2) {
            if (Member[playerid] == 1) {
            }else{
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid,COLOR_RED,"Your Not Authorization To Use This Cop Car!");
            }
    }

        if (CarID==copcar3) {
            if (Leader[playerid] == 1) {
            }else{
                RemovePlayerFromVehicle(playerid);
                SendClientMessage(playerid,COLOR_RED,"This vehicle is only drivable by the Chief!");
    }
 }
}



Re: Only ONE error. Please?.. - Toreno - 07.01.2011

Try this:
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == 2) // THIS IS THE 269, 299 IS THE END OF THE SCRIPT
    {
        new CarID = GetPlayerVehicleID(playerid);
        if(CarID==copcar1)
        {
            if(Member[playerid] != 1)
            {
                RemovePlayerFromVehicle(playerid);
                SendClientMessage(playerid,COLOR_RED,"Your Not Authorization To Use This Cop Car!");
            }
        }
        if(CarID==copcar2)
        {
            if (Member[playerid] != 1)
            {
                RemovePlayerFromVehicle(playerid);
                SendClientMessage(playerid,COLOR_RED,"Your Not Authorization To Use This Cop Car!");
            }
        }
        if(CarID==copcar3)
        {
            if(Leader[playerid] != 1)
            {
                RemovePlayerFromVehicle(playerid);
                SendClientMessage(playerid,COLOR_RED,"This vehicle is only drivable by the Chief!");
            }
        }
    }
    return 1;
}



Re: Only ONE error. Please?.. - Mariooo - 07.01.2011

I hope you can guess it by yourself.....
PS: Eliran got it right.