Guys, My question is about Dialogs
#1

Hello guys, I don't understand those Dialogs as I searched the forum for a tutorial on them but couldn't find :S, So I came and posted this

I want to make a Dialog when you type /jobs

It shows for example the jobs and when you click on a job name you get a checkpoint to it

Like::
/jobs

MECHANIC
WHORE
SWEEPER
LAWYER

etc okay? I click now on Mechanic, I want it to show me the direction ( check point on the map ) to that job for example, and send me a client message saying for example Please follow the checkpoint on your radar to get that job.

Please help me, thanks in advance!
Reply
#2

SetPlayerCheckPoint?
Reply
#3

Yes but I want to understand how those " Dialogs " work please, if there is any thread you may found which I couldn't .. Please
Reply
#4

There are plenty!

This will help you:

CLICK HERE
Reply
#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
#6

Thanks a lot! But how can I put that Dialog, I have another one, which I took from an FS ,, How can I add that as another Dialog?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)