01.10.2015, 22:22
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 ?
When I choose the job, it does nothing. Only dialog get closed. Can anyone help me ?
+REP
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;
}
+REP