DIALOGS, weird error!! - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: DIALOGS, weird error!! (
/showthread.php?tid=112030)
DIALOGS, weird error!! -
patchkinson - 05.12.2009
pawn Код:
new listitems[] = "1\tDesert Eagle\n2\tGrenades\n3\tSawn-Off Shotgun\n4\tMolotov\n5\tRPG-7\n6\tAK47\n7\tM4\n";
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 2) {
if(response) {
new message[256+1];
if(listitem == 0) {
BLABLA
} else if(listitem == 1) {
BLABLA
} else if(listitem == 2) {
BLABLA
} else if(listitem == 3) {
BLABLA
} else if(listitem == 4) {
BLABLA
} else if(listitem == 5) {
BLABLA
} else if(listitem == 6) {
BLABLA
return 1;
}
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/hehe", cmdtext, true, 10) == 0)
{
ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST,"List of weapons:",listitems,"Get Gun","Cancel");
return 1;
}
return 0;
}
error is:
Код:
error 030: compound statement not closed at the end of file (started at line 227)
LINE 227:
Re: DIALOGS, weird error!! -
patchkinson - 05.12.2009
Sorry bumping this but i really need help!
Re: DIALOGS, weird error!! -
Joe Staff - 05.12.2009
These aren't being closed
pawn Код:
if(dialogid == 2) {
if(response) {
That means you're missing a closing brace.
Re: DIALOGS, weird error!! -
patchkinson - 05.12.2009
well, yea but i cant seem to find where
Re: DIALOGS, weird error!! -
Joe Staff - 05.12.2009
*sigh*
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 2) {
if(response) {
new message[256+1];
if(listitem == 0) {
BLABLA
} else if(listitem == 1) {
BLABLA
} else if(listitem == 2) {
BLABLA
} else if(listitem == 3) {
BLABLA
} else if(listitem == 4) {
BLABLA
} else if(listitem == 5) {
BLABLA
} else if(listitem == 6) {
BLABLA
} //end of if(listitem == 6)
} //end of if(response)
} //end of if(dialog == 2)
return 1;
}
Add those braces where it shows my comments.