Unmatched Closing Brace [HELP]
#1

Код:
F:\SAMP SERVER\gamemodes\grandlarc.pwn(72) : warning 219: local variable "X" shadows a variable at a preceding level
F:\SAMP SERVER\gamemodes\grandlarc.pwn(72) : warning 219: local variable "Y" shadows a variable at a preceding level
F:\SAMP SERVER\gamemodes\grandlarc.pwn(72) : warning 219: local variable "Z" shadows a variable at a preceding level
F:\SAMP SERVER\gamemodes\grandlarc.pwn(1715) : warning 213: tag mismatch
F:\SAMP SERVER\gamemodes\grandlarc.pwn(1749) : error 054: unmatched closing brace ("}")
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
I need you're help please.
I try a lot of things, i don't know what to do.
Reply
#2

delete the brace at line 1749
Reply
#3

Ok, no more error Thanks

BUT!

Here is the OnPlayerCommandText:

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	{
	    if(strcmp("/vehokreni", cmdtext, true) == 0)
	    {
			new currentveh;
   			new Float:angle;
      		currentveh = GetPlayerVehicleID(playerid);
      		GetVehicleZAngle(currentveh, angle);
        	SetVehicleZAngle(currentveh, angle);
        	SendClientMessage(playerid, 0x33CCFFAA, "Preokrenuo si vozilo.");
	        return 1;
		}
		if (!strcmp(cmdtext,"/vehpopravi"))
		{
  			if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "Nisi u vozilu!");
     		RepairVehicle(GetPlayerVehicleID(playerid));
       		SendClientMessage(playerid, 0x33CCFFAA, "Popravio si vozilo!");
	        return 1;
		}
		if(!strcmp(cmdtext, "/kreirajv", true))
		{
  			if(!strcmp(cmdtext, "/kreirajv", true))
   			{
      			ShowPlayerDialog(playerid, vmenu, DIALOG_STYLE_LIST, "Spawn Vozila", "Sultan \nInfernus \nMaverick \nNRG-500", "Spawn", "Cancel");
	        	return 1;
	    	}
		}
		if (strcmp("/taxio", cmdtext, true, 10) == 0)
		{
			MoveObject(object,1269.91210938,-1842.36523438,15.17082977, 2.00);
			SetTimer("close", 7000, 0);//gate will be  closed for 7 seconds
  			SendClientMessage(playerid,0x33CCFFAA,"Kapija se otvara i za 7 sekundi ce biti automatski zatvorena.");
	    	return 1;}
		}
		return SendClientMessage(playerid, 0x999999AA, "WTF: Upisao si nepoznatu komandu.");
	}
I have return SendClient.... because of SERVER: Unknwon Command but when i type /ngacsaskmcoasm in game it won't show me anything, no SERVER:Unknown command and WTF:...., and those commands up there isn't working. If i type /vehpopravi [this is for RepairVehicle] it won't repair my vehicle.

PS. These commands do not work in game, all of those commands.
Reply
#4

Ok so i delete #pragma tabsize 0 and i get rid of all of those LOOSE IDENTITATION or something like that.

But my commands wont work InGame... Help please

Код:
F:\SAMP SERVER\gamemodes\grandlarc.pwn(71) : warning 219: local variable "X" shadows a variable at a preceding level
F:\SAMP SERVER\gamemodes\grandlarc.pwn(71) : warning 219: local variable "Y" shadows a variable at a preceding level
F:\SAMP SERVER\gamemodes\grandlarc.pwn(71) : warning 219: local variable "Z" shadows a variable at a preceding level
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Warnings.
And my OnPlayerCommandText -->

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	{
	    if(strcmp("/vehokreni", cmdtext, true) == 0)
	    {
			new currentveh;
   			new Float:angle;
      		currentveh = GetPlayerVehicleID(playerid);
      		GetVehicleZAngle(currentveh, angle);
        	SetVehicleZAngle(currentveh, angle);
        	SendClientMessage(playerid, 0x33CCFFAA, "Preokrenuo si vozilo.");
	        return 1;
		}
		if (!strcmp(cmdtext,"/vehpopravi"))
		{
  			if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "Nisi u vozilu!");
     		RepairVehicle(GetPlayerVehicleID(playerid));
       		SendClientMessage(playerid, 0x33CCFFAA, "Popravio si vozilo!");
	        return 1;
		}
		if(!strcmp(cmdtext, "/kreirajv", true))
		{
  			if(!strcmp(cmdtext, "/kreirajv", true))
   			{
      			ShowPlayerDialog(playerid, vmenu, DIALOG_STYLE_LIST, "Spawn Vozila", "Sultan \nInfernus \nMaverick \nNRG-500", "Spawn", "Cancel");
	        	return 1;
	    	}
		}
		if (strcmp("/taxio", cmdtext, true, 10) == 0)
		{
			MoveObject(object,1269.91210938,-1842.36523438,15.17082977, 2.00);
			SetTimer("close", 7000, 0);//gate will be  closed for 7 seconds
  			SendClientMessage(playerid,0x33CCFFAA,"Kapija se otvara i za 7 sekundi ce biti automatski zatvorena.");
	    	return 1;}
		}
	return SendClientMessage(playerid, 0x999999AA, "WTF: Upisao si nepoznatu komandu.");
}
Did i put something wrong here or?

Is this correct-->
Код:
return SendClientMessage(playerid, 0x999999AA, "WTF: Upisao si nepoznatu komandu.");
Reply
#5

Yes i know that, but i think that is correct.
I don't know what is wrong in my OnPlayerCommandText ...

This commands works perfect yesterday, but today I add /taxio command and i probably messed up something.

I'm beginner so i'll be very grateful if you help me.

I think that something is wrong about return SendClientMessage but i don't know what.
Reply
#6

I don't know what instructions, i told you that this code looks to me ok, i mean with no errors or something like that.
But my commands won't work in game xD
Reply
#7

Ok i do that already, like the RULE say --> Whenever you use curly brackets, indent the next snippet by 1.

Didn't I?

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    {
        if(strcmp("/vehokreni", cmdtext, true) == 0)
        {
            new currentveh;
            new Float:angle;
            currentveh = GetPlayerVehicleID(playerid);
            GetVehicleZAngle(currentveh, angle);
            SetVehicleZAngle(currentveh, angle);
            SendClientMessage(playerid, 0x33CCFFAA, "Preokrenuo si vozilo.");
            return 1;
        }
       
        if (!strcmp(cmdtext,"/vehpopravi"))
        {
            if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "Nisi u vozilu!");
            RepairVehicle(GetPlayerVehicleID(playerid));
            SendClientMessage(playerid, 0x33CCFFAA, "Popravio si vozilo!");
            return 1;
        }
       
        if(!strcmp(cmdtext, "/kreirajv", true))
        {
            if(!strcmp(cmdtext, "/kreirajv", true))
            {
                ShowPlayerDialog(playerid, vmenu, DIALOG_STYLE_LIST, "Spawn Vozila", "Sultan \nInfernus \nMaverick \nNRG-500", "Spawn", "Cancel");
                return 1;
            }
        }
       
        if (strcmp("/taxio", cmdtext, true, 10) == 0)
        {
            MoveObject(object,1269.91210938,-1842.36523438,15.17082977, 2.00);
            SetTimer("close", 7000, 0);//gate will be  closed for 7 seconds
            SendClientMessage(playerid,0x33CCFFAA,"Kapija se otvara i za 7 sekundi ce biti automatski zatvorena.");
            return 1;}
        }
    return SendClientMessage(playerid, 0x999999AA, "WTF: Upisao si nepoznatu komandu.");
}
I read the instructions from Here--> https://sampforum.blast.hk/showthread.php?pid=1181561#pid1181561
Reply
#8

The standard tabsize of SAMP scripting is 4, while PAWN's is 8. I don't know what told you to indent the next part by 1 space (if thats what you meant.) IF you have problems indenting, just press TAB inside pawno when ready to indent, and it will insert four (4) spaces FOR YOU.
Reply
#9

I'm always use TAB for indenting. Do you mean something like this?

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    {
        if (strcmp("/vehokreni", cmdtext, true) == 0)
        {
                new currentveh;
                new Float:angle;
                currentveh = GetPlayerVehicleID(playerid);
                GetVehicleZAngle(currentveh, angle);
                SetVehicleZAngle(currentveh, angle);
                SendClientMessage(playerid, 0x33CCFFAA, "Preokrenuo si vozilo.");
                return 1;
        }
       
        if (!strcmp(cmdtext,"/vehpopravi"))
        {
                if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "Nisi u vozilu!");
                RepairVehicle(GetPlayerVehicleID(playerid));
                SendClientMessage(playerid, 0x33CCFFAA, "Popravio si vozilo!");
                return 1;
        }
       
        if(!strcmp(cmdtext, "/kreirajv", true))
        {
                if(!strcmp(cmdtext, "/kreirajv", true))
                    {
                        ShowPlayerDialog(playerid, vmenu, DIALOG_STYLE_LIST, "Spawn Vozila", "Sultan \nInfernus \nMaverick \nNRG-500", "Spawn", "Cancel");
                        return 1;
                    }
        }
       
        if (strcmp("/taxio", cmdtext, true, 10) == 0)
        {
                MoveObject(object,1269.91210938,-1842.36523438,15.17082977, 2.00);
                SetTimer("close", 7000, 0);//gate will be  closed for 7 seconds
                SendClientMessage(playerid,0x33CCFFAA,"Kapija se otvara i za 7 sekundi ce biti automatski zatvorena.");
                return 1;}
        }
    return SendClientMessage(playerid, 0x999999AA, "WTF: Upisao si nepoznatu komandu.");
}
I indent 8 spaces.. i just want my commands back, nothing else

And if you can tell me , did I do something wrong in the return SendClientMessage?
Or did I put some curly bracket wrong?
Reply
#10

Quote:
Originally Posted by ApachE
Посмотреть сообщение
I'm always use TAB for indenting. Do you mean something like this?

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    {
        if (strcmp("/vehokreni", cmdtext, true) == 0)
        {
                new currentveh;
                new Float:angle;
                currentveh = GetPlayerVehicleID(playerid);
                GetVehicleZAngle(currentveh, angle);
                SetVehicleZAngle(currentveh, angle);
                SendClientMessage(playerid, 0x33CCFFAA, "Preokrenuo si vozilo.");
                return 1;
        }
       
        if (!strcmp(cmdtext,"/vehpopravi"))
        {
                if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "Nisi u vozilu!");
                RepairVehicle(GetPlayerVehicleID(playerid));
                SendClientMessage(playerid, 0x33CCFFAA, "Popravio si vozilo!");
                return 1;
        }
       
        if(!strcmp(cmdtext, "/kreirajv", true))
        {
                if(!strcmp(cmdtext, "/kreirajv", true))
                    {
                        ShowPlayerDialog(playerid, vmenu, DIALOG_STYLE_LIST, "Spawn Vozila", "Sultan \nInfernus \nMaverick \nNRG-500", "Spawn", "Cancel");
                        return 1;
                    }
        }
       
        if (strcmp("/taxio", cmdtext, true, 10) == 0)
        {
                MoveObject(object,1269.91210938,-1842.36523438,15.17082977, 2.00);
                SetTimer("close", 7000, 0);//gate will be  closed for 7 seconds
                SendClientMessage(playerid,0x33CCFFAA,"Kapija se otvara i za 7 sekundi ce biti automatski zatvorena.");
                return 1;}
        }
    return SendClientMessage(playerid, 0x999999AA, "WTF: Upisao si nepoznatu komandu.");
}
I indent 8 spaces.. i just want my commands back, nothing else

And if you can tell me , did I do something wrong in the return SendClientMessage?
Or did I put some curly bracket wrong?
Indenting 8 spaces without using #pragma tabsize 8 will get you errors.

This forum requires that you wait 120 seconds between posts. Please try again in 31 seconds.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)