20.06.2015, 08:40
Hi my problem is when I am defining dialogs it's giving me errors I don't why it's happening I've checked that dialog id's aren't crossing each other I mean dialog ids are not same. I have just three dialogs I don't know why it's happening
here is the code
Errors
// Ondialogresponse
here is the code
pawn Код:
#define DIALOG_HOUSE 9000
#define DIALOG_pCMDS 9001
#define DIALOG_vCMDS 9002
pawn Код:
C:\Users\PC\Desktop\Samp-server\gamemodes\star.pwn(15486) : error 040: duplicate "case" label (value 9002)
C:\Users\PC\Desktop\Samp-server\gamemodes\star.pwn(15579) : error 040: duplicate "case" label (value 9001)
C:\Users\PC\Desktop\Samp-server\gamemodes\star.pwn(15590) : error 040: duplicate "case" label (value 9002)
pawn Код:
case DIALOG_pCMDS:
{
if ( !response )
return 1;
ShowPlayerDialog( playerid, DIALOG_pCMDS+1, DIALOG_STYLE_MSGBOX, ""NAME_S" "GRI"Player Commands Page "O"#2", CMDS_Page_2( ), "(Back)", "(Close)" );
return ( 1 );
}
case DIALOG_pCMDS+1:
{
if (!response)
return 1;
ShowPlayerDialog(playerid, DIALOG_pCMDS, DIALOG_STYLE_MSGBOX, ""NAME_S" "GRI"Player Commands Page "O"#1", CMDS_Page_1( ), "(Next)", "(Close)");
return ( 1 );
}
case DIALOG_vCMDS+1:
{
if ( !response )
return 1;
ShowPlayerDialog( playerid, DIALOG_vCMDS, DIALOG_STYLE_MSGBOX, ""NAME_S" "GRI"Vehicle Commands Page "O"#1", VCMDS_Page_1( ), "(Next)", "(Close)" );
return ( 1 );
}
case DIALOG_vCMDS:
{
if ( !response )
return 1;
ShowPlayerDialog( playerid, DIALOG_vCMDS+1, DIALOG_STYLE_MSGBOX, ""NAME_S" "GRI"Vehicle Commands Page "O"#2", VCMDS_Page_2( ), "(Back)", "(Close)" );
return ( 1 );
}
case DIALOG_HOUSE+1:
{
if(!response) return 1;
new id = GetPVarInt(playerid, "PickupHouseID");
if(!IsPlayerInRangeOfPoint(playerid, 2.0, HouseData[id][houseX], HouseData[id][houseY], HouseData[id][houseZ])) return SendClientMessage(playerid, 0xE74C3CFF, "You're not near any house.");
if(!(1 <= strlen(inputtext) <= MAX_HOUSE_PASSWORD)) return ShowPlayerDialog(playerid, DIALOG_HOUSE+1, DIALOG_STYLE_INPUT, "House Password", "This house is password protected.\n\nEnter house password:\n\n{E74C3C}The password you entered is either too short or too long.", "Try Again", "Close");
if(strcmp(HouseData[id][Password], inputtext)) return ShowPlayerDialog(playerid, DIALOG_HOUSE+1, DIALOG_STYLE_INPUT, "House Password", "This house is password protected.\n\nEnter house password:\n\n{E74C3C}Wrong password.", "Try Again", "Close");
SendToHouse(playerid, id);
return 1;
}