if ( response )
{
switch ( dialogid )
{
case DIALOG_MENU :
{
switch ( listitem )
{
case 0 : ShowPlayerDialog(playerid,DIALOG_PMENU,DIALOG_STYLE_LIST,"Player Menu","PM \n God \n Sit \n","Select"," Back");
case 1 : ShowPlayerDialog(playerid,DIALOG_TMENU,DIALOG_STYLE_LIST,"Teleport Menu","Stunts \nRace\nFun","Select","Back");
case 2 : ShowPlayerDialog(playerid,DIALOG_WMENU,DIALOG_STYLE_LIST,"Weapon Menu","Melee \nRange \nShoutguns","Select"," Back");
case 3 : ShowPlayerDialog(playerid,DIALOG_VMENU,DIALOG_STYLE_LIST,"Vehicle Menu","LowRiders\nPimp\nRacer Car","Select"," Back");
case 4 : ShowPlayerDialog(playerid,DIALOG_AMENU,DIALOG_STYLE_LIST,"Animation Menu","Sit \nSleep \nDrunk \nTalk","Select"," Back");
case 5 : new str[700];
strcat(str, ""YELLOW"/cgang "WHITE"- Creates a gang \n");
strcat(str, ""YELLOW"/ginvite "WHITE"- Invite a member to your gang \n");
strcat(str, ""YELLOW"/jgang "WHITE"- Accept a clan invitation request \n");
strcat(str, ""YELLOW"/dgang "WHITE"- Deny a clan invitation request \n");
strcat(str, ""YELLOW"/gsetrank "WHITE"- Set a clan member's rank/position \n");
strcat(str, ""YELLOW"/granks "WHITE"- View the list of member ranks \n");
strcat(str, ""YELLOW"/gmembers "WHITE"- View your online gang members \n");
strcat(str, ""YELLOW"/g "WHITE"- Talk in the gang chat \n");
strcat(str, ""YELLOW"/gclose "WHITE"- Disband a gang \n");
ShowPlayerDialog(playerid, DIALOG_CLAN_CMDS, DIALOG_STYLE_LIST, ""GOLD"Gang Menu", str, "Select", "Back");
case 6 : ShowPlayerDialog(playerid,DIALOG_OMENU,DIALOG_STYLE_LIST,"Object Menu","Hat\nShoes \nBody","Select"," Back");
}
}
|
(3473) : error 003: declaration of a local variable must appear in a compound block (3473) : error 029: invalid expression, assumed zero (3473) : warning 215: expression has no effect (3473) : error 001: expected token: ";", but found "]" (3473) : fatal error 107: too many error messages on one line |
|
LINE 3473> case 5 : new str[700]; |
case 5 : {
new str[700];
strcat(str, ""YELLOW"/cgang "WHITE"- Creates a gang \n");
strcat(str, ""YELLOW"/ginvite "WHITE"- Invite a member to your gang \n");
strcat(str, ""YELLOW"/jgang "WHITE"- Accept a clan invitation request \n");
strcat(str, ""YELLOW"/dgang "WHITE"- Deny a clan invitation request \n");
strcat(str, ""YELLOW"/gsetrank "WHITE"- Set a clan member's rank/position \n");
strcat(str, ""YELLOW"/granks "WHITE"- View the list of member ranks \n");
strcat(str, ""YELLOW"/gmembers "WHITE"- View your online gang members \n");
strcat(str, ""YELLOW"/g "WHITE"- Talk in the gang chat \n");
strcat(str, ""YELLOW"/gclose "WHITE"- Disband a gang \n");
ShowPlayerDialog(playerid, DIALOG_CLAN_CMDS, DIALOG_STYLE_LIST, ""GOLD"Gang Menu", str, "Select", "Back");
}
|
Well, the error makes sense. If you want more than 1 line in your case, use compound block in brackets:
pawn Код:
|
if ( response )
{
switch ( dialogid )
{
case DIALOG_MENU :
{
switch ( listitem )
{
case 0 : ShowPlayerDialog(playerid,DIALOG_PMENU,DIALOG_STYLE_LIST,"Player Menu","PM \n God \n Sit \n","Select"," Back");
case 1 : ShowPlayerDialog(playerid,DIALOG_TMENU,DIALOG_STYLE_LIST,"Teleport Menu","Stunts \nRace\nFun","Select","Back");
case 2 : ShowPlayerDialog(playerid,DIALOG_WMENU,DIALOG_STYLE_LIST,"Weapon Menu","Melee \nRange \nShoutguns","Select"," Back");
case 3 : ShowPlayerDialog(playerid,DIALOG_VMENU,DIALOG_STYLE_LIST,"Vehicle Menu","LowRiders\nPimp\nRacer Car","Select"," Back");
case 4 : ShowPlayerDialog(playerid,DIALOG_AMENU,DIALOG_STYLE_LIST,"Animation Menu","Sit \nSleep \nDrunk \nTalk","Select"," Back");
case 5 : {
new str[700];
strcat(str, ""YELLOW"/cgang "WHITE"- Creates a gang \n");
strcat(str, ""YELLOW"/ginvite "WHITE"- Invite a member to your gang \n");
strcat(str, ""YELLOW"/jgang "WHITE"- Accept a clan invitation request \n");
strcat(str, ""YELLOW"/dgang "WHITE"- Deny a clan invitation request \n");
strcat(str, ""YELLOW"/gsetrank "WHITE"- Set a clan member's rank/position \n");
strcat(str, ""YELLOW"/granks "WHITE"- View the list of member ranks \n");
strcat(str, ""YELLOW"/gmembers "WHITE"- View your online gang members \n");
strcat(str, ""YELLOW"/g "WHITE"- Talk in the gang chat \n");
strcat(str, ""YELLOW"/gclose "WHITE"- Disband a gang \n");
ShowPlayerDialog(playerid, DIALOG_CLAN_CMDS, DIALOG_STYLE_LIST, ""GOLD"Gang Menu", str, "Select", "Back");
return 1;
}
case 6 : ShowPlayerDialog(playerid,DIALOG_OMENU,DIALOG_STYLE_LIST,"Object Menu","Hat\nShoes \nBody","Select"," Back");
}
}
case DIALOG_CLAN_CMDS :
{
if(response)
{
}
else
{
new str[700];
strcat(str, ""YELLOW"Player Menu "WHITE"- View the list of Player commands \n");
strcat(str, ""YELLOW"Teleport Menu "WHITE"- View the list of Teleport commands \n");
strcat(str, ""YELLOW"Weapon Menu "WHITE"- View the list of Weapon commands \n");
strcat(str, ""YELLOW"Vehicle Menu "WHITE"- View the list of Vehicle commands \n");
strcat(str, ""YELLOW"Animation Menu "WHITE"- View the list of Gang commands \n");
strcat(str, ""YELLOW"Gang Menu "WHITE"- View the list of Animation commands \n");
strcat(str, ""YELLOW"Object Menu "WHITE"- View the list of Attach Object commands \n");
ShowPlayerDialog(playerid, DIALOG_MENU, DIALOG_STYLE_LIST, ""GOLD"Main Commands", str, "Select", "Close");
return 1;
}
}
}
}
case DIALOG_CLAN_CMDS :
{
if(response)
{
}
else
{
new str[700];
strcat(str, ""YELLOW"Player Menu "WHITE"- View the list of Player commands \n");
strcat(str, ""YELLOW"Teleport Menu "WHITE"- View the list of Teleport commands \n");
strcat(str, ""YELLOW"Weapon Menu "WHITE"- View the list of Weapon commands \n");
strcat(str, ""YELLOW"Vehicle Menu "WHITE"- View the list of Vehicle commands \n");
strcat(str, ""YELLOW"Animation Menu "WHITE"- View the list of Gang commands \n");
strcat(str, ""YELLOW"Gang Menu "WHITE"- View the list of Animation commands \n");
strcat(str, ""YELLOW"Object Menu "WHITE"- View the list of Attach Object commands \n");
ShowPlayerDialog(playerid, DIALOG_MENU, DIALOG_STYLE_LIST, ""GOLD"Main Commands", str, "Select", "Close");
return 1;
if(!response)
if (response) {
}
else {
|
Hm, not certain. Could you show whole OnDialogResponse?
Also, you can use: pawn Код:
pawn Код:
|
if ( response )
{
switch ( dialogid )
{
case DIALOG_MENU :
{
case DIALOG_MENU :
{
|
pawn Код:
pawn Код:
|
switch ( dialogid )
{
case DIALOG_MENU :
{
if (!response) return 1;
switch ( listitem )
{
case 0 : ShowPlayerDialog(playerid,DIALOG_PMENU,DIALOG_STYLE_LIST,"Player Menu","PM \n God \n Sit \n","Select"," Back");
case 1 : ShowPlayerDialog(playerid,DIALOG_TMENU,DIALOG_STYLE_LIST,"Teleport Menu","Stunts \nRace\nFun","Select","Back");
case 2 : ShowPlayerDialog(playerid,DIALOG_WMENU,DIALOG_STYLE_LIST,"Weapon Menu","Melee \nRange \nShoutguns","Select"," Back");
case 3 : ShowPlayerDialog(playerid,DIALOG_VMENU,DIALOG_STYLE_LIST,"Vehicle Menu","LowRiders\nPimp\nRacer Car","Select"," Back");
case 4 : ShowPlayerDialog(playerid,DIALOG_AMENU,DIALOG_STYLE_LIST,"Animation Menu","Sit \nSleep \nDrunk \nTalk","Select"," Back");
case 5 : {
new str[700];
strcat(str, ""YELLOW"/cgang "WHITE"- Creates a gang \n");
strcat(str, ""YELLOW"/ginvite "WHITE"- Invite a member to your gang \n");
strcat(str, ""YELLOW"/jgang "WHITE"- Accept a clan invitation request \n");
strcat(str, ""YELLOW"/dgang "WHITE"- Deny a clan invitation request \n");
strcat(str, ""YELLOW"/gsetrank "WHITE"- Set a clan member's rank/position \n");
strcat(str, ""YELLOW"/granks "WHITE"- View the list of member ranks \n");
strcat(str, ""YELLOW"/gmembers "WHITE"- View your online gang members \n");
strcat(str, ""YELLOW"/g "WHITE"- Talk in the gang chat \n");
strcat(str, ""YELLOW"/gclose "WHITE"- Disband a gang \n");
ShowPlayerDialog(playerid, DIALOG_CLAN_CMDS, DIALOG_STYLE_LIST, ""GOLD"Gang Menu", str, "Select", "Back");
return 1;
}
case 6 : ShowPlayerDialog(playerid,DIALOG_OMENU,DIALOG_STYLE_LIST,"Object Menu","Hat\nShoes \nBody","Select"," Back");
}
}
case DIALOG_CLAN_CMDS :
{
if(!response)
{
new str[700];
strcat(str, ""YELLOW"Player Menu "WHITE"- View the list of Player commands \n");
strcat(str, ""YELLOW"Teleport Menu "WHITE"- View the list of Teleport commands \n");
strcat(str, ""YELLOW"Weapon Menu "WHITE"- View the list of Weapon commands \n");
strcat(str, ""YELLOW"Vehicle Menu "WHITE"- View the list of Vehicle commands \n");
strcat(str, ""YELLOW"Animation Menu "WHITE"- View the list of Gang commands \n");
strcat(str, ""YELLOW"Gang Menu "WHITE"- View the list of Animation commands \n");
strcat(str, ""YELLOW"Object Menu "WHITE"- View the list of Attach Object commands \n");
ShowPlayerDialog(playerid, DIALOG_MENU, DIALOG_STYLE_LIST, ""GOLD"Main Commands", str, "Select", "Close");
return 1;
}
}
}
//
if(dialogid == DIALOG_MENU)
{
if (!response) return 1;
if(response)
{
if(listitem == 0)
{
ShowPlayerDialog(playerid,DIALOG_PMENU,DIALOG_STYLE_LIST,"Player Menu","PM \n God \n Sit \n","Select"," Back");
}
if(listitem == 1)
{
ShowPlayerDialog(playerid,DIALOG_TMENU,DIALOG_STYLE_LIST,"Teleport Menu","Stunts \nRace\nFun","Select","Back");
}
if(listitem == 2)
{
ShowPlayerDialog(playerid,DIALOG_WMENU,DIALOG_STYLE_LIST,"Weapon Menu","Melee \nRange \nShoutguns","Select"," Back");
}
if(listitem == 3)
{
ShowPlayerDialog(playerid,DIALOG_VMENU,DIALOG_STYLE_LIST,"Vehicle Menu","LowRiders\nPimp\nRacer Car","Select"," Back");
}
if(listitem == 4)
{
ShowPlayerDialog(playerid,DIALOG_AMENU,DIALOG_STYLE_LIST,"Animation Menu","Sit \nSleep \nDrunk \nTalk","Select"," Back");
}
if(listitem == 5)
{
new str[700];
strcat(str, ""YELLOW"/cgang "WHITE"- Creates a gang \n");
strcat(str, ""YELLOW"/ginvite "WHITE"- Invite a member to your gang \n");
strcat(str, ""YELLOW"/jgang "WHITE"- Accept a clan invitation request \n");
strcat(str, ""YELLOW"/dgang "WHITE"- Deny a clan invitation request \n");
strcat(str, ""YELLOW"/gsetrank "WHITE"- Set a clan member's rank/position \n");
strcat(str, ""YELLOW"/granks "WHITE"- View the list of member ranks \n");
strcat(str, ""YELLOW"/gmembers "WHITE"- View your online gang members \n");
strcat(str, ""YELLOW"/g "WHITE"- Talk in the gang chat \n");
strcat(str, ""YELLOW"/gclose "WHITE"- Disband a gang \n");
ShowPlayerDialog(playerid, DIALOG_CLAN_CMDS, DIALOG_STYLE_LIST, ""GOLD"Gang Menu", str, "Select", "Back");
return 1;
}
if(listitem == 6)
{
ShowPlayerDialog(playerid,DIALOG_OMENU,DIALOG_STYLE_LIST,"Object Menu","Hat\nShoes \nBody","Select"," Back");
}
}
}
if(dialogid == DIALOG_PMENU)
{
if(!response)
{
new str[700];
strcat(str, ""YELLOW"Player Menu "WHITE"- View the list of Player commands \n");
strcat(str, ""YELLOW"Teleport Menu "WHITE"- View the list of Teleport commands \n");
strcat(str, ""YELLOW"Weapon Menu "WHITE"- View the list of Weapon commands \n");
strcat(str, ""YELLOW"Vehicle Menu "WHITE"- View the list of Vehicle commands \n");
strcat(str, ""YELLOW"Animation Menu "WHITE"- View the list of Gang commands \n");
strcat(str, ""YELLOW"Gang Menu "WHITE"- View the list of Animation commands \n");
strcat(str, ""YELLOW"Object Menu "WHITE"- View the list of Attach Object commands \n");
ShowPlayerDialog(playerid, DIALOG_MENU, DIALOG_STYLE_LIST, ""GOLD"Main Commands", str, "Select", "Close");
return 1;
}
}
if(dialogid == DIALOG_TMENU)
{
if(!response)
{
new str[700];
strcat(str, ""YELLOW"Player Menu "WHITE"- View the list of Player commands \n");
strcat(str, ""YELLOW"Teleport Menu "WHITE"- View the list of Teleport commands \n");
strcat(str, ""YELLOW"Weapon Menu "WHITE"- View the list of Weapon commands \n");
strcat(str, ""YELLOW"Vehicle Menu "WHITE"- View the list of Vehicle commands \n");
strcat(str, ""YELLOW"Animation Menu "WHITE"- View the list of Gang commands \n");
strcat(str, ""YELLOW"Gang Menu "WHITE"- View the list of Animation commands \n");
strcat(str, ""YELLOW"Object Menu "WHITE"- View the list of Attach Object commands \n");
ShowPlayerDialog(playerid, DIALOG_MENU, DIALOG_STYLE_LIST, ""GOLD"Main Commands", str, "Select", "Close");
return 1;
}
}
if(dialogid == DIALOG_WMENU)
{
if(!response)
{
new str[700];
strcat(str, ""YELLOW"Player Menu "WHITE"- View the list of Player commands \n");
strcat(str, ""YELLOW"Teleport Menu "WHITE"- View the list of Teleport commands \n");
strcat(str, ""YELLOW"Weapon Menu "WHITE"- View the list of Weapon commands \n");
strcat(str, ""YELLOW"Vehicle Menu "WHITE"- View the list of Vehicle commands \n");
strcat(str, ""YELLOW"Animation Menu "WHITE"- View the list of Gang commands \n");
strcat(str, ""YELLOW"Gang Menu "WHITE"- View the list of Animation commands \n");
strcat(str, ""YELLOW"Object Menu "WHITE"- View the list of Attach Object commands \n");
ShowPlayerDialog(playerid, DIALOG_MENU, DIALOG_STYLE_LIST, ""GOLD"Main Commands", str, "Select", "Close");
return 1;
}
}
if(dialogid == DIALOG_VMENU)
{
if(!response)
{
new str[700];
strcat(str, ""YELLOW"Player Menu "WHITE"- View the list of Player commands \n");
strcat(str, ""YELLOW"Teleport Menu "WHITE"- View the list of Teleport commands \n");
strcat(str, ""YELLOW"Weapon Menu "WHITE"- View the list of Weapon commands \n");
strcat(str, ""YELLOW"Vehicle Menu "WHITE"- View the list of Vehicle commands \n");
strcat(str, ""YELLOW"Animation Menu "WHITE"- View the list of Gang commands \n");
strcat(str, ""YELLOW"Gang Menu "WHITE"- View the list of Animation commands \n");
strcat(str, ""YELLOW"Object Menu "WHITE"- View the list of Attach Object commands \n");
ShowPlayerDialog(playerid, DIALOG_MENU, DIALOG_STYLE_LIST, ""GOLD"Main Commands", str, "Select", "Close");
return 1;
}
}
if(dialogid == DIALOG_VMENU)
{
if(!response)
{
new str[700];
strcat(str, ""YELLOW"Player Menu "WHITE"- View the list of Player commands \n");
strcat(str, ""YELLOW"Teleport Menu "WHITE"- View the list of Teleport commands \n");
strcat(str, ""YELLOW"Weapon Menu "WHITE"- View the list of Weapon commands \n");
strcat(str, ""YELLOW"Vehicle Menu "WHITE"- View the list of Vehicle commands \n");
strcat(str, ""YELLOW"Animation Menu "WHITE"- View the list of Gang commands \n");
strcat(str, ""YELLOW"Gang Menu "WHITE"- View the list of Animation commands \n");
strcat(str, ""YELLOW"Object Menu "WHITE"- View the list of Attach Object commands \n");
ShowPlayerDialog(playerid, DIALOG_MENU, DIALOG_STYLE_LIST, ""GOLD"Main Commands", str, "Select", "Close");
return 1;
}
}
if(dialogid == DIALOG_CLAN_CMDS)
{
if(!response)
{
new str[700];
strcat(str, ""YELLOW"Player Menu "WHITE"- View the list of Player commands \n");
strcat(str, ""YELLOW"Teleport Menu "WHITE"- View the list of Teleport commands \n");
strcat(str, ""YELLOW"Weapon Menu "WHITE"- View the list of Weapon commands \n");
strcat(str, ""YELLOW"Vehicle Menu "WHITE"- View the list of Vehicle commands \n");
strcat(str, ""YELLOW"Animation Menu "WHITE"- View the list of Gang commands \n");
strcat(str, ""YELLOW"Gang Menu "WHITE"- View the list of Animation commands \n");
strcat(str, ""YELLOW"Object Menu "WHITE"- View the list of Attach Object commands \n");
ShowPlayerDialog(playerid, DIALOG_MENU, DIALOG_STYLE_LIST, ""GOLD"Main Commands", str, "Select", "Close");
return 1;
}
}
if(dialogid == DIALOGID_OMENU)
{
if(!response)
{
new str[700];
strcat(str, ""YELLOW"Player Menu "WHITE"- View the list of Player commands \n");
strcat(str, ""YELLOW"Teleport Menu "WHITE"- View the list of Teleport commands \n");
strcat(str, ""YELLOW"Weapon Menu "WHITE"- View the list of Weapon commands \n");
strcat(str, ""YELLOW"Vehicle Menu "WHITE"- View the list of Vehicle commands \n");
strcat(str, ""YELLOW"Animation Menu "WHITE"- View the list of Gang commands \n");
strcat(str, ""YELLOW"Gang Menu "WHITE"- View the list of Animation commands \n");
strcat(str, ""YELLOW"Object Menu "WHITE"- View the list of Attach Object commands \n");
ShowPlayerDialog(playerid, DIALOG_MENU, DIALOG_STYLE_LIST, ""GOLD"Main Commands", str, "Select", "Close");
return 1;
}
}