SA-MP Forums Archive
[HELP] Dialog - 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: [HELP] Dialog (/showthread.php?tid=196784)



[HELP] Dialog - Larsey123IsMe - 06.12.2010

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*
}



Re: [HELP] Dialog - SkizzoTrick - 06.12.2010

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


Re: [HELP] Dialog - Larsey123IsMe - 06.12.2010

@SkizzoTrick Thanks


Re: [HELP] Dialog - Larsey123IsMe - 06.12.2010

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.



Re: [HELP] Dialog - eDz0r - 06.12.2010

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



Re: [HELP] Dialog - Larsey123IsMe - 06.12.2010

@eDz0r Thanks You