compound statement not closed at the end of file (started at line 831)
#1

Hello all! I am asking for a help find me where I made mistake. :S

pawn Код:
CMD:buysports(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 3.0, 546.2457,-1280.3177,17.2482))
    {
        new Float:x, Float:y, Float:z;
        new sportscars;
        GetPlayerPos(playerid, x, y, z);
        ShowPlayerDialog(playerid, sportscars, DIALOG_STYLE_LIST, "Sports Cars", "Buffalo\nAlpha\nBanshee\nBlista Compact\nBullet\nCheetah\nClub\nEuros\nFlash\nHotring Racer 1\nHotring Racer 2\nInfernus\nJester\nPhoenix\nSabre\nSuper GT\nTurismo\nUranus\nZR-350", "Buy", "button2[]");
        {
           switch(sportscars)
           {
               case 0:
               {
               CreateVehicle(402, x, y, z, 0, 0, 0, 0); //This is the 831 line which he signals as bad one.
               {
               return 1;
}
(835) : error 030: compound statement not closed at the end of file (started at line 831)
Reply
#2

pawn Код:
{
           switch(sportscars)
           {
               case 0:
               {
               CreateVehicle(402, x, y, z, 0, 0, 0, 0); //This is the 831 line which he signals as bad one.
               {
place this on

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    return 1;
}
Reply
#3

pawn Код:
case 0:
               {
               CreateVehicle(402, x, y, z, 0, 0, 0, 0); //This is the 831 line which he signals as bad one.
               {
To
pawn Код:
case 0:
               {
               CreateVehicle(402, x, y, z, 0, 0, 0, 0); //This is the 831 line which he signals as bad one.
               }
Plus, this code needs to be on OnDialogResponse callback.
Reply
#4

Well, I used the one what you gave me, but PAWN said that I got undefined x, y, z and few other stuff so I moved

pawn Код:
new Float:x, Float:y, Float:z;
        new sportscars;
        GetPlayerPos(playerid, x, y, z);
...also there but then he gave me this:

(477) : warning 225: unreachable code
(477) : warning 217: loose indentation
(477) : error 029: invalid expression, assumed zero
(477) : error 004: function "OnPlayerClickPlayer" is not implemented
(482) :warning 225: unreachable code
(482) :error 029: invalid expression, assumed zero
(482) :error 017: undefined symbol "cmd_enter"
(482) :error 029: invalid expression, assumed zero
(482) :fatal error 107: too many error messages on one line
Reply
#5

pawn Код:
new Float:x, Float:y, Float:z, sportscars;
    GetPlayerPos(playerid, x, y, z);
Reply
#6

Here let me fix it up for you.
pawn Код:
#define sportscar 990
new Float:x, Float:y, Float:z; // On top of your script under includes, because we're making it GLOBAL
CMD:buysports(playerid, params[])
{
    if(!IsPlayerInRangeOfPoint(playerid, 3.0, 546.2457,-1280.3177,17.2482)) return SendClientMessage(playerid,-1,"You Should Be At The Shop to Buy This!");
    ShowPlayerDialog(playerid, sportscars, DIALOG_STYLE_LIST, "Sports Cars", "Buffalo\nAlpha\nBanshee\nBlista Compact\nBullet\nCheetah\nClub\nEuros\nFlash\nHotring Racer 1\nHotring Racer 2\nInfernus\nJester\nPhoenix\nSabre\nSuper GT\nTurismo\nUranus\nZR-350", "Buy", "button2[]");
    return 1;
}
Now on Dialog Response.
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case sportscar:
           {
switch(listitem)
{
               case 0:
               {
               CreateVehicle(402, x, y, z, 0, 0, 0, 0); //This is the 831 line which he signals as bad one.
               }
       }
}
return 1;
}
PS: sorry for fucked up intendations, scripted it here.
Reply
#7

error 002: only a single statement (or expression) can follow each "case"
(479) : warning 215: expression has no effect
(466) : warning 203: symbol is never used: "sportscars"

Errors keep comming He asked me to define x y z and sportscar under OnDialogResponse, I did it in your script, but he gave me these errors. :S
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)