[0.3E BUG] Dialog
#1

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == TeleportDialog)
    {
        if(!response) return SendClientMessage(playerid, RED, "You closed the dialog ");
        switch(listitem)
        {
            case 0: ShowPlayerDialog(playerid,LosSantosTeleportsDialog,DIALOG_STYLE_LIST,"Los Santos","Grove Street\r\nMullholand\r\nUnity Station\r\nAirport\r\nSanta Maria beach\r\nDocks\r\nPershing Square","Back", "Choose");
            case 1: ShowPlayerDialog(playerid,SanFierroTeleportsDialog, DIALOG_STYLE_LIST,"San Fierro","Doherty\r\nHighway\r\nAirport\r\nTrain station\r\nBridge\r\nCarrier\r\nParking Lot","Close", "Choose");
        }
    }
   
    else if(dialogid == LosSantosTeleportsDialog)
    {
        if(!response) return ShowPlayerDialog(playerid,TeleportDialog, DIALOG_STYLE_LIST,"Teleports","Los Santos\r\nSan Fierro\r\nLas Venturas\r\nBone County\r\nStunts\r\nDeathmatch arena's\r\nRace Tracks\r\nTuning Shops","Close", "Choose");
        switch(listitem)
        {
            case 0: return cmd_grovestreet(playerid,"");
            case 1: return cmd_mullholand(playerid, "");
            case 2: return cmd_unitystation(playerid,"");
            case 3: return cmd_lsairport(playerid,"");
        }
    }
    return 1;
}

The bug is if I press the 2ND button in the dialog, it uses the if(!response) statement instead of the first button. And the first button selects the highlighted option. Isn't that the other way around?
Reply
#2

thats not a bug
if you want that the 2nd buttom select the "hightlighted option"
replace
if(!response)

with
if(response)
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)