error 040: duplicate "case" label
#1

Wut wut?

The error
Code:
C:\Users\Tin\OneDrive\GM\gamemodes\NG.pwn(326) : warning 201: redefinition of constant/macro (symbol "RED")
C:\Users\Tin\OneDrive\GM\gamemodes\NG.pwn(3058) : error 040: duplicate "case" label (value 601)
C:\Users\Tin\OneDrive\GM\gamemodes\NG.pwn(3066) : error 040: duplicate "case" label (value 602)
C:\Users\Tin\OneDrive\GM\gamemodes\NG.pwn(3102) : error 040: duplicate "case" label (value 604)
C:\Users\Tin\OneDrive\GM\gamemodes\NG.pwn(3110) : error 040: duplicate "case" label (value 605)
C:\Users\Tin\OneDrive\GM\gamemodes\NG.pwn(3118) : error 040: duplicate "case" label (value 606)
C:\Users\Tin\OneDrive\GM\gamemodes\NG.pwn(3130) : error 002: only a single statement (or expression) can follow each "case"
The code
PHP Code:
        case 599:
        {
            if(!
response) return BuildRace 0;
            switch(
listitem)
            {
                case 
0BuildRaceType 0;
                case 
1BuildRaceType 3;
            }
            
ShowDialog(playerid600);
        }
        case 
600..601:
        {
            if(!
response) return ShowDialog(playerid599);
            if(!
strlen(inputtext)) return ShowDialog(playerid601);
            if(
strlen(inputtext) < || strlen(inputtext) > 20) return ShowDialog(playerid601);
            
strmid(BuildNameinputtext0strlen(inputtext), sizeof(BuildName));
            
ShowDialog(playerid602);
        }
        case 
602..603:
        {
            if(!
response) return ShowDialog(playerid600);
            if(!
strlen(inputtext)) return ShowDialog(playerid603);
            if(
isNumeric(inputtext))
            {
                if(!
IsValidVehicle(strval(inputtext))) return ShowDialog(playerid603);
                new
                    
FloatpPos[4]
                ;
                
GetPlayerPos(playeridpPos[0], pPos[1], pPos[2]);
                
GetPlayerFacingAngle(playeridpPos[3]);
                
BuildModeVID strval(inputtext);
                
BuildCreatedVehicle = (BuildCreatedVehicle == 0x01) ? (DestroyVehicle(BuildVehicle), BuildCreatedVehicle 0x00) : (DestroyVehicle(BuildVehicle), BuildCreatedVehicle 0x00);
                
BuildVehicle CreateVehicle(strval(inputtext), pPos[0], pPos[1], pPos[2], pPos[3], random(126), random(126), (60 60));
                
PutPlayerInVehicle(playeridBuildVehicle0);
                
BuildCreatedVehicle 0x01;
                
ShowDialog(playerid604);
            }
            else
            {
                if(!
IsValidVehicle(ReturnVehicleID(inputtext))) return ShowDialog(playerid603);
                new
                    
FloatpPos[4]
                ;
                
GetPlayerPos(playeridpPos[0], pPos[1], pPos[2]);
                
GetPlayerFacingAngle(playeridpPos[3]);
                
BuildModeVID ReturnVehicleID(inputtext);
                
BuildCreatedVehicle = (BuildCreatedVehicle == 0x01) ? (DestroyVehicle(BuildVehicle), BuildCreatedVehicle 0x00) : (DestroyVehicle(BuildVehicle), BuildCreatedVehicle 0x00);
                
BuildVehicle CreateVehicle(ReturnVehicleID(inputtext), pPos[0], pPos[1], pPos[2], pPos[3], random(126), random(126), (60 60));
                
PutPlayerInVehicle(playeridBuildVehicle0);
                
BuildCreatedVehicle 0x01;
                
ShowDialog(playerid604);
            }
        }
        case 
604:
        {
            if(!
response) return ShowDialog(playerid602);
            
SendClientMessage(playeridGREEN">> Go to the start line on the left road and press 'KEY_FIRE' and do the same with the right road block.");
            
SendClientMessage(playeridGREEN"   - When this is done, you will see a dialog to continue.");
            
BuildVehPosCount 0;
            
BuildTakeVehPos true;
        }
        case 
605:
        {
            if(!
response) return ShowDialog(playerid604);
            
SendClientMessage(playeridGREEN">> Start taking checkpoints now by clicking 'KEY_FIRE'.");
            
SendClientMessage(playeridGREEN"   - IMPORTANT: Press 'ENTER' when you're done with the checkpoints! If it doesn't react press again and again.");
            
BuildCheckPointCount 0;
            
BuildTakeCheckpoints true;
        }
        case 
606:
        {
            if(!
response) return ShowDialog(playerid606);
            
BuildRace 0;
            
BuildCheckPointCount 0;
            
BuildVehPosCount 0;
            
BuildTakeCheckpoints false;
            
BuildTakeVehPos false;
            
BuildCreatedVehicle = (BuildCreatedVehicle == 0x01) ? (DestroyVehicle(BuildVehicle), BuildCreatedVehicle 0x00) : (DestroyVehicle(BuildVehicle), BuildCreatedVehicle 0x00);
        
        
 }
    return 
1;

Reply


Messages In This Thread
error 040: duplicate "case" label - by xxxSpeedxxx - 15.06.2017, 22:32
Re: error 040: duplicate "case" label - by saffierr - 15.06.2017, 22:34
Re: error 040: duplicate "case" label - by xxxSpeedxxx - 15.06.2017, 22:40
Re: error 040: duplicate "case" label - by Kane - 15.06.2017, 22:43
Re: error 040: duplicate "case" label - by xxxSpeedxxx - 15.06.2017, 22:51
Re: error 040: duplicate "case" label - by Kane - 15.06.2017, 22:53
Re: error 040: duplicate "case" label - by xxxSpeedxxx - 15.06.2017, 22:56
Re: error 040: duplicate "case" label - by saffierr - 15.06.2017, 23:03

Forum Jump:


Users browsing this thread: 1 Guest(s)