Dialog Response Button (Continue)
#1

I recently released a simple script to show a roleplay menu, it can be shown here

One of my comments consisted of someone saying if it was possible to send them back on the menu when they click "Okey". Im new to scripting, so i was wondering if someone could tell me how to do this. This is my script so far.

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/rpguide", cmdtext, true, 10) == 0)
    {
        ShowPlayerDialog(playerid, RPGUIDE, DIALOG_STYLE_LIST, "Roleplay Guide","In Character\nOut Of Character\nPowergaming\nMetagaming\nRevengeKill\nCharacter Kill\nChicken Running\nDeathmatch\nKill on Sight\nBunny hop\nPlayer Kill","Choose","Close");
        return 1;
    }
    return 0;
}
I seriously don't know how to do this, so if someone can show me how to do this, i'd be grateful.


pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == RPGUIDE)
    {
        if(response)
        {
            if(listitem == 0)
            {
                ShowPlayerDialog(playerid, HELP1, DIALOG_STYLE_MSGBOX, "In Character (IC)","Acting as a player as you would in real life\nExample: None needed.","Okey","Close");
            }
            if(listitem == 1)
            {
                ShowPlayerDialog(playerid, HELP2, DIALOG_STYLE_MSGBOX, "Out Of Character (OOC)","Making comments or asking questions that are not part of the scene or not being said as your character\nExample: I need to take a piss, ill brb.","Okey","Close");
            }
            if(listitem == 2)
            {
                ShowPlayerDialog(playerid, HELP3, DIALOG_STYLE_MSGBOX, "Powergaming (PG)","Forcing actions upon a player against someones free will\nExample:\nPlayer1: Get in my car!\nPlayer2: On one condition...\nPlayer1: No get in!\nPlayer1 grabs Player2 and forces him into the car\n \n Must always use /me and /do's for an action that they can avoid.","Okey","close");
            }
            if(listitem == 3)
            {
                ShowPlayerDialog(playerid, HELP4, DIALOG_STYLE_MSGBOX, "Metagaming (MG)","Using OOC Information IC.\nExample: Telling people where someone is when you dont know where they are IC, but you do OOCly.","Okey","Close");
            }
            if(listitem == 4)
            {
                ShowPlayerDialog(playerid, HELP5, DIALOG_STYLE_MSGBOX, "RevengeKill (RK)","If you get killed by someone, You go back to the same spot, and kill the person again\nBut when you die, you loose 30 minutes of your memory\nExample: No example needed","Okey","Close");
            }
            if(listitem == 5)
            {
                ShowPlayerDialog(playerid, HELP6, DIALOG_STYLE_MSGBOX, "Character Kill (CK)","Both players must agree to a Character Kill\nThis is when you Permanently kill a player and they lose all there items and restart a new player\nExample: None needed.","Okey","Close");
            }
            if(listitem == 6)
            {
                ShowPlayerDialog(playerid, HELP7, DIALOG_STYLE_MSGBOX, "Chicken Running (CR)","This is when you run in Zig-Zag lines to avoid being shot at by another player\nExample: Running away in zig-zag lines when getting shot at in a gang war.","Okey","Close");
            }
            if(listitem == 7)
            {
                ShowPlayerDialog(playerid, HELP8, DIALOG_STYLE_MSGBOX, "Deathmatch (DM)","Killing someone for no reason at all\nExample: None needed.","Okey","Close");
            }
            if(listitem == 8)
            {
                ShowPlayerDialog(playerid, HELP9, DIALOG_STYLE_MSGBOX, "Kill on Sight (KoS)","Killing someone when you first spot someone\nExample: Killing someone when they first spawn, or when you just see him come out of somewhere.","Okey","Close");
            }
            if(listitem == 9)
            {
                ShowPlayerDialog(playerid, HELP10, DIALOG_STYLE_MSGBOX, "Bunny Hopping (BH)","Jumping around constantly, it's also considered non RP because it's not possible in real life.\nExample: You need to hurry and you jump over and over again until you reach the place you wanna go.","Okey","Close");
            }
            if(listitem == 10)
            {
                ShowPlayerDialog(playerid, HELP11, DIALOG_STYLE_MSGBOX, "Player Kill (PK)","When your character dies from a certain situation, you can come and RP with the same people but you will not remember what happened on your death.\nExample: None Needed.","Okey","Close");
            }
            if(listitem == 11)
            {
                ShowPlayerDialog(playerid, HELP12, DIALOG_STYLE_MSGBOX, "Spawn Kill (SK)","Killing someone when they first spawn. (which on most rp servers, is the hospital).\n Example: Someone spawns at hospital and you kill them for no reason.","Okey","Close");
            }
        }
    }
}
/DaRealz
Reply
#2

pawn Код:
else if(dialogid == HELP1) { if(response) { ShowPlayerDialog(playerid, ....); // Your original /RPGuide ShowPlayerDialog. } }
Reply
#3

try this
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/rpguide", cmdtext, true, 10) == 0)
    {
        ShowPlayerDialog(playerid, RPGUIDE, DIALOG_STYLE_LIST, "Roleplay Guide","In Character\nOut Of Character\nPowergaming\nMetagaming\nRevengeKill\nCharacter Kill\nChicken Running\nDeathmatch\nKill on Sight\nBunny hop\nPlayer Kill","Choose","Close");
        return 1;
    }
    return 0;
}

Then this is what i EDITED so you can go back to the menu
pawn Код:
//at the top of ur script
#define MENU 5641 //just choose some define that is not used


public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == RPGUIDE)
    {
        if(response)
        {
            if(listitem == 0)
            {
                ShowPlayerDialog(playerid, MENU, DIALOG_STYLE_MSGBOX, "In Character (IC)","Acting as a player as you would in real life\nExample: None needed.","Okey","Close");
            }
            if(listitem == 1)
            {
                ShowPlayerDialog(playerid, MENU, DIALOG_STYLE_MSGBOX, "Out Of Character (OOC)","Making comments or asking questions that are not part of the scene or not being said as your character\nExample: I need to take a piss, ill brb.","Okey","Back");
            }
            if(listitem == 2)
            {
                ShowPlayerDialog(playerid, MENU, DIALOG_STYLE_MSGBOX, "Powergaming (PG)","Forcing actions upon a player against someones free will\nExample:\nPlayer1: Get in my car!\nPlayer2: On one condition...\nPlayer1: No get in!\nPlayer1 grabs Player2 and forces him into the car\n \n Must always use /me and /do's for an action that they can avoid.","Okey","Back");
            }
            if(listitem == 3)
            {
                ShowPlayerDialog(playerid, MENU, DIALOG_STYLE_MSGBOX, "Metagaming (MG)","Using OOC Information IC.\nExample: Telling people where someone is when you dont know where they are IC, but you do OOCly.","Okey","Back");
            }
            if(listitem == 4)
            {
                ShowPlayerDialog(playerid, MENU, DIALOG_STYLE_MSGBOX, "RevengeKill (RK)","If you get killed by someone, You go back to the same spot, and kill the person again\nBut when you die, you loose 30 minutes of your memory\nExample: No example needed","Okey","Back");
            }
            if(listitem == 5)
            {
                ShowPlayerDialog(playerid, MENU, DIALOG_STYLE_MSGBOX, "Character Kill (CK)","Both players must agree to a Character Kill\nThis is when you Permanently kill a player and they lose all there items and restart a new player\nExample: None needed.","Okey","Back");
            }
            if(listitem == 6)
            {
                ShowPlayerDialog(playerid, MENU, DIALOG_STYLE_MSGBOX, "Chicken Running (CR)","This is when you run in Zig-Zag lines to avoid being shot at by another player\nExample: Running away in zig-zag lines when getting shot at in a gang war.","Okey","Back");
            }
            if(listitem == 7)
            {
                ShowPlayerDialog(playerid, MENU, DIALOG_STYLE_MSGBOX, "Deathmatch (DM)","Killing someone for no reason at all\nExample: None needed.","Okey","Back");
            }
            if(listitem == 8)
            {
                ShowPlayerDialog(playerid, MENU, DIALOG_STYLE_MSGBOX, "Kill on Sight (KoS)","Killing someone when you first spot someone\nExample: Killing someone when they first spawn, or when you just see him come out of somewhere.","Okey","Back");
            }
            if(listitem == 9)
            {
                ShowPlayerDialog(playerid, MENU, DIALOG_STYLE_MSGBOX, "Bunny Hopping (BH)","Jumping around constantly, it's also considered non RP because it's not possible in real life.\nExample: You need to hurry and you jump over and over again until you reach the place you wanna go.","Okey","Back");
            }
            if(listitem == 10)
            {
                ShowPlayerDialog(playerid, MENU, DIALOG_STYLE_MSGBOX, "Player Kill (PK)","When your character dies from a certain situation, you can come and RP with the same people but you will not remember what happened on your death.\nExample: None Needed.","Okey","Back");
            }
            if(listitem == 11)
            {
                ShowPlayerDialog(playerid, MENU, DIALOG_STYLE_MSGBOX, "Spawn Kill (SK)","Killing someone when they first spawn. (which on most rp servers, is the hospital).\n Example: Someone spawns at hospital and you kill them for no reason.","Okey","Back");
            }
        }
    }
if(dialogid == MENU)
    {
        if(!response)
        {
        ShowPlayerDialog(playerid, RPGUIDE, DIALOG_STYLE_LIST, "Roleplay Guide","In Character\nOut Of Character\nPowergaming\nMetagaming\nRevengeKill\nCharacter Kill\nChicken Running\nDeathmatch\nKill on Sight\nBunny hop\nPlayer Kill","Choose","Close");
        }
    }
}
Reply
#4

Quote:
Originally Posted by park4bmx
Посмотреть сообщение
try this
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/rpguide", cmdtext, true, 10) == 0)
    {
        ShowPlayerDialog(playerid, RPGUIDE, DIALOG_STYLE_LIST, "Roleplay Guide","In Character\nOut Of Character\nPowergaming\nMetagaming\nRevengeKill\nCharacter Kill\nChicken Running\nDeathmatch\nKill on Sight\nBunny hop\nPlayer Kill","Choose","Close");
        return 1;
    }
    return 0;
}

Then this is what i EDITED so you can go back to the menu
pawn Код:
//at the top of ur script
#define MENU 5641 //just choose some define that is not used


public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == RPGUIDE)
    {
        if(response)
        {
            if(listitem == 0)
            {
                ShowPlayerDialog(playerid, MENU, DIALOG_STYLE_MSGBOX, "In Character (IC)","Acting as a player as you would in real life\nExample: None needed.","Okey","Close");
            }
            if(listitem == 1)
            {
                ShowPlayerDialog(playerid, MENU, DIALOG_STYLE_MSGBOX, "Out Of Character (OOC)","Making comments or asking questions that are not part of the scene or not being said as your character\nExample: I need to take a piss, ill brb.","Okey","Back");
            }
            if(listitem == 2)
            {
                ShowPlayerDialog(playerid, MENU, DIALOG_STYLE_MSGBOX, "Powergaming (PG)","Forcing actions upon a player against someones free will\nExample:\nPlayer1: Get in my car!\nPlayer2: On one condition...\nPlayer1: No get in!\nPlayer1 grabs Player2 and forces him into the car\n \n Must always use /me and /do's for an action that they can avoid.","Okey","Back");
            }
            if(listitem == 3)
            {
                ShowPlayerDialog(playerid, MENU, DIALOG_STYLE_MSGBOX, "Metagaming (MG)","Using OOC Information IC.\nExample: Telling people where someone is when you dont know where they are IC, but you do OOCly.","Okey","Back");
            }
            if(listitem == 4)
            {
                ShowPlayerDialog(playerid, MENU, DIALOG_STYLE_MSGBOX, "RevengeKill (RK)","If you get killed by someone, You go back to the same spot, and kill the person again\nBut when you die, you loose 30 minutes of your memory\nExample: No example needed","Okey","Back");
            }
            if(listitem == 5)
            {
                ShowPlayerDialog(playerid, MENU, DIALOG_STYLE_MSGBOX, "Character Kill (CK)","Both players must agree to a Character Kill\nThis is when you Permanently kill a player and they lose all there items and restart a new player\nExample: None needed.","Okey","Back");
            }
            if(listitem == 6)
            {
                ShowPlayerDialog(playerid, MENU, DIALOG_STYLE_MSGBOX, "Chicken Running (CR)","This is when you run in Zig-Zag lines to avoid being shot at by another player\nExample: Running away in zig-zag lines when getting shot at in a gang war.","Okey","Back");
            }
            if(listitem == 7)
            {
                ShowPlayerDialog(playerid, MENU, DIALOG_STYLE_MSGBOX, "Deathmatch (DM)","Killing someone for no reason at all\nExample: None needed.","Okey","Back");
            }
            if(listitem == 8)
            {
                ShowPlayerDialog(playerid, MENU, DIALOG_STYLE_MSGBOX, "Kill on Sight (KoS)","Killing someone when you first spot someone\nExample: Killing someone when they first spawn, or when you just see him come out of somewhere.","Okey","Back");
            }
            if(listitem == 9)
            {
                ShowPlayerDialog(playerid, MENU, DIALOG_STYLE_MSGBOX, "Bunny Hopping (BH)","Jumping around constantly, it's also considered non RP because it's not possible in real life.\nExample: You need to hurry and you jump over and over again until you reach the place you wanna go.","Okey","Back");
            }
            if(listitem == 10)
            {
                ShowPlayerDialog(playerid, MENU, DIALOG_STYLE_MSGBOX, "Player Kill (PK)","When your character dies from a certain situation, you can come and RP with the same people but you will not remember what happened on your death.\nExample: None Needed.","Okey","Back");
            }
            if(listitem == 11)
            {
                ShowPlayerDialog(playerid, MENU, DIALOG_STYLE_MSGBOX, "Spawn Kill (SK)","Killing someone when they first spawn. (which on most rp servers, is the hospital).\n Example: Someone spawns at hospital and you kill them for no reason.","Okey","Back");
            }
        }
    }
if(dialogid == MENU)
    {
        if(!response)
        {
        ShowPlayerDialog(playerid, RPGUIDE, DIALOG_STYLE_LIST, "Roleplay Guide","In Character\nOut Of Character\nPowergaming\nMetagaming\nRevengeKill\nCharacter Kill\nChicken Running\nDeathmatch\nKill on Sight\nBunny hop\nPlayer Kill","Choose","Close");
        }
    }
}
Thanks, this worked.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)