How To Do This? [Help]
#1

How To Continue The Dialog Response?
pawn Код:
switch(dialogid)
   {
   case 111:
   {
    if(!response) return SendClientMessage(playerid, COLOR_RED,"You have Closed The Teleport Dialog");
      {
       switch(listitem)
       {
       case 0:ShowPlayerDialog(playerid, 222, DIALOG_STYLE_LIST,"Base Jumps","Base Jump 1\nBase Jump 2\nBase Jump 3\nBase Jump 4\nBase Jump 5","Teleport","Close");
       case 1:ShowPlayerDialog(playerid, 333, DIALOG_STYLE_LIST,"Stunts","MiniStunt\nLas Venturas Stunt\nLos Santos Stunts\nCrazy Loop\nParkourMaddness\nMiniRollerCoster\nMount Chiliad Stunts\nMullholand\nPershing Square\nBay Side","Teleport","Close");
       case 2:ShowPlayerDialog(playerid, 444, DIALOG_STYLE_LIST,"HotSpots","Saint Maria Beach\nGroveStreet\nSaint Marks\nUnity Stations\nMaddogs Mansion","Teleport","Close");
       case 3:ShowPlayerDialog(playerid, 555, DIALOG_STYLE_LIST,"Cities","Los Santos\nLas Venturas\nSan Fierro","Teleport","Close");
       case 4:ShowPlayerDialog(playerid, 666, DIALOG_STYLE_LIST,"Crazy Roads","Crazy Loop\nDisco Road\nCrazy Glass Road\nLong Drive","Teleport","Close");
       case 5:ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST,"Interiors","Saint Marks\nCity Hall\nBank\nHospital\nLVPD\nLSPD\nSFPD","Teleport","Close");
       case 6:ShowPlayerDialog(playerid, 888, DIALOG_STYLE_LIST,"Derby","Las Venturas Derby\nLos Santos Derby\nQuarry Derby\nSan Fierro Derby","Teleport","Close");
       case 7:ShowPlayerDialog(playerid, 999, DIALOG_STYLE_LIST,"Drift","Las Venturas Drift\nDrift\nSan Fierro Drift\nLos Santos Drift","Teleport","Close");
       }
   switch(dialogid)
   {
   case 222:
   {
   if(!response) return SendClientMessage(playerid, COLOR_RED,"You have Closed Teleport Dialog");
    {
    switch(listitem)
    {
     case 0:
     {
if(IsPlayerInDM[playerid] == 0)
{
new str1[128], player2[MAX_PLAYER_NAME];
GetPlayerName(playerid, player2, sizeof(player2));
format(str1,sizeof(str1),"%s has been teleported to Base Jump 1(/bj1)",player2);
SendClientMessageToAll(COLOR_LIGHTCOLOR_BLUE,str1);
SetPlayerPos(playerid, 1666.7014,-1218.3112,233.3750);
SetPlayerInterior(playerid, 0);
SendClientMessage(playerid, COLOR_YELLOW, "Welcome to BaseJump 1");
GivePlayerWeapon(playerid, 46, 1);
}
else return SendClientMessage(playerid, COLOR_RED,"Use /exitdm before you Teleport!");
return 1;
}
}
}
return 0;
}
This Gives me Error
Can Someone Help me?
The Error Is:
Код:
E:\server0\gamemodes\gm4.pwn(6674) : error 002: only a single statement (or expression) can follow each "case"
Reply
#2

Your missing one bracket "}"
Reply
#3

Where? at end?
Reply
#4

You have 10 opening brackets( { ) and only 6 closing brackets ( } )...I can't find where though.. Because your script is soooo confusing without the indents.
Reply
#5

First listen What i want..
I made this Code
pawn Код:
switch(dialogid)
   {
   case 111:
   {
    if(!response) return SendClientMessage(playerid, COLOR_RED,"You have Closed The Teleport Dialog");
      {
       switch(listitem)
       {
       case 0:ShowPlayerDialog(playerid, 222, DIALOG_STYLE_LIST,"Base Jumps","Base Jump 1\nBase Jump 2\nBase Jump 3\nBase Jump 4\nBase Jump 5","Teleport","Close");
       case 1:ShowPlayerDialog(playerid, 333, DIALOG_STYLE_LIST,"Stunts","MiniStunt\nLas Venturas Stunt\nLos Santos Stunts\nCrazy Loop\nParkourMaddness\nMiniRollerCoster\nMount Chiliad Stunts\nMullholand\nPershing Square\nBay Side","Teleport","Close");
       case 2:ShowPlayerDialog(playerid, 444, DIALOG_STYLE_LIST,"HotSpots","Saint Maria Beach\nGroveStreet\nSaint Marks\nUnity Stations\nMaddogs Mansion","Teleport","Close");
       case 3:ShowPlayerDialog(playerid, 555, DIALOG_STYLE_LIST,"Cities","Los Santos\nLas Venturas\nSan Fierro","Teleport","Close");
       case 4:ShowPlayerDialog(playerid, 666, DIALOG_STYLE_LIST,"Crazy Roads","Crazy Loop\nDisco Road\nCrazy Glass Road\nLong Drive","Teleport","Close");
       case 5:ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST,"Interiors","Saint Marks\nCity Hall\nBank\nHospital\nLVPD\nLSPD\nSFPD","Teleport","Close");
       case 6:ShowPlayerDialog(playerid, 888, DIALOG_STYLE_LIST,"Derby","Las Venturas Derby\nLos Santos Derby\nQuarry Derby\nSan Fierro Derby","Teleport","Close");
       case 7:ShowPlayerDialog(playerid, 999, DIALOG_STYLE_LIST,"Drift","Las Venturas Drift\nDrift\nSan Fierro Drift\nLos Santos Drift","Teleport","Close");
       }
     }
  }
}
return 0;
}
so i created with switch(dialogid) etc. etc.
and Unable to make Another Dialog
like i made One Dialog Which is Working Properly (the first script)
and now i want Add Teleports.. i mean If Player Click "Base Jump" he gets Teleported To Base Jump with Some Msgs.. The Code is
pawn Код:
{
if(IsPlayerInDM[playerid] == 0)
{
new str1[128], player2[MAX_PLAYER_NAME];
GetPlayerName(playerid, player2, sizeof(player2));
format(str1,sizeof(str1),"%s has been teleported to Base Jump 1(/bj1)",player2);
SendClientMessageToAll(COLOR_LIGHTCOLOR_BLUE,str1);
SetPlayerPos(playerid, 1666.7014,-1218.3112,233.3750);
SetPlayerInterior(playerid, 0);
SendClientMessage(playerid, COLOR_YELLOW, "Welcome to BaseJump 1");
GivePlayerWeapon(playerid, 46, 1);
}
else return SendClientMessage(playerid, COLOR_RED,"Use /exitdm before you Teleport!");
return 1;
}
Please Help Please.
Reply
#6

pawn Код:
switch(dialogid)
{
   case 111:
   {
        if(!response) return SendClientMessage(playerid, COLOR_RED,"You have Closed The Teleport Dialog");
        {
            switch(listitem)
            {
                case 0:ShowPlayerDialog(playerid, 222, DIALOG_STYLE_LIST,"Base Jumps","Base Jump 1\nBase Jump 2\nBase Jump 3\nBase Jump 4\nBase Jump 5","Teleport","Close");
                case 1:ShowPlayerDialog(playerid, 333, DIALOG_STYLE_LIST,"Stunts","MiniStunt\nLas Venturas Stunt\nLos Santos Stunts\nCrazy Loop\nParkourMaddness\nMiniRollerCoster\nMount Chiliad Stunts\nMullholand\nPershing Square\nBay Side","Teleport","Close");
                case 2:ShowPlayerDialog(playerid, 444, DIALOG_STYLE_LIST,"HotSpots","Saint Maria Beach\nGroveStreet\nSaint Marks\nUnity Stations\nMaddogs Mansion","Teleport","Close");
                case 3:ShowPlayerDialog(playerid, 555, DIALOG_STYLE_LIST,"Cities","Los Santos\nLas Venturas\nSan Fierro","Teleport","Close");
                case 4:ShowPlayerDialog(playerid, 666, DIALOG_STYLE_LIST,"Crazy Roads","Crazy Loop\nDisco Road\nCrazy Glass Road\nLong Drive","Teleport","Close");
                case 5:ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST,"Interiors","Saint Marks\nCity Hall\nBank\nHospital\nLVPD\nLSPD\nSFPD","Teleport","Close");
                case 6:ShowPlayerDialog(playerid, 888, DIALOG_STYLE_LIST,"Derby","Las Venturas Derby\nLos Santos Derby\nQuarry Derby\nSan Fierro Derby","Teleport","Close");
                case 7:ShowPlayerDialog(playerid, 999, DIALOG_STYLE_LIST,"Drift","Las Venturas Drift\nDrift\nSan Fierro Drift\nLos Santos Drift","Teleport","Close");
            }
            switch(dialogid)
    {
    case 222:
    {
        if(!response) return SendClientMessage(playerid, COLOR_RED,"You have Closed Teleport Dialog");
        {
            switch(listitem)
            {
                case 0:
                {
                    if(IsPlayerInDM[playerid] == 0)
                    {
                        new str1[128], player2[MAX_PLAYER_NAME];
                        GetPlayerName(playerid, player2, sizeof(player2));
                        format(str1,sizeof(str1),"%s has been teleported to Base Jump 1(/bj1)",player2);
                        SendClientMessageToAll(COLOR_LIGHTCOLOR_BLUE,str1);
                        SetPlayerPos(playerid, 1666.7014,-1218.3112,233.3750);
                        SetPlayerInterior(playerid, 0);
                        SendClientMessage(playerid, COLOR_YELLOW, "Welcome to BaseJump 1");
                        GivePlayerWeapon(playerid, 46, 1);
                    }
                    else return SendClientMessage(playerid, COLOR_RED,"Use /exitdm before you Teleport!");
                    return 1;
                }
            }
        }
        return 0;
    }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)