[Tutorial] Unlimited dialogs
#2

pretty nice. But why not

Code:
new p_currentDialog[MAX_PLAYERS];

enum eDialogs
{
    dRegistration,
    dLogin

// ... unlimited ! (technically limited - 2147483647)
};

stock showDialog(playerid, dialogid, type, head[], body[], left[], right[])
{
    p_currentDialog[playerid] = dialogid;
    ShowPlayerDialog(playerid, 0, type, head, body, left, right);
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    new const id = p_currentDialog[playerid];
    p_currentDialog[playerid] = 0;
    
    switch( id )
    {
        case dRegistration:
        {
            // do registration things
        }
        case dLogin:
        {
            // do login things
        }
    }

    return 0;
}
Reply


Messages In This Thread
Unlimited dialogs - by Misiur - 22.08.2013, 11:22
Re: Unlimited dialogs - by theYiin - 22.08.2013, 11:33
Re: Unlimited dialogs - by Misiur - 22.08.2013, 12:03
Re: Unlimited dialogs - by theYiin - 22.08.2013, 13:11

Forum Jump:


Users browsing this thread: 1 Guest(s)