dialog problem
#1

When i will use the cars dialog (the last one ) its works cool but when im using the first one vipguns give me the first 2 cars NRG and sultan but also gives me and the guns i cant figure out what is the problem here.. :/

Here is the code:
pawn Код:
switch(dialogid)
    {
        case vipguns:
        {
            if(!response)
            {
                SendClientMessage(playerid, 0xFF0000FF, "You cancelled.");
                return 1;
            }
            switch(listitem)
            {
                case 0:
                {
                    GivePlayerWeapon(playerid, 36, 500);
                }
                case 1:
                {
                    GivePlayerWeapon(playerid, 26, 500);
                }
            }
        }
        case vippc:
        {
            if(!response)
            {
                SendClientMessage(playerid, 0xFF0000FF, "You cancelled.");
                return 1;
            }
            TogglePlayerControllable(playerid, 0);
            Camera[playerid] = listitem+1;
            SetPlayerCamera(playerid);
            }
        }
    switch(vipguns)
    {
        case vipguns:
        {
            if(!response)
            {
                SendClientMessage(playerid, 0xFF0000FF, "You cancelled.");
                return 1;
            }
            switch(listitem)
            {
                case 0:
                {
                    //NRG-500
                    new Float:x, Float:y, Float:z;
                    GetPlayerPos(playerid, Float:x, Float:y, Float:z);
                    new id = CreateVehicle(522, x, y, z, -1, 0, 0, -1);
                    PutPlayerInVehicle(playerid, id, 0);
                }
                case 1:
                {
                     //sultan
                     new Float:x, Float:y, Float:z;
                     GetPlayerPos(playerid, x, y, z);
                     new id = CreateVehicle(560, x, y, z, -1, -1, -1, -1);
                     PutPlayerInVehicle(playerid, id, 0);
                }
                case 2:
                {
                    //infernus
                    new Float:x, Float:y, Float:z;
                    GetPlayerPos(playerid, Float:x, Float:y, Float:z);
                    new id = CreateVehicle(411, x, y, z, -1, -1, -1, -1);
                    PutPlayerInVehicle(playerid, id, 0);
                }
                case 3:
                {
                    //turisimo
                    new Float:x, Float:y, Float:z;
                    GetPlayerPos(playerid, Float:x, Float:y, Float:z);
                    new id = CreateVehicle(451, x, y, z, -1, -1, -1, -1);
                    PutPlayerInVehicle(playerid, id, 0);
                }
                case 4:
                {
                    //Sabre
                    new Float:x, Float:y, Float:z;
                    GetPlayerPos(playerid, Float:x, Float:y, Float:z);
                    new id = CreateVehicle(475, x, y, z, -1, -1, -1, -1);
                    PutPlayerInVehicle(playerid, id, 0);
                }
                case 5:
                {
                    //comet
                    new Float:x, Float:y, Float:z;
                    GetPlayerPos(playerid, Float:x, Float:y, Float:z);
                    new id = CreateVehicle(480, x, y, z, -1, -1, -1, -1);
                    PutPlayerInVehicle(playerid, id, 0);
                }
                case 6:
                {
                    //Bullet
                    new Float:x, Float:y, Float:z;
                    GetPlayerPos(playerid, Float:x, Float:y, Float:z);
                    new id = CreateVehicle(541, x, y, z, -1, -1, -1, -1);
                    PutPlayerInVehicle(playerid, id, 0);
                }
                case 7:
                {
                    //Jester
                    new Float:x, Float:y, Float:z;
                    GetPlayerPos(playerid, Float:x, Float:y, Float:z);
                    new id = CreateVehicle(559, x, y, z, -1, -1, -1, -1);
                    PutPlayerInVehicle(playerid, id, 0);
                }
                case 8:
                {
                    //Elegy
                    new Float:x, Float:y, Float:z;
                    GetPlayerPos(playerid, Float:x, Float:y, Float:z);
                    new id = CreateVehicle(562, x, y, z, -1, -1, -1, -1);
                    PutPlayerInVehicle(playerid, id, 0);
                    }
                case 9:
                {
                    //Super GT
                    new Float:x, Float:y, Float:z;
                    GetPlayerPos(playerid, Float:x, Float:y, Float:z);
                    new id = CreateVehicle(506, x, y, z, -1, -1, -1, -1);
                    PutPlayerInVehicle(playerid, id, 0);
                }
            }
        }
    }
    return 1;
}
Thanks.
Reply
#2

GetPlayerPos is used this way.

pawn Код:
GetPlayerPos(playerid, x, y, z); //correct
GetPlayerPos(playerid, Float:x, Float:y, Float:z); //wrong
Take a look at this if you like: pVehicle 2.0
Reply
#3

dude its not problem that the problem is when i will choose gun gives me car ...
Reply
#4

Oh my bad, sorry.

Try this:
Add "vipcars" as another define for your ShowPlayerDialog(...vipcars...)

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
        case vipguns:
        {
            if(!response)
            {
                SendClientMessage(playerid, 0xFF0000FF, "You cancelled.");
                return 1;
            }
            switch(listitem)
            {
                case 0:
                {
                    GivePlayerWeapon(playerid, 36, 500);
                }
                case 1:
                {
                    GivePlayerWeapon(playerid, 26, 500);
                }
            }
        }
        case vippc:
        {
            if(!response)
            {
                SendClientMessage(playerid, 0xFF0000FF, "You cancelled.");
                return 1;
            } else {
                TogglePlayerControllable(playerid, 0);
                Camera[playerid] = listitem+1;
                SetPlayerCamera(playerid);
            }
        }
        case vipcars:
        {
            if(!response)
            {
                SendClientMessage(playerid, 0xFF0000FF, "You cancelled.");
                return 1;
            }
            switch(listitem)
            {
                case 0:
                {
                    //NRG-500
                    new Float:x, Float:y, Float:z;
                    GetPlayerPos(playerid, x, y, z);
                    new id = CreateVehicle(522, x, y, z, -1, 0, 0, -1);
                    PutPlayerInVehicle(playerid, id, 0);
                }
                case 1:
                {
                     //sultan
                     new Float:x, Float:y, Float:z;
                     GetPlayerPos(playerid, x, y, z);
                     new id = CreateVehicle(560, x, y, z, -1, -1, -1, -1);
                     PutPlayerInVehicle(playerid, id, 0);
                }
                case 2:
                {
                    //infernus
                    new Float:x, Float:y, Float:z;
                    GetPlayerPos(playerid, x, y, z);
                    new id = CreateVehicle(411, x, y, z, -1, -1, -1, -1);
                    PutPlayerInVehicle(playerid, id, 0);
                }
                case 3:
                {
                    //turisimo
                    new Float:x, Float:y, Float:z;
                    GetPlayerPos(playerid, x, y, z);
                    new id = CreateVehicle(451, x, y, z, -1, -1, -1, -1);
                    PutPlayerInVehicle(playerid, id, 0);
                }
                case 4:
                {
                    //Sabre
                    new Float:x, Float:y, Float:z;
                    GetPlayerPos(playerid, x, y, z);
                    new id = CreateVehicle(475, x, y, z, -1, -1, -1, -1);
                    PutPlayerInVehicle(playerid, id, 0);
                }
                case 5:
                {
                    //comet
                    new Float:x, Float:y, Float:z;
                    GetPlayerPos(playerid, x, y, z);
                    new id = CreateVehicle(480, x, y, z, -1, -1, -1, -1);
                    PutPlayerInVehicle(playerid, id, 0);
                }
                case 6:
                {
                    //Bullet
                    new Float:x, Float:y, Float:z;
                    GetPlayerPos(playerid, x, y, z);
                    new id = CreateVehicle(541, x, y, z, -1, -1, -1, -1);
                    PutPlayerInVehicle(playerid, id, 0);
                }
                case 7:
                {
                    //Jester
                    new Float:x, Float:y, Float:z;
                    GetPlayerPos(playerid, x, y, z);
                    new id = CreateVehicle(559, x, y, z, -1, -1, -1, -1);
                    PutPlayerInVehicle(playerid, id, 0);
                }
                case 8:
                {
                    //Elegy
                    new Float:x, Float:y, Float:z;
                    GetPlayerPos(playerid, x, y, z);
                    new id = CreateVehicle(562, x, y, z, -1, -1, -1, -1);
                    PutPlayerInVehicle(playerid, id, 0);
                    }
                case 9:
                {
                    //Super GT
                    new Float:x, Float:y, Float:z;
                    GetPlayerPos(playerid, x, y, z);
                    new id = CreateVehicle(506, x, y, z, -1, -1, -1, -1);
                    PutPlayerInVehicle(playerid, id, 0);
                }
            }
        }
    }
    return 1;
}
You switched "vipguns" twice in your code. and had some weird indentation.
Reply
#5

It works thanks man ! xD
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)