else problem! - 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: else problem! (
/showthread.php?tid=607810)
else problem! -
Fantje - 24.05.2016
Heey,
I made a dialog:
PHP код:
if(dialogid == 444)
{
if(listitem == 0)
{
if(response) // If they clicked 'Yes' or pressed enter
{
ShowPlayerDialog(playerid, DIALOG_CLASS_ASSAULT, DIALOG_STYLE_MSGBOX, "Assault Class", "The Assault Class is the most common used class by a lot of swat and terrorits.\n\n{FF8000}Abilities: {AFAFAF}This class is upgradable.\n This class has many featers available at further levels, such as extra weapon damage, rocket launcher and more!\n\n{FF8000}Weapons: {AFAFAF}Knife, Desert Eagle, M4, Grenades", "Choose","<< Back");
}
else
{
ShowPlayerDialog(playerid, DIALOG_CLASS, DIALOG_STYLE_TABLIST_HEADERS, "Class Selection", "Class Name\tRequirements\nAssault\t0 score\nRECON\t500 score\nEngineer\t800 score\nMedic\t1100 score\nSniper\t1250 scores\nPilot\t1700 score\nRambo\t2000 score\nSpy\t4000 score\nCustom Class\tVIP Status", "View", "");
}
}
return 1; // We handled a dialog, so return 1. Just like OnPlayerCommandText.
}
return 0; // You MUST return 0 here! Just like OnPlayerCommandText.
}
So I told if the player clicks on << Back button in the message dialog,
the tablist dialog will show up.
But, if I click on << Back it will close the whole dialog.
I want that if the player pick an option in the first dialog (id 444), the message dialog show up (that works) and if they click << Back, that they will show up tablist dialog again.
Please help me.
Re: else problem! -
Slawiii - 24.05.2016
post Dialog Response of DIALOG_CLASS_ASSAULT
Re: else problem! -
Fantje - 24.05.2016
PHP код:
ShowPlayerDialog(playerid, DIALOG_CLASS_ASSAULT, DIALOG_STYLE_MSGBOX, "Assault Class", "The Assault Class is the most common used class by a lot of swat and terrorits.\n\n{FF8000}Abilities: {AFAFAF}This class is upgradable.\n This class has many featers available at further levels, such as extra weapon damage, rocket launcher and more!\n\n{FF8000}Weapons: {AFAFAF}Knife, Desert Eagle, M4, Grenades", "Choose","<< Back");
Re: else problem! -
Slawiii - 24.05.2016
add this under OnDialogResponse
PHP код:
if(dialogid == DIALOG_CLASS_ASSAULT)
{
if(!response) return ShowPlayerDialog(playerid, DIALOG_CLASS, DIALOG_STYLE_TABLIST_HEADERS, "Class Selection", "Class Name\tRequirements\nAssault\t0 score\nRECON\t500 score\nEngineer\t800 score\nMedic\t1100 score\nSniper\t1250 scores\nPilot\t1700 score\nRambo\t2000 score\nSpy\t4000 score\nCustom Class\tVIP Status", "View", "");
}
Re: else problem! -
Dayrion - 24.05.2016
If I correctly understand your application:
PHP код:
if(dialogid == 444)
{
if(listitem == 0)
{
if(response) // If they clicked 'Yes' or pressed enter
{
ShowPlayerDialog(playerid, DIALOG_CLASS_ASSAULT, DIALOG_STYLE_MSGBOX, "Assault Class", "The Assault Class is the most common used class by a lot of swat and terrorits.\n\n{FF8000}Abilities: {AFAFAF}This class is upgradable.\n This class has many featers available at further levels, such as extra weapon damage, rocket launcher and more!\n\n{FF8000}Weapons: {AFAFAF}Knife, Desert Eagle, M4, Grenades", "Choose","<< Back");
}
else
{
ShowPlayerDialog(playerid, DIALOG_CLASS, DIALOG_STYLE_TABLIST_HEADERS, "Class Selection", "Class Name\tRequirements\nAssault\t0 score\nRECON\t500 score\nEngineer\t800 score\nMedic\t1100 score\nSniper\t1250 scores\nPilot\t1700 score\nRambo\t2000 score\nSpy\t4000 score\nCustom Class\tVIP Status", "View", "");
}
}
return 1; // We handled a dialog, so return 1. Just like OnPlayerCommandText.
}
if(dialogid == DIALOG_CLASS_ASSAULT)
{
if(response == 0)
{
ShowPlayerDialog(playerid, 444, DIALOG_STYLE_TABLIST_HEADERS, "Class Selection", "Class Name\tRequirements\nAssault\t0 score\nRECON\t500 score\nEngineer\t800 score\nMedic\t1100 score\nSniper\t1250 scores\nPilot\t1700 score\nRambo\t2000 score\nSpy\t4000 score\nCustom Class\tVIP Status", "View", "");
}
return 1;
}
return 0; // You MUST return 0 here! Just like OnPlayerCommandText.
}