03.07.2011, 11:24
On top of your script.
In OnPlayerCommandText:
Untested, but this is how it should be done..
SA-MP Wiki and forum search will also help you a lot, as lorenc said.
pawn Код:
#define DIALOG_JOBS 1337
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;
}
SA-MP Wiki and forum search will also help you a lot, as lorenc said.

