01.07.2013, 00:08
Try this way.
pawn Код:
#define DIALOG_BCLIST 98989
//Got my dialog
if (strcmp("/BCL", cmdtext, true)==0)
{
ShowPlayerDialog(playerid,DIALOG_BCLIST, DIALOG_STYLE_LIST, "Available Bait-Cars", "Huntley\nTurismo\nSultan\nBuffalo\nPatriot\nJetmax (boat)", "Select", "Cancel");
return 1;
}
//and got my response
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_BCLIST)
{
if(response)
{
switch(listitem)
{
case 0:
{
SendClientMessage(playerid, 0x00FFFFFF, "Bait-Car 1 Initiated, find a spot to park it.");
DestroyVehicle(BC1);
DestroyVehicle(BC2);
DestroyVehicle(BC3);
DestroyVehicle(BC4);
DestroyVehicle(BC5);
DestroyVehicle(BC6);
new Float:x,Float:y,Float:z,Float:a;
GetPlayerFacingAngle(playerid,a);
GetPlayerPos(playerid,x,y,z);
BC1=CreateVehicle(579, x, y, z,a, -1, -1, -1);
PutPlayerInVehicle(playerid, BC1, 0);
return 1;
}
case: 1 // They selected the second item - AK-47
{
}
case 2: // They selected the third item - Desert Eagle
{
}
}
return 1; // We handled a dialog, so return 1. Just like OnPlayerCommandText.
}
return 0; // You MUST return 0 here! Just like OnPlayerCommandText.
}