SA-MP Forums Archive
Vehicle Purchasing Dialog. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Vehicle Purchasing Dialog. (/showthread.php?tid=338144)



Vehicle Purchasing Dialog. - Deal-or-die - 29.04.2012

Hey Hey,
Since my last post failed i'll try writing this a little bit clearer

This is what i currently have:
So far i have a dialog menu that once typed /buyvehicle this list of vehicles appears.
If you click on a vehicle it takes you too the vehicles description and price Dialog.
If you choose to continue it takes you to the Vehicle 'Primary Colour' dialog

This is what i want:
I want the 'Primary Colour' dialog to save the selection while you continue to the 'Secondary Colour' dialog.
Once the 'Secondary Colour' has been selected i want the vehicle to be spawned at a set location (Yes i have the cords)


Command '/buyvehicle'

pawn Код:
ShowPlayerDialog(playerid, 100, DIALOG_STYLE_LIST, "Vehicle Catalogue", "Stretch\r\nCheetah\r\nAdmiral\r\nFeltzer\r\nHuntley\r\nBanshee\r\nBuffalo...
Vehicle Price and Description - Displays the Price and Description on the selected vehicle
pawn Код:
case 100:
        {
            if(!response)
            {
                return 1;
            }
           
            switch(listitem)
            {
                case 0://Stretch
                {
                    ShowPlayerDialog(playerid, 101, DIALOG_STYLE_MSGBOX, "Vehicle Information", "Price:\n $275,555\n\nDescription:\n An American Stretch Limousine designed for comfort and style.\n Perfect for a high income business.","Continue","Back");
                }
                case 1://Cheetah
                {
                    ShowPlayerDialog(playerid, 102, DIALOG_STYLE_MSGBOX, "Vehicle Information", "Price:\n $550,000\n\nDescription:\n An Italian designed and manufactured supercar.\n Perfect for the wealthy who are inspired by a little bit of style","Continue","Back");
                }
                case 2://Admiral
                {
                    ShowPlayerDialog(playerid, 103, DIALOG_STYLE_MSGBOX, "Vehicle Information", "Price:\n $\n\nDescription:","Continue","Back");
                }...
If the player chose to Continue it would show you the Primary Colour Dialog otherwise it would return you back to the 'Vehicle List'
pawn Код:
case 101://Stretch
        {
            if(!response)
            {
                ShowPlayerDialog(playerid, 100, DIALOG_STYLE_LIST, "Vehicle Catalogue", "Stretch\r\nCheetah\r\nAdmiral\r\nFeltzer\r\nHuntley\r\nBanshee\r\nBuffalo\r\nComet\r\nSuper GT\r\nElegy\r\nTurismo\r\nAlpha\r\nEuros\r\nFlash\r\nJester\r\nZR-350\r\nElegant\r\nFortune\r\nSentinel\r\nStafford\r\nSultan\r\nWashington\r\nMerit","Continue","Cancel");
            }
            if(response)
            {
                ShowPlayerDialog(playerid, 150, DIALOG_STYLE_LIST, "Select a Primary vehicle colour", "{FF0000}||||||\r\n{00FF00}||||||\r\n{0000FF}||||||\r\n{FFFF00}||||||\r\n{00FFFF}||||||","Continue","Back");
            }
        }
Eh, self explanatory but the 'Primary Colour Table'
pawn Код:
case 150://Primary Colour Table
        {
            if(!response)
            {
                return 1;
            }
            switch(listitem)
            {
                case 0://Red
                {
                    ShowPlayerDialog(playerid, 124, DIALOG_STYLE_LIST, "Primary Colour: {FF0000}RED, Please choose Secondary Colour", "{FF0000}||||||\r\n{00FF00}||||||\r\n{0000FF}||||||\r\n{FFFF00}||||||\r\n{00FFFF}||||||","Continue","Back");
                }
            }
        }...
I wasn't sure how to do this so i was going to breakup all the colours separately and go from there but kinda confused my self at this point...
pawn Код:
case 124://RED
        {
            if(!response)
            {
                ShowPlayerDialog(playerid, 100, DIALOG_STYLE_LIST, "Vehicle Catalogue", "Stretch\r\nCheetah\r\nAdmiral\r\nFeltzer\r\nHuntley\r\nBanshee\r\nBuffalo\r\nComet\r\nSuper GT\r\nElegy\r\nTurismo\r\nAlpha\r\nEuros\r\nFlash\r\nJester\r\nZR-350\r\nElegant\r\nFortune\r\nSentinel\r\nStafford\r\nSultan\r\nWashington\r\nMerit","Continue","Cancel");
                return 1;
            }
            if(response)
            {
                ShowPlayerDialog(playerid, 151, DIALOG_STYLE_LIST, "Secondary Vehicle Colour", "{FF0000}||||||\r\n{00FF00}||||||", "Continue", "Back");
            }
        }
Ignore the colour IDs are wrong but thats just an example.


Re: Vehicle Purchasing Dialog. - warcodes_ - 29.04.2012

Some code would help.


Re: Vehicle Purchasing Dialog. - Deal-or-die - 29.04.2012

Yea, just added them, lemmi know what else you need


Re: Vehicle Purchasing Dialog. - warcodes_ - 29.04.2012

Under case 124: you are failing to switch listitem cases so when they click on anything in dialog id 124, nothing will happen(and/or it will trip out and think you clicked all the listitems), switch the listitem cases for each primary colour, then show the secondary colour dialog AFTER u set the primary colour variables, which then just continues what you are trying to do.


Re: Vehicle Purchasing Dialog. - Deal-or-die - 29.04.2012

Oh Ignore that i have already fixed that, i just copied the 'pawnocode' section from my old post but have updated all cases now.

So... what you are saying is make each colour it's own primary case?


Re: Vehicle Purchasing Dialog. - warcodes_ - 29.04.2012

Quote:
Originally Posted by Deal-or-die
Посмотреть сообщение
So... what you are saying is make each colour it's own primary case?
EDIT:

Yes, you have to, as your colour's are coded as listitem's.


Re: Vehicle Purchasing Dialog. - Deal-or-die - 29.04.2012

So for example, what i have done in case 124? with red? but with every colour?


Re: Vehicle Purchasing Dialog. - warcodes_ - 29.04.2012

You have not done it in case 124, but you have in case 150(EDIT: But i can only see 1 listitem in this case for RED)