Dialog help request
#2

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.
}
Reply


Messages In This Thread
Dialog help request part 2 - by Aerotactics - 30.06.2013, 23:54
Re: Dialog help request - by Goldilox - 01.07.2013, 00:08
Re: Dialog help request - by Aerotactics - 01.07.2013, 00:15
Re: Dialog help request - by Goldilox - 01.07.2013, 00:26
Re: Dialog help request - by Aerotactics - 01.07.2013, 00:29
Re: Dialog help request - by Goldilox - 01.07.2013, 00:39
Re: Dialog help request - by Aerotactics - 01.07.2013, 00:49
Re: Dialog help request - by Aerotactics - 01.07.2013, 01:46
Re: Dialog help request - by drichie - 01.07.2013, 02:18
Re: Dialog help request - by Aerotactics - 01.07.2013, 02:29

Forum Jump:


Users browsing this thread: 2 Guest(s)