Help :D -
CrazyManiac - 17.09.2012
Hello there! Can anybody help me with my script? It's just a little script for testing something, but i get 4 errors, and i cant find a solution. Please can somebody tell me what is wrong with this? :
Код:
#define DIALOG_CLASS 1
Код:
ShowPlayerDialog(playerid,DIALOG_CLASS,DIALOG_STYLE_LIST,"{FFDD00}Class Selection","{8F3333}Rapist\n{8F3333}Drug Dealer\n{8F3333}Weapon Dealer\n{8F3333}Car Jacker\n{0090FF}Police Officer\n{49BF00}Army Soldier\n{0004FF}(VIP) Bank Robber","Choose","");
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)
{
switch(dialogid)
{
case DIALOG_CLASS:
{
switch(listitem)
{
case 0:
{
SendClientMessage(playerid, 0xD8FF2BFF, "You're listening: Technobase.FM!");
}
case 1:
{
SendClientMessage(playerid, 0xFF00FFFF, "You're listening: Housetime.FM!");
}
case 2:
{
SendClientMessage(playerid, 0x33CCFFAA, "You're listening: Hardbase.FM!");
}
case 3:
{
SendClientMessage(playerid, 0x00FF2BFF, "You're listening: Trancebase.FM!");
}
case 4:
{
SendClientMessage(playerid, 0xC0C0C0FF, "You're listening: Coretime.FM!");
}
case 5:
{
SendClientMessage(playerid, 0xFF6347AA, "You're listening: Clubtime.FM!");
}
case 6:
{
SendClientMessage(playerid, 0x009000FF, "You're listening: Breakz.us!");
}
}
}
)
)
return 1;
}
Errors:
Код:
C:\Documents and Settings\Fabian\My Documents\yy.pwn(294) : error 002: only a single statement (or expression) can follow each "case"
C:\Documents and Settings\Fabian\My Documents\yy.pwn(295) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Fabian\My Documents\yy.pwn(295 -- 296) : warning 215: expression has no effect
C:\Documents and Settings\Fabian\My Documents\yy.pwn(296) : error 001: expected token: ";", but found "return"
C:\Documents and Settings\Fabian\My Documents\yy.pwn(298) : error 030: compound statement not closed at the end of file (started at line 256)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
Re: Help :D -
AtItsMax - 17.09.2012
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)
{
switch(dialogid)
{
case DIALOG_CLASS:
{
switch(listitem)
{
case 0:
{
SendClientMessage(playerid, 0xD8FF2BFF, "You're listening: Technobase.FM!");
}
case 1:
{
SendClientMessage(playerid, 0xFF00FFFF, "You're listening: Housetime.FM!");
}
case 2:
{
SendClientMessage(playerid, 0x33CCFFAA, "You're listening: Hardbase.FM!");
}
case 3:
{
SendClientMessage(playerid, 0x00FF2BFF, "You're listening: Trancebase.FM!");
}
case 4:
{
SendClientMessage(playerid, 0xC0C0C0FF, "You're listening: Coretime.FM!");
}
case 5:
{
SendClientMessage(playerid, 0xFF6347AA, "You're listening: Clubtime.FM!");
}
case 6:
{
SendClientMessage(playerid, 0x009000FF, "You're listening: Breakz.us!");
}
}
}
}
return 1;
}
Re: Help :D -
CrazyManiac - 17.09.2012
Код:
C:\Documents and Settings\Fabian\My Documents\yy.pwn(295) : warning 217: loose indentation
C:\Documents and Settings\Fabian\My Documents\yy.pwn(297) : error 030: compound statement not closed at the end of file (started at line 256)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
Re: Help :D -
AtItsMax - 17.09.2012
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)
{
switch(dialogid)
{
case DIALOG_CLASS:
{
switch(listitem)
{
case 0:
{
SendClientMessage(playerid, 0xD8FF2BFF, "You're listening: Technobase.FM!");
}
case 1:
{
SendClientMessage(playerid, 0xFF00FFFF, "You're listening: Housetime.FM!");
}
case 2:
{
SendClientMessage(playerid, 0x33CCFFAA, "You're listening: Hardbase.FM!");
}
case 3:
{
SendClientMessage(playerid, 0x00FF2BFF, "You're listening: Trancebase.FM!");
}
case 4:
{
SendClientMessage(playerid, 0xC0C0C0FF, "You're listening: Coretime.FM!");
}
case 5:
{
SendClientMessage(playerid, 0xFF6347AA, "You're listening: Clubtime.FM!");
}
case 6:
{
SendClientMessage(playerid, 0x009000FF, "You're listening: Breakz.us!");
}
}
}
}
}
return 1;
}
Fixed, plus the indentation, avoid it or use #pragma tabsize 0.
Re: Help :D -
CrazyManiac - 17.09.2012
It works, thanks alot.