SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 16/04/2018, 04:00 PM   #1
BrightLeaN
Little Clucker
 
Join Date: Feb 2018
Posts: 10
Reputation: 0
Default Dialog wont work right

Hey,

i createt a dialog with response and stuff but when the dialog is open it should close when i press "ESC" or when i click on the second button what did i wrong?

HTML Code:
ocmd:navi(playerid,params[])
{
	ShowPlayerDialog(playerid, DIALOG_NAVI1, DIALOG_STYLE_LIST, "Navigationssystem", "•List 1\n•List 2\nList 3", "Choose this", "cancel");
	return 1;
}
HTML Code:
	if(dialogid == DIALOG_NAVI1)
	switch(listitem)
	{
		case 0:
		{
      		ShowPlayerDialog(playerid, DIALOG_NAVI2, DIALOG_STYLE_LIST, "Navigationssystem", "•alist1\n•alist2\n•alist3", "choose", "cancel");
		}
		case 1:
  		{
		}
		case 2:
		{
		}
		case 3:
  		{
		}
	}
When i press on cancel it is choosing the one and when i press ESC it is choosing to.
BrightLeaN is offline   Reply With Quote
Old 16/04/2018, 04:20 PM   #2
UFF
Big Clucker
 
Join Date: Feb 2018
Posts: 104
Reputation: 7
Default Re: Dialog wont work right

Code:
case DIALOG_NAVI1:
{
    if(response)
    {
	switch(listitem)
	{
		case 0:
		{
      		ShowPlayerDialog(playerid, DIALOG_NAVI2, DIALOG_STYLE_LIST, "Navigationssystem", "•alist1\n•alist2\n•alist3", "choose", "cancel");
		}
		case 1:
  		{
		}
		case 2:
		{
		}
		case 3:
  		{
		}
            }
        }
 }
UFF is offline   Reply With Quote
Old 16/04/2018, 04:29 PM   #3
BrightLeaN
Little Clucker
 
Join Date: Feb 2018
Posts: 10
Reputation: 0
Default Re: Dialog wont work right

Thanks U!
BrightLeaN is offline   Reply With Quote
Old 16/04/2018, 04:35 PM   #4
UFF
Big Clucker
 
Join Date: Feb 2018
Posts: 104
Reputation: 7
Default Re: Dialog wont work right

Quote:
Originally Posted by BrightLeaN View Post
Thanks U!
Anytime, instead of DIALOG_NAVI2 you can also you DIALOG_NAVI+1, DIALOG_NAVI+2 and so on for ez life!
UFF is offline   Reply With Quote
Old 16/04/2018, 05:56 PM   #5
jasperschellekens
Gangsta
 
jasperschellekens's Avatar
 
Join Date: Dec 2016
Location: Gehenna
Posts: 567
Reputation: 31
Default Re: Dialog wont work right

Quote:
Originally Posted by UFF View Post
Anytime, instead of DIALOG_NAVI2 you can also you DIALOG_NAVI+1, DIALOG_NAVI+2 and so on for ez life!
Exactly, and this means you only have to define it once.

Code:
#define dialog 1000

if(dialogid == dialog)
if(dialogid == dialog+1)
if(dialogid == dialog+2)
__________________
Offering php and pawn scripts against payment. PM me.

[Filterscripts] SQLlite - Jaspers Pin Code Script - Additional security.
[Filterscripts] Jasper's Woodcutting job/skill with levels and XP. Custom map
[Filterscripts] Simple trucking filterscript
jasperschellekens is online now   Reply With Quote
Old 16/04/2018, 06:25 PM   #6
kovac
Huge Clucker
 
kovac's Avatar
 
Join Date: Mar 2018
Posts: 280
Reputation: 3
Default Re: Dialog wont work right

PHP Code:
// Make sure to define each dialog with a unique number
#define DIALOG_NAVI1 1
#define DIALOG_NAVI2 2


ocmd:navi(playerid,params[])
{
    
ShowPlayerDialog(playeridDIALOG_NAVI1DIALOG_STYLE_LIST"Navigation system""•List 1\n•List 2\n•List 3""Choose""Cancel");
    return 
1;
}

// OnDialogResponse
if(dialogid == DIALOG_NAVI1)
{
    if(
response// if user selected something
    
{
        switch(
listitem)
        {
            case 
0// User has selected the 1st item in list from DIALOG_NAVI1
            
{
                  
ShowPlayerDialog(playeridDIALOG_NAVI2DIALOG_STYLE_LIST"Navigation system""•alist1\n•alist2\n•alist3""Choose""Cancel");
            }
            case 
1// User has selected the 2nd item in list from DIALOG_NAVI1
            
{
                  
// do something
            
}
            case 
2// User has selected the 3rd item in list from DIALOG_NAVI1
            
{
                  
// do something
            
}
        }
    }
}
if(
dialogid == DIALOG_NAVI2)
{
    if(
response)
    {
        switch(
listitem)
        {
            case 
0SendClientMessage(playerid, -1"1. item selected");
            case 
1SendClientMessage(playerid, -1"2. item selected");
            case 
2SendClientMessage(playerid, -1"3. item selected");
        }
    }

kovac 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
Dialog wont work, help ! tuuler Scripting Help 3 24/09/2013 03:44 PM
Dialog fs's wont work at the same time NicholasA Scripting Help 3 15/01/2013 04:55 PM
Dialog wont showup if i put strings in the dialog description help me Safe Scripting Help 1 30/12/2012 03:58 PM
5th dialog wont work. rep + oscar7610 Scripting Help 4 01/05/2012 06:18 PM
dialog response wont work hadzx Help Archive 2 26/01/2011 12:40 PM


All times are GMT. The time now is 01:27 PM.


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