PDA

View Full Version : error 001: expected token: ",", but found "case"


dudaefj
18/01/2012, 08:56 AM
I'm lost :neutral:

I've got those errors:

C:\BSL\BSL 2.1\gamemodes\BSL2.pwn(18368 -- 18369) : error 001: expected token: ",", but found "case"
C:\BSL\BSL 2.1\gamemodes\BSL2.pwn(18369) : error 014: invalid statement; not in switch
C:\BSL\BSL 2.1\gamemodes\BSL2.pwn(18369) : warning 215: expression has no effect
C:\BSL\BSL 2.1\gamemodes\BSL2.pwn(18369) : error 001: expected token: ";", but found ":"
C:\BSL\BSL 2.1\gamemodes\BSL2.pwn(18369) : fatal error 107: too many error messages on one line


lines 18368 and 18369:

case 7: NikoGPSEntretenimento()
case 8: NikoGPSEmpresas()

the define's



#define NikoGPSEntretenimento() { new gpsEntretenimento[] = "1.\tCorrida de Vacas\n2.\tPuteiro\n3.\tCasa Noturna\n4.\tBoliche\n5.\tBalada\n6.\tBarzinho\n7. \tSex Shop\n8.\t8 Ball\n9.\tRally\n10.\tStunt"; ShowPlayerDialog(playerid,DIALOG_GPS_ENTRETENIMENT O, DIALOG_STYLE_LIST,"{00ff00}G.P.S. {ff0000}BSL{00ff00} Entretenimento:",gpsEntretenimento,"Selecionar","Voltar"); }

#define NikoGPSEmpresas() { new gpsEmpresas[] = "1.\tAluguel de Motos\n2.\tAluguel de Carros\n3.\tEmpresa de Telefonia\n4.\tCentral dos Postos\n5.\tEnergia Elétrica\n6.\tTransportadora\n7.\tAtualizações\n8. \tAnúncios\n9.\tMecânico\n10.\tLojas 24/7\n11.\tPaintball\n12.\tKart\n13.\tÁgua\n14.\tConc essionária\n15.\tHospital\n16.\tPay and Spray\n17.\tSprunk\n18.\tAuto-Escola\n19.\tLoja Binco\n20.\tPedágio\n21.\tBar\n22.\tRestaurante\n2 3.\tLotérica\n24.\tCorrida de Vacas\n25.\tTunning\n26.\tArmas Norte\n27.\tArmas Sul"; ShowPlayerDialog(playerid,DIALOG_GPS_EMPRESAS, DIALOG_STYLE_LIST,"{00ff00}G.P.S. {ff0000}BSL{00ff00} Empresas:",gpsEmpresas,"Selecionar","Voltar"); }


any Idea?

T0pAz
18/01/2012, 09:12 AM
switch ( <variable> ) {
case this-value:
Code to execute if <variable> == this-value
break;
case that-value:
Code to execute if <variable> == that-value
break;
...
default:
Code to execute if <variable> does not equal the value following any of the cases
break;
}


Function cannot be used and colon should be placed at the end.

dudaefj
18/01/2012, 09:23 AM
I'm not using a function
it is a directive...

and if you read it, you can see there is colon.

T0pAz
18/01/2012, 09:27 AM
I'm not using a function
it is a directive...

and if you read it, you can see there is colon.


Function cannot be used and colon should be placed at the end.


4char

dudaefj
18/01/2012, 09:30 AM
where "function cannot be used"?

Michael@Belgium
18/01/2012, 12:57 PM
case 7: NikoGPSEntretenimento() ;
case 8: NikoGPSEmpresas();

Michael@Belgium
18/01/2012, 12:59 PM
lol double post ? Stupid internet