Dialog help request
#1

So, Now I've got a list to show up, but I've tried different scripts and can't get a response. Please help.

pawn Код:
//Bait-Car prototype

#define FILTERSCRIPT

#include <a_samp>

new BC1;
new BC2;
new BC3;
new BC4;
new BC5;
new BC6;

#define DIALOG_BCLIST 750

public OnVehicleDeath(vehicleid, killerid)
{
    DestroyVehicle(BC1);
    DestroyVehicle(BC2);
    DestroyVehicle(BC3);
    DestroyVehicle(BC4);
    DestroyVehicle(BC5);
    DestroyVehicle(BC6);
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(IsPlayerAdmin(playerid))
    {
        if (strcmp("/BC", cmdtext, true)==0)
        {
            SendClientMessage(playerid, 0x00FFFFFF, "Commands: Huntley = /BC1 | Turismo = /BC2 | Sultan = /BC3");
            SendClientMessage(playerid, 0x00FFFFFF, "Commands: Buffalo = /BC4 | Patriot = /BC5 | Jetmax (boat) = /BC6 ");
            SendClientMessage(playerid, 0x00FFFFFF, "Commands: /DIS -Disable the Bait-Car's motor, bringing the car to a stop.");
            return 1;
        }
        if (!strcmp("/BCL", cmdtext, true))
        {
            ShowPlayerDialog(playerid,750, DIALOG_STYLE_LIST, "Available Bait-Cars", "Huntley", "Select", "Cancel");
            return 1;
        }
        //I want all this info to be put into the dialog, but I only need the first one fixed as a demo
        /*if (strcmp("/BC1", cmdtext, true)==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;
        }
        if (strcmp("/BC2", cmdtext, true)==0)
        {
            SendClientMessage(playerid, 0x00FFFFFF, "Bait-Car 2 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);
            BC2=CreateVehicle(451, x, y, z,a, -1, -1, -1);
            PutPlayerInVehicle(playerid, BC2, 0);
            return 1;
        }
        if (strcmp("/BC3", cmdtext, true)==0)
        {
            SendClientMessage(playerid, 0x00FFFFFF, "Bait-Car 3 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;
            GetPlayerPos(playerid,x,y,z);
            GetPlayerFacingAngle(playerid,a);
            BC3=CreateVehicle(560, x, y, z,a, -1, -1, -1);
            PutPlayerInVehicle(playerid, BC3, 0);
            return 1;
        }
        if  (strcmp("/BC4", cmdtext, true)==0)
        {
            SendClientMessage(playerid, 0x00FFFFFF, "Bait-Car 4 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;
            GetPlayerPos(playerid,x,y,z);
            GetPlayerFacingAngle(playerid,a);
            BC4=CreateVehicle(402, x, y, z,a, -1, -1, -1);
            PutPlayerInVehicle(playerid, BC4, 0);
            return 1;
        }
        if  (strcmp("/BC5", cmdtext, true)==0)
        {
            SendClientMessage(playerid, 0x00FFFFFF, "Bait-Car 5 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;
            GetPlayerPos(playerid,x,y,z);
            GetPlayerFacingAngle(playerid,a);
            BC5=CreateVehicle(470, x, y, z,a, -1, -1, -1);
            PutPlayerInVehicle(playerid, BC5, 0);
            return 1;
        }
        if  (strcmp("/BC6", cmdtext, true)==0)
        {
            SendClientMessage(playerid, 0x00FFFFFF, "Bait-Car 6 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;
            GetPlayerPos(playerid,x,y,z);
            GetPlayerFacingAngle(playerid,a);
            BC6=CreateVehicle(493, x, y, z,a, -1, -1, -1);
            PutPlayerInVehicle(playerid, BC6, 0);
            return 1;
        }
        if (strcmp("/DIS", cmdtext, true)==0)
        {
            SendClientMessage(playerid, 0x00FFFFFF, "Bait-Car Disabled.");
            SetVehicleParamsEx(BC1, 0, 1, 0, 1, 0, 0, 0);
            SetVehicleParamsEx(BC2, 0, 1, 0, 1, 0, 0, 0);
            SetVehicleParamsEx(BC3, 0, 1, 0, 1, 0, 0, 0);
            SetVehicleParamsEx(BC4, 0, 1, 0, 1, 0, 0, 0);
            SetVehicleParamsEx(BC5, 0, 1, 0, 1, 0, 0, 0);
            SetVehicleParamsEx(BC6, 0, 1, 0, 1, 0, 0, 0);
            return 1;
        }*/

    }
    else
    {
        SendClientMessage(playerid, 0x00FFFF, "You must be an admin/police.");
        return 1;
    }
    return 0;
}
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;
                }
            }
        }
    }
    return 0;
}
And here's another that I thought might fix it, but no.

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_BCLIST)
    {
        new Float:x,Float:y,Float:z,Float:a;
        DestroyVehicle(BC1);
        DestroyVehicle(BC2);
        DestroyVehicle(BC3);
        DestroyVehicle(BC4);
        DestroyVehicle(BC5);
        DestroyVehicle(BC6);
        GetPlayerFacingAngle(playerid,a);
        GetPlayerPos(playerid,x,y,z);
        if(response)
        {
            switch(listitem)
            {
                case 0:
                {
                    SendClientMessage(playerid, 0x00FFFFFF, "Bait-Car 1 Initiated, find a spot to park it.");
                    BC1=CreateVehicle(579, x, y, z,a, -1, -1, -1);
                    PutPlayerInVehicle(playerid, BC1, 0);
                    return 1;
                }
            }
        }
    }
    return 0;
}
Reply
#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
#3

Still a "no-go", the list fails to show up. Here's my entire code, maybe there's a problem with it.

pawn Код:
//Bait-Car prototype

#define FILTERSCRIPT

#include <a_samp>

new BC1;
new BC2;
new BC3;
new BC4;
new BC5;
new BC6;

#define DIALOG_BCLIST 98989

public OnVehicleDeath(vehicleid, killerid)
{
    DestroyVehicle(BC1);
    DestroyVehicle(BC2);
    DestroyVehicle(BC3);
    DestroyVehicle(BC4);
    DestroyVehicle(BC5);
    DestroyVehicle(BC6);
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(IsPlayerAdmin(playerid))
    {
        if (strcmp("/BC", cmdtext, true)==0)
        {
            SendClientMessage(playerid, 0x00FFFFFF, "Commands: Huntley = /BC1 | Turismo = /BC2 | Sultan = /BC3");
            SendClientMessage(playerid, 0x00FFFFFF, "Commands: Buffalo = /BC4 | Patriot = /BC5 | Jetmax (boat) = /BC6 ");
            SendClientMessage(playerid, 0x00FFFFFF, "Commands: /DIS -Disable the Bait-Car's motor, bringing the car to a stop.");
            return 1;
        }
        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;
        }
        //I want all this info to be put into the dialog, but I only need the first one fixed as a demo
        /*if (strcmp("/BC1", cmdtext, true)==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;
        }
        if (strcmp("/BC2", cmdtext, true)==0)
        {
            SendClientMessage(playerid, 0x00FFFFFF, "Bait-Car 2 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);
            BC2=CreateVehicle(451, x, y, z,a, -1, -1, -1);
            PutPlayerInVehicle(playerid, BC2, 0);
            return 1;
        }
        if (strcmp("/BC3", cmdtext, true)==0)
        {
            SendClientMessage(playerid, 0x00FFFFFF, "Bait-Car 3 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;
            GetPlayerPos(playerid,x,y,z);
            GetPlayerFacingAngle(playerid,a);
            BC3=CreateVehicle(560, x, y, z,a, -1, -1, -1);
            PutPlayerInVehicle(playerid, BC3, 0);
            return 1;
        }
        if  (strcmp("/BC4", cmdtext, true)==0)
        {
            SendClientMessage(playerid, 0x00FFFFFF, "Bait-Car 4 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;
            GetPlayerPos(playerid,x,y,z);
            GetPlayerFacingAngle(playerid,a);
            BC4=CreateVehicle(402, x, y, z,a, -1, -1, -1);
            PutPlayerInVehicle(playerid, BC4, 0);
            return 1;
        }
        if  (strcmp("/BC5", cmdtext, true)==0)
        {
            SendClientMessage(playerid, 0x00FFFFFF, "Bait-Car 5 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;
            GetPlayerPos(playerid,x,y,z);
            GetPlayerFacingAngle(playerid,a);
            BC5=CreateVehicle(470, x, y, z,a, -1, -1, -1);
            PutPlayerInVehicle(playerid, BC5, 0);
            return 1;
        }
        if  (strcmp("/BC6", cmdtext, true)==0)
        {
            SendClientMessage(playerid, 0x00FFFFFF, "Bait-Car 6 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;
            GetPlayerPos(playerid,x,y,z);
            GetPlayerFacingAngle(playerid,a);
            BC6=CreateVehicle(493, x, y, z,a, -1, -1, -1);
            PutPlayerInVehicle(playerid, BC6, 0);
            return 1;
        }
        if (strcmp("/DIS", cmdtext, true)==0)
        {
            SendClientMessage(playerid, 0x00FFFFFF, "Bait-Car Disabled.");
            SetVehicleParamsEx(BC1, 0, 1, 0, 1, 0, 0, 0);
            SetVehicleParamsEx(BC2, 0, 1, 0, 1, 0, 0, 0);
            SetVehicleParamsEx(BC3, 0, 1, 0, 1, 0, 0, 0);
            SetVehicleParamsEx(BC4, 0, 1, 0, 1, 0, 0, 0);
            SetVehicleParamsEx(BC5, 0, 1, 0, 1, 0, 0, 0);
            SetVehicleParamsEx(BC6, 0, 1, 0, 1, 0, 0, 0);
            return 1;
        }*/

    }
    else
    {
        SendClientMessage(playerid, 0x00FFFF, "You must be an admin/police.");
        return 1;
    }
    return 0;
}
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;
                }
            }
        }
    }
    return 0;
}
Reply
#4

.......
Reply
#5

See the post before this one, it's the up to date one lol
Reply
#6

Oh lol. I didn't get your question. You want every command to be in dialog responses?

Please elaborate.
Reply
#7

Quote:
Originally Posted by Goldilox
Посмотреть сообщение
Oh lol. I didn't get your question. You want every command to be in dialog responses?

Please elaborate.
As you see the first command is /BC1, but instead of using commands, I just want that to be the first item in the dialog list. so I'm basically just wanting to move the code bits under the list items. Make sense? But the list fails to show up, so I get nowhere lol

So the first item in the list would be Huntley, when clicked, it would spawn a huntley bait car, or BC1 with all the specs, hypothetically of course. Because using commands is a bit less professional for wanting this to be on public servers.

Is the problem the Admin login?

EDIT: Nope, that's not the problem

EDIT2: tinkered around a bit and I think my dialog id was too big to process, I now get the list to pop up, but no response. Working on it!
Reply
#8

Yeah, no response
Reply
#9

pawn Код:
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;
                }
            }
        }
    }
    return 0;  //<-----change this to return 1;
}
Reply
#10

Quote:
Originally Posted by drichie
Посмотреть сообщение
pawn Код:
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;
                }
            }
        }
    }
    return 0;  //<-----change this to return 1;
}
Nope, that didn't work. Still no response, but is there anything else I could try?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)