Two Questions
#1

1. I made a dialog that shows all the cars a play owns and i want to make it so when they click a car it shows the stats of that car. How would i do so?

Current dialog and car enums
pawn Код:
new vehicleDialog[500];

for(new vehicleIndex; vehicleIndex < MAX_VEHICLES; vehicleIndex++)
{
    if(strcmp(GetName(playerid), pCar[vehicleIndex][OVowner] == false)
    {
        format(vehicleDialog, sizeof(vehicleDialog), "%sID: %d Model:%s\n", vehicleDialog, vehicleIndex, pCar[vehicleIndex][OVname]);
    }
}

ShowPlayerDialog(playerid, DIALOG_CARS, DIALOG_STYLE_LIST, "Your Vehicles", vehicleDialog, "Select", "Close");enum pCarData
{
    OVid,
    OVmodel,
    OVname[30],
    OVsellback,
    OVowner[30],
    OVistrailer,
    Float:OVx,
    Float:OVy,
    Float:OVz,
    Float:OVa,
    OVcolor1,
    OVcolor2,
    Com0,
    Com1,
    Com2,
    Com3,
    Com4,
    Com5,
    Com6,
    Com7,
    Com8,
    Com9,
    Com10,
    Com11,
    Com12,
    Com13
};
new pCar[MAX_VEHICLES][pCarData];
2. I made a car dealer dialog. For some reason, when i click cancel it treats it as case 0: and buys the car in that case. How do i fix that?

pawn Код:
ShowPlayerDialog(playerid,500, DIALOG_STYLE_LIST, "Shody Used Autos", "Admiral $90000\nClover $130000\nBravura $90000\nBuccaneer $170000\nPatriot $260000\nStallion $190000\nJester $130000\nPhoenix $230000\nBroadway $117000\nTahoma $115000\nTornado $100000\nStratum $85000\nHermes $105000\nFortune $90000\nCadrona $97000\nVincent $85000\nIntruder $82000\nPrimo $80000\nTaxi $170000", "Buy", "Cancel");

    if(dialogid==500)
    {
        switch(listitem)
        {
            case 0: BuyVehicle(playerid,445,90000,"Admiral",1667.6368,1797.4969,11.1730,2.7598,"Shody Used Autos");
            case 1: BuyVehicle(playerid,542,130000,"Clover",1667.6368,1797.4969,11.1730,2.7598,"Shody Used Autos");
            case 2: BuyVehicle(playerid,401,90000,"Bravura",1667.6368,1797.4969,11.1730,2.7598,"Shody Used Autos");
            case 3: BuyVehicle(playerid,518,170000,"Buccaneer",1667.6368,1797.4969,11.1730,2.7598,"Shody Used Autos");
            case 4: BuyVehicle(playerid,470,260000,"Patriot",1667.6368,1797.4969,11.1730,2.7598,"Shody Used Autos");
            case 5: BuyVehicle(playerid,439,190000,"Stallion",1667.6368,1797.4969,11.1730,2.7598,"Shody Used Autos");
            case 6: BuyVehicle(playerid,559,130000,"Jester",1667.6368,1797.4969,11.1730,2.7598,"Shody Used Autos");
            case 7: BuyVehicle(playerid,603,230000,"Phoenix",1667.6368,1797.4969,11.1730,2.7598,"Shody Used Autos");
            case 8: BuyVehicle(playerid,575,117000,"Broadway",1667.6368,1797.4969,11.1730,2.7598,"Shody Used Autos");
            case 9: BuyVehicle(playerid,566,115000,"Tahoma",1667.6368,1797.4969,11.1730,2.7598,"Shody Used Autos");
            case 10: BuyVehicle(playerid,576,100000,"Tornado",1667.6368,1797.4969,11.1730,2.7598,"Shody Used Autos");
            case 11: BuyVehicle(playerid,561,85000,"Stratum",1667.6368,1797.4969,11.1730,2.7598,"Shody Used Autos");
            case 12: BuyVehicle(playerid,474,105000,"Hermes",1667.6368,1797.4969,11.1730,2.7598,"Shody Used Autos");
            case 13: BuyVehicle(playerid,526,90000,"Fortune",1667.6368,1797.4969,11.1730,2.7598,"Shody Used Autos");
            case 14: BuyVehicle(playerid,527,97000,"Cadrona",1667.6368,1797.4969,11.1730,2.7598,"Shody Used Autos");
            case 15: BuyVehicle(playerid,540,85000,"Vincent",1667.6368,1797.4969,11.1730,2.7598,"Shody Used Autos");
            case 16: BuyVehicle(playerid,546,82000,"Intruder",1667.6368,1797.4969,11.1730,2.7598,"Shody Used Autos");
            case 17: BuyVehicle(playerid,547,80000,"Primo",1667.6368,1797.4969,11.1730,2.7598,"Shody Used Autos");
            case 18: BuyVehicle(playerid,420,170000,"Taxi",1667.6368,1797.4969,11.1730,2.7598,"Shody Used Autos");
        }
    }
Reply
#2

=Bump=
Reply
#3

=Bump=
Not trying to be abnoxious but i really cant solve these two issues. Is there anyone who cant help me at all?
Reply
#4

For your second question:

https://sampwiki.blast.hk/wiki/OnDialogResponse

Use response for the left button, !response for the right one
Reply
#5

Quote:
Originally Posted by Snipa
Посмотреть сообщение
For your second question:

https://sampwiki.blast.hk/wiki/OnDialogResponse

Use response for the left button, !response for the right one
I feel dumb now lol. Thanks dude
Reply
#6

=Bump=
Anyone know the answer to the first one?
Reply
#7

I just sat here writing out a reply, then i realised how you could do it (possibly). Why don't you do it like a /stats command.

Format a string, where needed. Then attatch the correct enum to it. Like /stats

format(string,sizeof(string),"Kills: %d",PlayerInfo[playerid][Kills]);

Except you'd replace it && add where needed.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)