Ondialogresponse
#1

Hello,

I'm experimenting with something and trying to create a trucking script.
I am wondering if it is possible to only show which cargo the player did not pick.

Код:
  	if(dialogid == DIALOGTRUCKINGLSDOCK)
        {
                if(response)
                {
                        if(listitem == 0)
                        {
                                ShowPlayerDialog(playerid, DIALOGTRUCKINGLSDOCK+1, DIALOG_STYLE_LIST, "Select Cargo", "Pay n Spray Dillimore - Car Parts - 2800KG - $470\nGas Station Dillimore - Food - 4170KG - $595", "Select", "Cancel");
                        }
                }
                return 1;
        }
 	if(dialogid == DIALOGTRUCKINGLSDOCK+1)
        {
                if(response)
                {
                        if(listitem == 0)
                        {
							DillimorePayNSprayCargo[playerid]=1;
							SendClientMessage(playerid, YELLOW, "Cargo selected. Destination: Dillimore Pay n Spray");
                        }
                        if(listitem == 1)
                        {
                         DillimoreGasStationCargo[playerid]=1;
 							SendClientMessage(playerid, YELLOW, "Cargo selected. Destination: Dillimore Gas station");
                        }
                }
                return 1;
        }
Can i make it like this:
if DillimoreGasStationCargo[playerid] = set on 1 it does not display the dilimore gasstation cargo in the dialog menu.

Thanks in advance
Reply
#2

bump
Reply
#3

Not sure if I understood on which dialog you'd like it to be displayed, but anyways..
Quote:
Originally Posted by jasperschellekens
Посмотреть сообщение
Can i make it like this:
if DillimoreGasStationCargo[playerid] = set on 1 it does not display the dilimore gasstation cargo in the dialog menu.
Thanks in advance
If the dialog gets called right after the selection, you don't really need this, there's an easier way to do it:
Код:
	if(response)
	{
	    switch(listitem)
	    {
	        case 0: //DillimorePaynSpray selected
	        {
	            ShowPlayerDialog(playerid, DIALOGID, DIALOG_STYLE_LIST, "Select Cargo", "Gas Station Dillimore - Food - 4170KG - $595", "Select", "Cancel");
 		}
 		case 1: //DillimoreGasStation selected
 		{
 		    ShowPlayerDialog(playerid, DIALOGID, DIALOG_STYLE_LIST, "Select Cargo", "Pay n Spray Dillimore - Car Parts - 2800KG - $470", "Select", "Cancel");
		}
             }
         }
	return 1;
You're gonna have to put this in your dialog and change DIALOGID with the dialog you want to be displayed.
Reply
#4

Thank you for your message.
Actually what i mean is, if the player selects case 0.
How do i make the script hide case 0 for the player?
Reply
#5

Quote:
Originally Posted by jasperschellekens
Посмотреть сообщение
Thank you for your message.
Actually what i mean is, if the player selects case 0.
How do i make the script hide case 0 for the player?
I'm sorry I couldn't understand you, in what dialog do you want this to happen? After the selection I mean
Reply
#6

You will need a loop for the deliveries i think so you can check if player has done a route and not
if he done it you can skip the route from the loop and it will show the undone routes
thats how it should be done i think
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)