07.12.2010, 16:37
First, this is your OnPlayerCommandText:
Now, here is what happen when you choose Option1 / Option2 / Option3 ...
You can change Option1 / 2 / 3 ... to whatever option you want, it shows you the list,
then you need to modify it by OnDialogResponse by starting with case 0.
I hope it helps, If you need more help. talk with me...
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256];
new idx;
cmd = strtok(cmdtext, idx);
if(strcmp(cmd,"/help",true) == 0)
{
ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"List Dialog","1. Option1\r\n2. Option2\r\n3. Option3","Choose", "Cancel");
return 1;
}
return 1;
}
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(1)
{
case 1:
{
if(!response)
{
SendClientMessage(playerid, 0xFFFFFFAA, "You have cancelled!");
return 1;
}
switch(listitem)
{
case 0:
{
SendClientMessage(playerid, 0xFFFFFFAA, "You have chosen Option1!");
}
case 1:
{
SendClientMessage(playerid, 0xFFFFFFAA, "You have chosen Option2!");
}
case 2:
{
SendClientMessage(playerid, 0xFFFFFFAA, "You have chosen Option3!");
}
}
}
}
return 0;
}
then you need to modify it by OnDialogResponse by starting with case 0.
I hope it helps, If you need more help. talk with me...