Vehicle Purchase Dialogs (Self confused :P)
#1

Hello fellow scripters,
I was wondering if there was a shorter way around working my dialogs for my vehicle purchase system.

Currently i have a feeling i am doing this the very long way :P

Vehicle List
> Chosen Vehicle Description and Price
>Primary Colour
-Red
-Blue
-Yellow
-Green...
>Secondary Colour
-Red
-Blue
-Yellow
-Green...
>Purchase Confirmation(Basically a sum up).

This is basically what i have.
I am going to use a Stretch with Red as the Primary and Black as the Secondary Colour.


pawn Код:
ShowPlayerDialog(playerid, 100, DIALOG_STYLE_LIST, "Vehicle Catalogue", "Stretch\r\nCheetah\r\nAdmiral\r\nFeltzer\r\nHuntley\r\nBanshee\r\nBuffalo...
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");
                }...
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");
            }
        }

        case 102://Cheetah
        {
            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");
            }
        }

        case 103://Admiral
        {
            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");
            }
        }
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");
                }
                case 1://Blue
                {
                    ShowPlayerDialog(playerid, 125, 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");
                }...
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");
            }
            switch(listitem)
            {
                ShowPlayerDialog(playerid, 151, DIALOG_STYLE_LIST, "Secondary Vehicle Colour", "{FF0000}||||||\r\n{00FF00}||||||", "Continue", "Back");
            }
        }
And now i just confused my self...


Okay well i want you to be able to select the vehicle you want, select the colours you want and then click proceed and it will spawn the car at the set location...


Sorry about all the bull**** above that
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)