SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 21/11/2017, 08:47 PM   #1
jasperschellekens
Gangsta
 
jasperschellekens's Avatar
 
Join Date: Dec 2016
Location: Holland
Posts: 996
Reputation: 92
Default Ondialogresponse

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.

Code:
  	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
jasperschellekens is offline   Reply With Quote
Old 22/11/2017, 06:11 PM   #2
jasperschellekens
Gangsta
 
jasperschellekens's Avatar
 
Join Date: Dec 2016
Location: Holland
Posts: 996
Reputation: 92
Default Re: Ondialogresponse

bump
jasperschellekens is offline   Reply With Quote
Old 23/11/2017, 11:45 AM   #3
L97
Little Clucker
 
Join Date: Nov 2017
Posts: 10
Reputation: 3
Default Re: Ondialogresponse

Not sure if I understood on which dialog you'd like it to be displayed, but anyways..
Quote:
Originally Posted by jasperschellekens View Post
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:
Code:
	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.
L97 is offline   Reply With Quote
Old 23/11/2017, 01:47 PM   #4
jasperschellekens
Gangsta
 
jasperschellekens's Avatar
 
Join Date: Dec 2016
Location: Holland
Posts: 996
Reputation: 92
Default Re: Ondialogresponse

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?
jasperschellekens is offline   Reply With Quote
Old 23/11/2017, 05:38 PM   #5
L97
Little Clucker
 
Join Date: Nov 2017
Posts: 10
Reputation: 3
Default Re: Ondialogresponse

Quote:
Originally Posted by jasperschellekens View Post
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
L97 is offline   Reply With Quote
Old 23/11/2017, 06:00 PM   #6
LazzyBoy
Big Clucker
 
Join Date: Mar 2017
Posts: 191
Reputation: 13
Default Re: Ondialogresponse

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
__________________
LazzyBoy is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
OnDialogResponse maksicnm Scripting Help 8 26/10/2017 06:17 PM
OnDialogResponse long76 Русский/Russian 5 31/03/2015 11:37 AM
OnDialogResponse DangerSta Scripting Help 9 09/11/2014 08:20 AM
OnDialogResponse Pb +rep AYOUYOU Scripting Help 8 02/11/2014 09:28 PM
OnDialogResponse MrCallum Scripting Help 3 25/09/2014 02:26 AM


All times are GMT. The time now is 06:37 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.