[HELP] Dialog
#1

Error is marked with //blabla
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)
    {
    switch(dialogid)
        {
        case 1:
            {
            switch(listitem)
                {
                    case 0:
                    {
                        if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
                        GivePlayerMoney(playerid, -1);
                        SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_SPRUNK);
                    }
                    case 1:
                    {
                        if(GetPlayerMoney(playerid) < 2) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
                        GivePlayerMoney(playerid, -2);
                        SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER);
                    }
                    case 2:
                    {
                        if(GetPlayerMoney(playerid) < 3) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
                        GivePlayerMoney(playerid, -3);
                        SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE);
                    }
                }
            }
       }
   }
   return 1; //...Dialog.pwn(43) : warning 217: loose indentation *This is line 43*
}
Reply
#2

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)
    {
    switch(dialogid)
        {
        case 1:
            {
            switch(listitem)
                {
                    case 0:
                    {
                        if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
                        GivePlayerMoney(playerid, -1);
                        SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_SPRUNK);
                    }
                    case 1:
                    {
                        if(GetPlayerMoney(playerid) < 2) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
                        GivePlayerMoney(playerid, -2);
                        SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER);
                    }
                    case 2:
                    {
                        if(GetPlayerMoney(playerid) < 3) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
                        GivePlayerMoney(playerid, -3);
                        SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE);
                    }
                }
            }
       }
   }
return 1; //...Dialog.pwn(43) : warning 217: loose indentation *This is line 43*
}
Or try to move that return with Tab till the warn dissapear
Reply
#3

@SkizzoTrick Thanks
Reply
#4

i need help with another thing too :P
I really messed up this one:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(IsPlayerAdmin(playerid))
    }// 7
        if(!strcmp(cmdtext, "/teles", true)) // 8
        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Where do you want?", "Las Venturas Airport\nSan Fierro Airport\nLos Santos Airport\nAbandoned Airport\nLas Venturas Bank\nMount Chilliad", "Teleport", "Cancel");
        return 1;
    }
} //12
ERROR:!
pawn Код:
C:\Users\Larsey123\Desktop\Teles.pwn(7) : error 029: invalid expression, assumed zero
C:\Users\Larsey123\Desktop\Teles.pwn(7 -- 8) : warning 215: expression has no effect
C:\Users\Larsey123\Desktop\Teles.pwn(8) : error 001: expected token: ";", but found "if"
C:\Users\Larsey123\Desktop\Teles.pwn(8) : warning 217: loose indentation
C:\Users\Larsey123\Desktop\Teles.pwn(12) : error 054: unmatched closing brace ("}")
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


3 Errors.
Reply
#5

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(IsPlayerAdmin(playerid))
    }// 7 Not { ?? <---------------
        if(!strcmp(cmdtext, "/teles", true)) // 8
        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Where do you want?", "Las Venturas Airport\nSan Fierro Airport\nLos Santos Airport\nAbandoned Airport\nLas Venturas Bank\nMount Chilliad", "Teleport", "Cancel");
        return 1;
    }
} //12
Reply
#6

@eDz0r Thanks You
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)