ever since i added one piece of code it starts generating errors on me
#1

as the title says ill just get right to it i made a car like the bond car script but my dialog is returning errors and its just so fucked up saying its not in a switch and it is and everything here is the dialog code for when i enter the car:
Код:
public OnPlayerEnterVehicle (playerid, vehicleid)
{
  	if(vehicleid == Delorian[0])
	{
		ShowPlayerDialog(playerid, 9, DIALOG_STYLE_MSGBOX,"Welcome to the Delorian Class Time car", "Welcome to the delorian class time car press ok if you want to initate the Virtual World time travel", "OK", "Cancel");
	}
	if(vehicleid == Delorian[1])
	{
		ShowPlayerDialog(playerid, 11, DIALOG_STYLE_MSGBOX,"Welcome to the Delorian Class Time car", "Welcome to the delorian class time car press ok if you want to initate the Virtual World time travel", "OK", "Cancel");
	}
	if(vehicleid == Special_Car)
	{
	    ShowPlayerDialog(playerid, 13, DIALOG_STYLE_LIST,"Current Car Options(more comin soon)", "Open Boot \n Close Boot \n Change Car Model(stealth) \n Cloak \n Self Destruct", "Select", " ");
	}
}
the bit i highlighted in red is the car code and here is the ondialogresponce area:

Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(response)// They pressed the first button.
    {
        switch(dialogid)// If you only have one dialog, then this isn't required, but it's neater for when you implement more dialogs.
        {
            case 5:// Our dialog!
            {
                switch(listitem)// Checking which listitem was selected
                {
                    case 0:// The first item listed
                    {
                        GetPlayerPos(playerid, X,Y,Z);
                        Shamal = CreateVehicle(519, X,Y,Z,90,0,0,120);
                        PutPlayerInVehicle(playerid, Shamal, 0);
                        TogglePlayerControllable(playerid, 1);
                    }
                    case 1:
                    {
                        GetPlayerPos(playerid, X,Y,Z);
                        Dodo = CreateVehicle(593, X,Y,Z,90,0,0,120);
                        PutPlayerInVehicle(playerid, Dodo, 0);
                        TogglePlayerControllable(playerid, 1);
                    }
                    case 2:
                    {
                        GetPlayerPos(playerid, X,Y,Z);
                        Sultan = CreateVehicle(560, X,Y,Z,90,184,184,120);
                        SetVehicleNumberPlate(Sultan, "ACar");
                        PutPlayerInVehicle(playerid, Sultan, 0);
                        TogglePlayerControllable(playerid, 1);
                    }
                    case 3:
                    {
                        GetPlayerPos(playerid, X,Y,Z);
                        Infernus = CreateVehicle(411, X,Y,Z,90,1,1,120);
                        SetVehicleNumberPlate(Infernus, "ACar");
                        PutPlayerInVehicle(playerid, Infernus, 0);
                        TogglePlayerControllable(playerid, 1);
                    }
                }
            }

            case 6:
            {
                if(!response) return Kick(playerid);
				{
					new pName[MAX_PLAYER_NAME]; // Saying pName is the Players Name!
	            	new string[128]; // Creating the string.
	            	GetPlayerName(playerid,pName,MAX_PLAYER_NAME); // tells the pName to get the players name!
	            	format(string, sizeof(string), "%s has Agreed To Our Rules",pName); // This is what will send to everyone!
	          		SendClientMessageToAll(COLOR_GRAD2, string);
	          	}
            }

            case 7:
            {
                switch(listitem)// Checking which listitem was selected
                {
                    case 0:
                    {
                        SetWorldTime(7);
                    }
                    case 1:
                    {
                        SetWorldTime(12);
                    }
                    case 2:
                    {
                        SetWorldTime(19);
                    }
                    case 3:
                    {
                        SetWorldTime(0);
                    }
                }
            }
            case 8:
            {
                switch(listitem)
                {
                    case 0:
                    {
                        MoveDynamicObject(Elevator, 1217.87, 493.98, 25.74, 5.0);
					}
					case 1:
					{
					    MoveDynamicObject(Elevator, 1217.85, 493.97, 28.84, 5.0);
					}
					case 2:
					{
					    MoveDynamicObject(Elevator, 1217.85, 493.97, 32.75, 5.0);
					}
				}
			}
			case 9:
			{
			    ShowPlayerDialog(playerid, 10, DIALOG_STYLE_LIST, "Which Virtual World Do you want to travel to?", "The Unknown Alien Universe(Can Travel but its a WIP)(Well its not started :D) \n DM world", "Begin the transition", "Cancel");
			}
			case 10:
			{
				switch(listitem)
				{
				    case 0:
					{
					    SendClientMessage(playerid, Yellow, "Initiating Virtual World Time travel, Please Retype /start_curcits when ur in the world this is a automated message");
					    SetVehicleVirtualWorld(Delorian[0], 1);
					    SetPlayerVirtualWorld(playerid, 1);
					}
					case 1:
					{
					    SendClientMessage(playerid, Yellow, "Initiating Virtual World Time travel");
					    SetVehicleVirtualWorld(Delorian[0], 2);
					    SetPlayerVirtualWorld(playerid, 2);
					}
				}
			}
			case 11:
			{
			    ShowPlayerDialog(playerid, 12, DIALOG_STYLE_LIST, "Which Virtual World Do you want to travel to?", "The Unknown Alien Universe(Can Travel but its a WIP) \n DM world \n Home", "Begin the transition", "Cancel");
			}
			case 12:
			{
				switch(listitem)
				{
				    case 0:
					{
					    SendClientMessage(playerid, Yellow, "Initiating Virtual World Time travel, Please Retype /start_curcits when ur in the world this is a automated message");
					    SetVehicleVirtualWorld(Delorian[1], 1);
					    SetPlayerVirtualWorld(playerid, 1);
					}
					case 1:
					{
					    SendClientMessage(playerid, Yellow, "Initiating Virtual World Time travel, Please Retype /start_curcits when ur in the world this is a automated message");
					    SetVehicleVirtualWorld(Delorian[1], 2);
					    SetPlayerVirtualWorld(playerid, 2);
					}
					case 2:
					{
					    SendClientMessage(playerid, Yellow, "Initiating Virtual World Time travel, Please Retype /start_curcits when ur in the world this is a automated message");
					    SetVehicleVirtualWorld(Delorian[1], 0);
					    SetPlayerVirtualWorld(playerid, 0);
					    }
					}
				}
			}
	                case 13:
			{
			   	switch(listitem)
				{
			    	        case 0:
			    	        {
					        new engine, lights, alarm, doors, bonnet, boot, objective;
					        GetVehicleParamsEx(Special_Car, engine, lights, alarm, doors, bonnet, boot, objective);
			    		        SetVehicleParamsEx(Special_Car, engine, lights, alarm, doors, bonnet, 1, objective);
			    		        SendClientMessage(playerid, Yellow, "Boot Open");
			    	        }
				}
			}
    	      }
    }
    return 0;
}
well after i added the highlighted code(s) these errors sprung up:
Код:
C:\DOCUME~1\Rhys\Desktop\SA8BEC~1\GAMEMO~1\bare.pwn(2883) : error 014: invalid statement; not in switch
C:\DOCUME~1\Rhys\Desktop\SA8BEC~1\GAMEMO~1\bare.pwn(2883) : warning 215: expression has no effect
C:\DOCUME~1\Rhys\Desktop\SA8BEC~1\GAMEMO~1\bare.pwn(2883) : error 001: expected token: ";", but found ":"
C:\DOCUME~1\Rhys\Desktop\SA8BEC~1\GAMEMO~1\bare.pwn(2883) : error 029: invalid expression, assumed zero
C:\DOCUME~1\Rhys\Desktop\SA8BEC~1\GAMEMO~1\bare.pwn(2883) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Line 2883 is
Код:
case 13:
i dont know whats wrong can u help me plz its just popped up
Reply
#2

You messed up some brackets.
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(response)// They pressed the first button.
    {
        switch(dialogid)// If you only have one dialog, then this isn't required, but it's neater for when you implement more dialogs.
        {
            case 5:// Our dialog!
            {
                switch(listitem)// Checking which listitem was selected
                {
                    case 0:// The first item listed
                    {
                        GetPlayerPos(playerid, X,Y,Z);
                        Shamal = CreateVehicle(519, X,Y,Z,90,0,0,120);
                        PutPlayerInVehicle(playerid, Shamal, 0);
                        TogglePlayerControllable(playerid, 1);
                    }
                    case 1:
                    {
                        GetPlayerPos(playerid, X,Y,Z);
                        Dodo = CreateVehicle(593, X,Y,Z,90,0,0,120);
                        PutPlayerInVehicle(playerid, Dodo, 0);
                        TogglePlayerControllable(playerid, 1);
                    }
                    case 2:
                    {
                        GetPlayerPos(playerid, X,Y,Z);
                        Sultan = CreateVehicle(560, X,Y,Z,90,184,184,120);
                        SetVehicleNumberPlate(Sultan, "ACar");
                        PutPlayerInVehicle(playerid, Sultan, 0);
                        TogglePlayerControllable(playerid, 1);
                    }
                    case 3:
                    {
                        GetPlayerPos(playerid, X,Y,Z);
                        Infernus = CreateVehicle(411, X,Y,Z,90,1,1,120);
                        SetVehicleNumberPlate(Infernus, "ACar");
                        PutPlayerInVehicle(playerid, Infernus, 0);
                        TogglePlayerControllable(playerid, 1);
                    }
                }
            }
            case 6:
            {
                if(!response) return Kick(playerid);
                {
                    new pName[MAX_PLAYER_NAME]; // Saying pName is the Players Name!
                    new string[128]; // Creating the string.
                    GetPlayerName(playerid,pName,MAX_PLAYER_NAME); // tells the pName to get the players name!
                    format(string, sizeof(string), "%s has Agreed To Our Rules",pName); // This is what will send to everyone!
                    SendClientMessageToAll(COLOR_GRAD2, string);
                }
            }
            case 7:
            {
                switch(listitem)// Checking which listitem was selected
                {
                    case 0:
                    {
                        SetWorldTime(7);
                    }
                    case 1:
                    {
                        SetWorldTime(12);
                    }
                    case 2:
                    {
                        SetWorldTime(19);
                    }
                    case 3:
                    {
                        SetWorldTime(0);
                    }
                }
            }
            case 8:
            {
                switch(listitem)
                {
                    case 0:
                    {
                        MoveDynamicObject(Elevator, 1217.87, 493.98, 25.74, 5.0);
                    }
                    case 1:
                    {
                        MoveDynamicObject(Elevator, 1217.85, 493.97, 28.84, 5.0);
                    }
                    case 2:
                    {
                        MoveDynamicObject(Elevator, 1217.85, 493.97, 32.75, 5.0);
                    }
                }
            }
            case 9:
            {
                ShowPlayerDialog(playerid, 10, DIALOG_STYLE_LIST, "Which Virtual World Do you want to travel to?", "The Unknown Alien Universe(Can Travel but its a WIP)(Well its not started :D) \n DM world", "Begin the transition", "Cancel");
            }
            case 10:
            {
                switch(listitem)
                {
                    case 0:
                    {
                        SendClientMessage(playerid, Yellow, "Initiating Virtual World Time travel, Please Retype /start_curcits when ur in the world this is a automated message");
                        SetVehicleVirtualWorld(Delorian[0], 1);
                        SetPlayerVirtualWorld(playerid, 1);
                    }
                    case 1:
                    {
                        SendClientMessage(playerid, Yellow, "Initiating Virtual World Time travel");
                        SetVehicleVirtualWorld(Delorian[0], 2);
                        SetPlayerVirtualWorld(playerid, 2);
                    }
                }
            }
            case 11:
            {
                ShowPlayerDialog(playerid, 12, DIALOG_STYLE_LIST, "Which Virtual World Do you want to travel to?", "The Unknown Alien Universe(Can Travel but its a WIP) \n DM world \n Home", "Begin the transition", "Cancel");
            }
            case 12:
            {
                switch(listitem)
                {
                    case 0:
                    {
                        SendClientMessage(playerid, Yellow, "Initiating Virtual World Time travel, Please Retype /start_curcits when ur in the world this is a automated message");
                        SetVehicleVirtualWorld(Delorian[1], 1);
                        SetPlayerVirtualWorld(playerid, 1);
                    }
                    case 1:
                    {
                        SendClientMessage(playerid, Yellow, "Initiating Virtual World Time travel, Please Retype /start_curcits when ur in the world this is a automated message");
                        SetVehicleVirtualWorld(Delorian[1], 2);
                        SetPlayerVirtualWorld(playerid, 2);
                    }
                    case 2:
                    {
                        SendClientMessage(playerid, Yellow, "Initiating Virtual World Time travel, Please Retype /start_curcits when ur in the world this is a automated message");
                        SetVehicleVirtualWorld(Delorian[1], 0);
                        SetPlayerVirtualWorld(playerid, 0);
                    }
                }
            }
            case 13:
            {
                switch(listitem)
                {
                    case 0:
                    {
                        new engine, lights, alarm, doors, bonnet, boot, objective;
                        GetVehicleParamsEx(Special_Car, engine, lights, alarm, doors, bonnet, boot, objective);
                        SetVehicleParamsEx(Special_Car, engine, lights, alarm, doors, bonnet, 1, objective);
                        SendClientMessage(playerid, Yellow, "Boot Open");
                    }
                }
            }
        }
    }
    return 0;
}
Reply
#3

Well, just let me say it this way.

http://dracoblue.net/tidy/pawn/ <------------ Indent for you when you have "Loose indentation".


https://sampforum.blast.hk/showthread.php?tid=171429 <--------------------- Bracket Finder.
Reply
#4

the indentations are purley because of the tags in my script the indentation is fine lol anyway its fixed
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)