Guys, My question is about Dialogs
#5

On top of your script.
pawn Код:
#define DIALOG_JOBS  1337
In OnPlayerCommandText:
pawn Код:
if(strcmp(cmd, "/jobs", true) == 0) {
        ShowPlayerDialog(playerid, DIALOG_JOBS, DIALOG_STYLE_LIST,"Select your job:","1. Mechanic\n2.Whore\n3.Sweeper\n4.Lawyer","Select","Cancel");
        return 1;
    }
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
        case DIALOG_JOBS:
        {
            if(!response)
            {
                SendClientMessage(playerid, 0xFF0000FF,"You canceled the job selection");
                return true;
            }

            switch(listitem)
            {
                case 0: {// Case 0 = Listitem 1.
                    //Your functions for Mechanic, like checkpoints, messages etc.
                }
                case 1: {
                    //Your functions for Whore
                }
                case 2: {
                    //YOur functions for Sweeper
                }
                case 3: {
                    //Your functions for Lawyer
                }
            }
        }
    }
    return 1;
}
Untested, but this is how it should be done..

SA-MP Wiki and forum search will also help you a lot, as lorenc said.
Reply


Messages In This Thread
Guys, My question is about Dialogs - by Ehab1911 - 03.07.2011, 11:03
Re: Guys, My question is about Dialogs - by Lorenc_ - 03.07.2011, 11:06
Re: Guys, My question is about Dialogs - by Ehab1911 - 03.07.2011, 11:09
Re: Guys, My question is about Dialogs - by Lorenc_ - 03.07.2011, 11:24
Re: Guys, My question is about Dialogs - by iPLEOMAX - 03.07.2011, 11:24
Re: Guys, My question is about Dialogs - by Ehab1911 - 12.07.2011, 16:46

Forum Jump:


Users browsing this thread: 1 Guest(s)