11.08.2012, 15:33
I'm working on dialogs for a script I'm doing. After switch(dialogid) I get 4 errors and a warning. Here's the code.
I do have a define for the dialogid
Here are errors/warning:
Thank you very much in advance for any help/answers.
Код:
(line 995) public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(response) { switch(dialogid) { if(dialogid == electronics_shop_dialog) { if(listitem == 0) //Walkie Talkie { if(PlayerInfo[playerid][pWalkie] == 0) { PlayerInfo[playerid][pWalkie]++; } if(PlayerInfo[playerid][pWalkie] == 1) { SendClientMessage(playerid, COLOR_GREY, "You already own a walkie talkie!"); } } if(listitem == 1) //Scanner { if(PlayerInfo[playerid][pScanner] == 0) { PlayerInfo[playerid][pScanner]++; } if(PlayerInfo[playerid][pScanner] == 1) { SendClientMessage(playerid, COLOR_GREY, "You already own a scanner!"); } } } return 1; } } return 1; }(line 1030)
Код:
#define electronics_shop_dialog
Код:
C:\Documents and Settings\GLB\My Documents\Dropbox\Scripts\Gavin\gamemodes\script.pwn(1001) : error 002: only a single statement (or expression) can follow each "case" C:\Documents and Settings\GLB\My Documents\Dropbox\Scripts\Gavin\gamemodes\script.pwn(1001) : error 029: invalid expression, assumed zero C:\Documents and Settings\GLB\My Documents\Dropbox\Scripts\Gavin\gamemodes\script.pwn(1001 -- 1003) : warning 215: expression has no effect C:\Documents and Settings\GLB\My Documents\Dropbox\Scripts\Gavin\gamemodes\script.pwn(1003) : error 001: expected token: ";", but found "if" C:\Documents and Settings\GLB\My Documents\Dropbox\Scripts\Gavin\gamemodes\script.pwn(1003) : fatal error 107: too many error messages on one line