Dialogs Help
#1

Hello, i need some help about Dialogs.


I've created one dialog already, its piece of cake, but the problem for me is making new one.
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
   if(dialogid == DIALOG_guns){
      if(response){
         switch(listitem)
         {
         case 0:
         {
            GivePlayerWeapon(playerid, 24, 5000);
         }
         case 1:
         {
            GivePlayerWeapon(playerid, 22, 5000);
         }
         case 2:
         {
            GivePlayerWeapon(playerid, 25, 5000);
         }
         case 3:
         {
            GivePlayerWeapon(playerid, 27, 5000);
         }
         case 4:
         {
            GivePlayerWeapon(playerid, 29, 5000);
         }

            }
        }
    }
}
i Want to make another dialog script here, how could i make it?

I've copied all same, but i got alot of errors. please help

So i wanna have like 2 times this dialog public
pawn Код:
OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
   if(dialogid == DIALOG_guns){
      if(response){
         switch(listitem)
         {
         case 0:
         {
            GivePlayerWeapon(playerid, 24, 5000);
         }
         case 1:
         {
            GivePlayerWeapon(playerid, 22, 5000);
         }
         case 2:
         {
            GivePlayerWeapon(playerid, 25, 5000);
         }
         case 3:
         {
            GivePlayerWeapon(playerid, 27, 5000);
         }
         case 4:
         {
            GivePlayerWeapon(playerid, 29, 5000);
         }

            }
        }
    }
}
How to make another thingy?
(Sry for english)
I Want to make 2 Dialogs Responess, how to make it? could you give me PAWN of it,?
Thanks.
Repping all comments
Reply
#2

You want two dialogs?
Reply
#3

Yes please Like first one gives guns as i maked
second one gives you Skins
Reply
#4

oke gimme a sec
Reply
#5

Thank you, but not all skins like 10 skins most popular i want to make
Reply
#6

pawn Код:
//on top
#define DIALOG_guns 1
#define DIALOG_skins 2

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(response)
    {
        switch(dialogid)
        {
            case DIALOG_guns:
            {

                switch(listitem)
                {
                    case 0:
                    {
                        GivePlayerWeapon(playerid, 24, 5000);
                    }
                    case 1:
                    {
                        GivePlayerWeapon(playerid, 22, 5000);
                    }
                    case 2:
                    {
                        GivePlayerWeapon(playerid, 25, 5000);
                    }
                    case 3:
                    {
                        GivePlayerWeapon(playerid, 27, 5000);
                    }
                    case 4:
                    {
                        GivePlayerWeapon(playerid, 29, 5000);
                    }
                }
            }
            case DIALOG_skins:
            {

                switch(listitem)
                {
                    case 0:
                    {
                        //code here
                    }
                    case 1:
                    {
                        //code here
                    }
                    case 2:
                    {
                        //code here
                    }
                }
            }
        }
    }
    return 1;
}
You can just upgrade the cases evrey time, like you did with the weapons
Reply
#7

You are great, thank you! also repped
Reply
#8

No problem, and thanks
Reply
#9

I wouldn't put the if(response) at the beginning, I'd check the dialog first.
pawn Код:
//on top
#define DIALOG_guns
#define DIALOG_skins

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
        case DIALOG_guns:
        {
            if( response )
            {
                switch(listitem)
                {
                    case 0: return GivePlayerWeapon(playerid, 24, 5000);
                    case 1: return GivePlayerWeapon(playerid, 22, 5000);
                    case 2: return GivePlayerWeapon(playerid, 25, 5000);
                    case 3: return GivePlayerWeapon(playerid, 27, 5000);
                    case 4: return GivePlayerWeapon(playerid, 29, 5000);
                }
            }
            // else ... (optional)
        }
        case DIALOG_skins:
        {
            if( response )
            {
                // code;
                return 1;
            }
        }
    }
    return 1; // Return 0 for FilterScript OR 1 for Gamemode
}
Reply
#10

I'm done with it, but i get some errors.

Error
pawn Код:
D:\Server\gamemodes\BSJ.pwn(2460) : error 027: invalid character constant
D:\Server\gamemodes\BSJ.pwn(2460) : error 027: invalid character constant
Command at that line
pawn Код:
}
    if (strcmp("/gskins", cmdtext, true, 10) == 0)
    {
        SendClientMessage(playerid, civiliancolor, "Choose which G[Skin] You want!");
        ShowPlayerDialog(playerid, DIALOG_skin, DIALOG_STYLE_LIST, "G - Skins", "Carl Johnson \Hobo \nOfficer \nBikini Girl \nSweet \nNewbie", "Choose", "Cancel");
        return 1;
Help please
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)