i need help with...
#1

can some1 tell me how to make a dialog.for ex:a list with DIALOG_STYLE_LIST and then when an player choose option it shows them in a DIALOG_MSG_BOX.I have started plz help me continue.

Quote:

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/FAQ", cmdtext, true, 10) == 0)
{
ShowPlayerDialog(playerid, 999, DIALOG_STYLE_LIST, "Frequently Asked Questions", "Server Related Questions\nClasses Help\nCars & Houses\nAirlines\nAdminstartion, "Select", "Cancel");
return 1;
}

Reply
#2

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response == 1) //clicked first button
    {
        switch(dialogid)
        {
            case 1: //Your dialog - (case YourDialogID:)
            {
                switch(listitem)
                {
                    case 0: //the first listitem
                    {
                        ShowPlayerDialog(playerid,YOURDIALOG,DIALOG_STYLE_MSGBOX,"Header","Message","Button1","Button2");
                    }
                }
            }
        }
    }
if(response == 0) //clicked second button
    {
        switch(dialogid)
        {
            case 1: //your msgbox dialog
            {
                //DoWhateverYouWantHere
            }
        }
    }
    return 0;
}
Reply
#3

i get this message

code: http://pastebin.com/ANPdaW1C

Quote:

C:\Users\Jot\Desktop\FAQ.pwn(17) : error 001: expected token: "-string end-", but found "-identifier-"
C:\Users\Jot\Desktop\FAQ.pwn(17) : error 017: undefined symbol "Select"
C:\Users\Jot\Desktop\FAQ.pwn(17) : warning 215: expression has no effect
C:\Users\Jot\Desktop\FAQ.pwn(17) : error 001: expected token: ";", but found "-identifier-"
C:\Users\Jot\Desktop\FAQ.pwn(17) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

Reply
#4

Never tried Drebin's method, but it should be like this:

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(response == 1)
    {
        switch(dialogid)
        {
            case 0:
            {
               ShowPlayerDialog(listitem 1 stuff here);              
            }
            case 1:
            {
                ShowPlayerDialog(listitem 2 stuff here);  
            }
       }        
   }
}
Reply
#5

the error is in line 17.
Reply
#6

PHP код:
#define DIALOG_FAQ    1
public OnPlayerCommandText(playeridcmdtext[])
{
    if (
strcmp("/faq"cmdtexttrue10) == 0)
    {
        
ShowPlayerDialog(playeridDIALOG_FAQDIALOG_STYLE_LIST"Frequently Asked Questions""Server Related Questions\nClasses Help\nCars & Houses\nAirlines\nAdminstartion""Select""Cancel");
        return 
1;
    }
    return 
1;
}
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    case 
DIALOG_FAQ:
    {
        if(
response)
        {
            switch(
listitem)
             {
                case 
0:
                {
                    
//Server Related Questions
                
}
                case 
1:
                {
                    
//Classes Help
                
}
                case 
2:
                {
                    
//Cars & Houses
                
}
                case 
3:
                {
                    
//Airlines
                
}
            }
        }
    }
    return 
1;

Untested.
Reply
#7

the same error still exist on line 18 now cuz i added define #define DIALOG_FAQ 1
Reply
#8

Maybe look through GF edits and see how they did it, and it might give you an idea.
Reply
#9

Quote:
Originally Posted by Sil3nc3
Посмотреть сообщение
Maybe look through GF edits and see how they did it, and it might give you an idea.
i had already tried it
Reply
#10

Quote:
Originally Posted by jot16
Посмотреть сообщение
i had already tried it
You forgot a quotation at the end of Administration
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)