Ondialogresponse - 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: Ondialogresponse (
/showthread.php?tid=645181)
Ondialogresponse -
jasperschellekens - 21.11.2017
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
Re: Ondialogresponse -
jasperschellekens - 22.11.2017
bump
Re: Ondialogresponse -
L97 - 23.11.2017
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.
Re: Ondialogresponse -
jasperschellekens - 23.11.2017
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?
Re: Ondialogresponse -
L97 - 23.11.2017
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
Re: Ondialogresponse -
LazzyBoy - 23.11.2017
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