OnDialogResponse [+REP]
#1

Hello everyone again!
Well, after i fixed my code, I made a dialog for the command /jobs and I want to make than when someone choose a job, it locate it. SetPlayerCheckpoint. But it isn't working. Can anyone help me please ?
pawn Код:
#define DIALOG_JOBS 1
pawn Код:
if(strcmp(cmd, "/jobs", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            ShowPlayerDialog(playerid, DIALOG_JOBS, DIALOG_STYLE_LIST, "Jobs List - Fun-Generation Community!", "Detective \nLawyer \nWhore \nDrugs Dealer \nCar Jacker \nCar Mechanic \nBodyGuard \nArms Dealer \nBoxer \nBus Driver \nPaper Boy \nTrucker", "Locate", "Cancel");
            return 1;
        }
    }
}
pawn Код:
public OnDialogResponse(playerid,dialogid,response, listitem, inputtext[])
{
    if(dialogid == DIALOG_JOBS)
    {
        if(response)
            {
                switch(listitem)
                {
                    case 0:SetPlayerCheckpoint(playerid, 359.5408, 206.7693, 1008.3828, 2);
                    case 1:SetPlayerCheckpoint(playerid, 347.7374, 193.7241, 1014.1875, 2);
                    case 2:SetPlayerCheckpoint(playerid, 1210.8000, 5.6668, 1000.9219, 2);
                    case 3:SetPlayerCheckpoint(playerid, 2166.3772, -1675.3829, 15.0859, 2);
                    case 4:SetPlayerCheckpoint(playerid, 2356.0491, -2288.2493, 17.4219, 2);
                    case 5:SetPlayerCheckpoint(playerid, 1643.3679, -1520.7407, 13.5593, 2);
                    case 6:SetPlayerCheckpoint(playerid, 2226.1716, -1718.1792, 13.5165, 2);
                    case 7:SetPlayerCheckpoint(playerid, 1366.4325, -1275.2096, 13.5469, 2);
                    case 8:SetPlayerCheckpoint(playerid, 531.7930, -1292.4044, 17.2422, 2);
                    case 9:SetPlayerCheckpoint(playerid, 1154.2208, -1770.8203, 16.5992, 2);
                    case 10:SetPlayerCheckpoint(playerid, 649.2820, -1360.8070, 13.5860, 2);
                    case 11:SetPlayerCheckpoint(playerid, 919.4680, -1252.1967, 16.2109, 2);
                }
            }
            return 1;
    }
    return 0;
}
When I choose the job, it does nothing. Only dialog get closed. Can anyone help me ?
+REP
Reply
#2

pawn Код:
public OnDialogResponse(playerid,dialogid,response, listitem, inputtext[])
{
    if(dialogid == DIALOG_JOBS)
    {
        if(response)
            {
                switch(listitem)
                {
                    case 0:{SetPlayerCheckpoint(playerid, 359.5408, 206.7693, 1008.3828, 2);}
                    case 1:{SetPlayerCheckpoint(playerid, 347.7374, 193.7241, 1014.1875, 2);}
                    case 2:{SetPlayerCheckpoint(playerid, 1210.8000, 5.6668, 1000.9219, 2);}
                    case 3:{SetPlayerCheckpoint(playerid, 2166.3772, -1675.3829, 15.0859, 2);}
                    case 4:{SetPlayerCheckpoint(playerid, 2356.0491, -2288.2493, 17.4219, 2);}
                    case 5:{SetPlayerCheckpoint(playerid, 1643.3679, -1520.7407, 13.5593, 2);}
                    case 6:{SetPlayerCheckpoint(playerid, 2226.1716, -1718.1792, 13.5165, 2);}
                    case 7:{SetPlayerCheckpoint(playerid, 1366.4325, -1275.2096, 13.5469, 2);}
                    case 8:{SetPlayerCheckpoint(playerid, 531.7930, -1292.4044, 17.2422, 2);}
                    case 9:{SetPlayerCheckpoint(playerid, 1154.2208, -1770.8203, 16.5992, 2);}
                    case 10:{SetPlayerCheckpoint(playerid, 649.2820, -1360.8070, 13.5860, 2);}
                    case 11:{SetPlayerCheckpoint(playerid, 919.4680, -1252.1967, 16.2109, 2);}
                }
            }
            return 1;
    }
    return 0;
}
Try that
Reply
#3

You probably have in some script dialog with id 1 which blocks DIALOG_JOBS
Reply
#4

Quote:
Originally Posted by McGuiness
Посмотреть сообщение
pawn Код:
public OnDialogResponse(playerid,dialogid,response, listitem, inputtext[])
{
    if(dialogid == DIALOG_JOBS)
    {
        if(response)
            {
                switch(listitem)
                {
                    case 0:{SetPlayerCheckpoint(playerid, 359.5408, 206.7693, 1008.3828, 2);}
                    case 1:{SetPlayerCheckpoint(playerid, 347.7374, 193.7241, 1014.1875, 2);}
                    case 2:{SetPlayerCheckpoint(playerid, 1210.8000, 5.6668, 1000.9219, 2);}
                    case 3:{SetPlayerCheckpoint(playerid, 2166.3772, -1675.3829, 15.0859, 2);}
                    case 4:{SetPlayerCheckpoint(playerid, 2356.0491, -2288.2493, 17.4219, 2);}
                    case 5:{SetPlayerCheckpoint(playerid, 1643.3679, -1520.7407, 13.5593, 2);}
                    case 6:{SetPlayerCheckpoint(playerid, 2226.1716, -1718.1792, 13.5165, 2);}
                    case 7:{SetPlayerCheckpoint(playerid, 1366.4325, -1275.2096, 13.5469, 2);}
                    case 8:{SetPlayerCheckpoint(playerid, 531.7930, -1292.4044, 17.2422, 2);}
                    case 9:{SetPlayerCheckpoint(playerid, 1154.2208, -1770.8203, 16.5992, 2);}
                    case 10:{SetPlayerCheckpoint(playerid, 649.2820, -1360.8070, 13.5860, 2);}
                    case 11:{SetPlayerCheckpoint(playerid, 919.4680, -1252.1967, 16.2109, 2);}
                }
            }
            return 1;
    }
    return 0;
}
Try that
Quote:
Originally Posted by Jefff
Посмотреть сообщение
You probably have in some script dialog with id 1 which blocks DIALOG_JOBS
@McGGuiness, Nothing happened, still the same.
@Jefff, No, it's working fine only the checkpoint not working....
Reply
#5

Change Dialog ID.
Reply
#6

Quote:
Originally Posted by Lunoxel
Посмотреть сообщение
Change Dialog ID.
I've tried it many times, and It still didn't work.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)