SA-MP Forums Archive
Filterscripts with Dialog Doesn't works - 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: Filterscripts with Dialog Doesn't works (/showthread.php?tid=449401)



Filterscripts with Dialog Doesn't works - Yordan_Kronos - 08.07.2013

Hello all my Filterscripts with Dialog doesn't work. Some of best scripters in sa-mp tried to Fix but they dont success ( I want blessing them, they know who are) Please if some people know how to Fix my problem to write me !!! i use include ( EasyDialog ) all my Dialog in gamemodes are Convert in Easy Dialog all works perfect but Filterscripts with Dialog doesn't work. Please help me this is important for me. Thanks advanse I Believe that this problem can be fixed


Re: Filterscripts with Dialog Doesn't works - SuperViper - 08.07.2013

You need to change the return 1; at the end of your gamemode's OnDialogResponse to return 0;.


Re: Filterscripts with Dialog Doesn't works - Yordan_Kronos - 08.07.2013

Bro.. This is my code
pawn Код:
//==============================================================================
Dialog:Rulesc(playerid, response, listitem, inputtext[])
{
    return 1;
}
Dialog:Helpc(playerid, response, listitem, inputtext[])
{
    return 1;
}
Dialog:Adminc(playerid, response, listitem, inputtext[])
{
    return 1;
}
Dialog:Vipc(playerid, response, listitem, inputtext[])
{
    return 1;
}
Dialog:Login(playerid, response, listitem, inputtext[])
{
    if(response)
    {
        if(strlen(inputtext))
        {
            new tmp[64];
            strmid(tmp, inputtext, 0, strlen(inputtext), 255);
            OnPlayerLogin_(playerid,tmp);//
        } //
        else
        {
            new loginstring[256];
            SendClientMessage(playerid, COLOR_WHITE, "SERVER: You have to entry your password");
            format(loginstring,sizeof(loginstring),"{FFFFFF}[Bulgarian] {32cd32}[Red County] {FF0000}[Roleplay]\n{FFFFFF}Pleaes entry your password.");
            ShowDialog(playerid, Show:Login,DIALOG_STYLE_PASSWORD,"Login:",loginstring,"Login","Exit"); // this is Bugged
        }
    }
    else
    {
        Kick(playerid);
    }
    return 1;
}

Dialog:Register(playerid, response, listitem, inputtext[])
{
    if(response)
    {
        if(strlen(inputtext))
        {
            new string[ 30 ];
            format(string, sizeof(string), "%s.ini", PlayerName(playerid));
            if(dini_Exists(string))
            {
                SendClientMessage(playerid, COLOR_YELLOW, "Това име е заето, сменето го с друго!");
                return 1;
            }
            new tmp[64];
            strmid(tmp, inputtext, 0, strlen(inputtext), 255);
            OnPlayerRegister(playerid, tmp);
        }
        else
        {
            new regstring[256];
            format(regstring,sizeof(regstring),"{FFFFFF}[Bulgarian] {32cd32}[Red County] {FF0000}[Roleplay]\n{FFFFFF}Това име не е регистрирано. Въведи парола за да го регистрираш.");
            ShowDialog(playerid, Show:Register,DIALOG_STYLE_PASSWORD,"Регистрация:",regstring,"Регистрирай","Излез");
        }
    }
    else
    {
        Kick(playerid);
    }
    return 1;
}
Dialog:Events(playerid, response, listitem, inputtext[])
{
    if(response)
    {
        SetPlayerPos(playerid, EvnTp[playerid][0],EvnTp[playerid][1],EvnTp[playerid][2]);
        ResetPlayerWeapons(playerid);
        SetPlayerColor(playerid, COLOR_EVENT);
        ResetPlayerWeaponsEx(playerid);
        SetPlayerVirtualWorld(playerid, 1);
        SetPlayerHealth(playerid, 100);
        SetPlayerArmour(playerid, 100);
        SendClientMessage(playerid,0x00FF00FF, "Ти прие поканата си и оръжията ти бяха премахнати!");
    }
    else
    {
        SendClientMessage(playerid,COLOR_GRAD1, "Ти отказа поканата в евента!");
    }
    return 1;
}

/*public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    new string[256];
    switch(dialogid)
    {
        case 12346:
        {
            if(response)
            {
                if(strlen(inputtext))
                {
                    new tmp[64];
                    strmid(tmp, inputtext, 0, strlen(inputtext), 255);
                    OnPlayerLogin_(playerid,tmp);//
                } //
                else
                {
                    new loginstring[256];
                    SendClientMessage(playerid, COLOR_WHITE, "SERVER: You have to entry your password");
                    format(loginstring,sizeof(loginstring),"{FFFFFF}[Bulgarian] {32cd32}[Red County] {FF0000}[Roleplay]\n{FFFFFF}Pleaes entry your password.");
                    ShowPlayerDialog(playerid,12347,DIALOG_STYLE_PASSWORD,"Login:",loginstring,"Login","Exit"); // this is Bugged
             }
            }
            else
            {
                Kick(playerid);
            }
        }
        case 12347:
        {
            if(response)
            {
                if(strlen(inputtext))
                {
                    new tmp[64];
                    strmid(tmp, inputtext, 0, strlen(inputtext), 255);
                    OnPlayerLogin_(playerid,tmp);//
                } //
                else
                {
                    new loginstring[256];
                    SendClientMessage(playerid, COLOR_WHITE, "SERVER: You have to entry your password");
                    format(loginstring,sizeof(loginstring),"{FFFFFF}[Bulgarian] {32cd32}[Red County] {FF0000}[Roleplay]\n{FFFFFF}Pleaes entry your password.");
                    ShowPlayerDialog(playerid,12347,DIALOG_STYLE_PASSWORD,"Login:",loginstring,"Login","Exit"); // this is Bugged
             }
            }
            else
            {
                Kick(playerid);
            }
        }
        case 12345:
        {
            if(response)
            {
                if(strlen(inputtext))
                {
                    format(string, sizeof(string), "%s.ini", PlayerName(playerid));
                    if(dini_Exists(string))
                    {
                        SendClientMessage(playerid, COLOR_YELLOW, "Това име е заето, сменето го с друго!");
                        return 1;
                    }
                    new tmp[64];
                    strmid(tmp, inputtext, 0, strlen(inputtext), 255);
                    OnPlayerRegister(playerid, tmp);
                }
                else
                {
                    new regstring[256];
                    format(regstring,sizeof(regstring),"{FFFFFF}[Bulgarian] {32cd32}[Red County] {FF0000}[Roleplay]\n{FFFFFF}Това име не е регистрирано. Въведи парола за да го регистрираш.");
                    ShowPlayerDialog(playerid,12345,DIALOG_STYLE_PASSWORD,"Регистрация:",regstring,"Регистрирай","Излез");
                }
            }
            else
            {
                Kick(playerid);
            }
        }
        case 525:
        {
            if(response)
            {
                SetPlayerPos(playerid, EvnTp[playerid][0],EvnTp[playerid][1],EvnTp[playerid][2]);
                ResetPlayerWeapons(playerid);
                SetPlayerColor(playerid, COLOR_EVENT);
                ResetPlayerWeaponsEx(playerid);
                SetPlayerVirtualWorld(playerid, 1);
                SetPlayerHealth(playerid, 100);
                SetPlayerArmour(playerid, 100);
                SendClientMessage(playerid,0x00FF00FF, "Ти прие поканата си и оръжията ти бяха премахнати!");
            }
            else
            {
                SendClientMessage(playerid,COLOR_GRAD1, "Ти отказа поканата в евента!");
            }
        }
        case 30://aoc
        {
            if(response)
            {//Main gate/ Water Gate/ Spec Gate/ View Gate/ Locker door / Up door
                if(listitem == 0)
                {
                }
                if(listitem == 1)
                {
                }
                if(listitem == 2)
                {
                }
                if(listitem == 3)
                {
                }
                if(listitem == 4)
                {
                }
                if(listitem == 5)
                {
                }
            }
            else
            {
            }
            return 1;
        }
        case 31:
        {
            if(response)
            {//Main gate/ Water Gate/ Spec Gate/ View Gate/ Locker door / Up door
                if(listitem == 0)
                {
                }
                if(listitem == 1)
                {
                }
                if(listitem == 2)
                {
                }
                if(listitem == 3)
                {
                }
                if(listitem == 4)
                {
                }
                if(listitem == 5)
                {
                }
                return 1;
            }
            else
            {
            }
        }
    }
    return 1;
}*/

//=====



Re: Filterscripts with Dialog Doesn't works - SuperViper - 08.07.2013

You aren't even listening to what I'm saying. You need to uncomment your OnDialogResponse, remove all of the code in it, and then add return 0;. If the include you're using for dialogs was scripted properly, this should work.


Re: Filterscripts with Dialog Doesn't works - Aerotactics - 08.07.2013

Quote:
Originally Posted by SuperViper
Посмотреть сообщение
You aren't even listening to what I'm saying. You need to uncomment your OnDialogResponse, remove all of the code in it, and then add return 0;. If the include you're using for dialogs was scripted properly, this should work.
SuperViper is right, I was just about to say the same thing. He beat me to it.


Re: Filterscripts with Dialog Doesn't works - Yordan_Kronos - 08.07.2013

I just should uncomment my OnDialogResponse, or i should Uncomment OnDialogResponse and delete everything in it ?


Re: Filterscripts with Dialog Doesn't works - Aerotactics - 08.07.2013

Quote:
Originally Posted by Yordan_Kronos
Посмотреть сообщение
I just should uncomment my OnDialogResponse, or i should Uncomment OnDialogResponse and delete everything in it ?
Yes, but where you have "return 1;" it should be "return 0;" and "return 1;" needs to be in the previous bracket.


Re: Filterscripts with Dialog Doesn't works - Yordan_Kronos - 08.07.2013

pawn Код:
Dialog:Rulesc(playerid, response, listitem, inputtext[])
{
    return 1;
}
Dialog:Helpc(playerid, response, listitem, inputtext[])
{
    return 1;
}
Dialog:Adminc(playerid, response, listitem, inputtext[])
{
    return 1;
}
Dialog:Vipc(playerid, response, listitem, inputtext[])
{
    return 1;
}
Dialog:Login(playerid, response, listitem, inputtext[])
{
    if(response)
    {
        if(strlen(inputtext))
        {
            new tmp[64];
            strmid(tmp, inputtext, 0, strlen(inputtext), 255);
            OnPlayerLogin_(playerid,tmp);//
        } //
        else
        {
            new loginstring[256];
            SendClientMessage(playerid, COLOR_WHITE, "SERVER: You have to entry your password");
            format(loginstring,sizeof(loginstring),"{FFFFFF}[Bulgarian] {32cd32}[Red County] {FF0000}[Roleplay]\n{FFFFFF}Pleaes entry your password.");
            ShowDialog(playerid, Show:Login,DIALOG_STYLE_PASSWORD,"Login:",loginstring,"Login","Exit"); // this is Bugged
        }
    }
    else
    {
        Kick(playerid);
    }
    return 1;
}

Dialog:Register(playerid, response, listitem, inputtext[])
{
    if(response)
    {
        if(strlen(inputtext))
        {
            new string[ 30 ];
            format(string, sizeof(string), "%s.ini", PlayerName(playerid));
            if(dini_Exists(string))
            {
                SendClientMessage(playerid, COLOR_YELLOW, "Това име е заето, сменето го с друго!");
                return 1;
            }
            new tmp[64];
            strmid(tmp, inputtext, 0, strlen(inputtext), 255);
            OnPlayerRegister(playerid, tmp);
        }
        else
        {
            new regstring[256];
            format(regstring,sizeof(regstring),"{FFFFFF}[Bulgarian] {32cd32}[Red County] {FF0000}[Roleplay]\n{FFFFFF}Това име не е регистрирано. Въведи парола за да го регистрираш.");
            ShowDialog(playerid, Show:Register,DIALOG_STYLE_PASSWORD,"Регистрация:",regstring,"Регистрирай","Излез");
        }
    }
    else
    {
        Kick(playerid);
    }
    return 1;
}
Dialog:Events(playerid, response, listitem, inputtext[])
{
    if(response)
    {
        SetPlayerPos(playerid, EvnTp[playerid][0],EvnTp[playerid][1],EvnTp[playerid][2]);
        ResetPlayerWeapons(playerid);
        SetPlayerColor(playerid, COLOR_EVENT);
        ResetPlayerWeaponsEx(playerid);
        SetPlayerVirtualWorld(playerid, 1);
        SetPlayerHealth(playerid, 100);
        SetPlayerArmour(playerid, 100);
        SendClientMessage(playerid,0x00FF00FF, "Ти прие поканата си и оръжията ти бяха премахнати!");
    }
    else
    {
        SendClientMessage(playerid,COLOR_GRAD1, "Ти отказа поканата в евента!");
    }
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    return 0;
}
Like this doesn't work?


Re: Filterscripts with Dialog Doesn't works - Necip - 08.07.2013

He means you must just uncomment the OnDialogResponse.


Re: Filterscripts with Dialog Doesn't works - Yordan_Kronos - 08.07.2013

pawn Код:
//==============================================================================
Dialog:Rulesc(playerid, response, listitem, inputtext[])
{
    return 1;
}
Dialog:Helpc(playerid, response, listitem, inputtext[])
{
    return 1;
}
Dialog:Adminc(playerid, response, listitem, inputtext[])
{
    return 1;
}
Dialog:Vipc(playerid, response, listitem, inputtext[])
{
    return 1;
}
Dialog:Login(playerid, response, listitem, inputtext[])
{
    if(response)
    {
        if(strlen(inputtext))
        {
            new tmp[64];
            strmid(tmp, inputtext, 0, strlen(inputtext), 255);
            OnPlayerLogin_(playerid,tmp);//
        } //
        else
        {
            new loginstring[256];
            SendClientMessage(playerid, COLOR_WHITE, "SERVER: You have to entry your password");
            format(loginstring,sizeof(loginstring),"{FFFFFF}[Bulgarian] {32cd32}[Red County] {FF0000}[Roleplay]\n{FFFFFF}Pleaes entry your password.");
            ShowDialog(playerid, Show:Login,DIALOG_STYLE_PASSWORD,"Login:",loginstring,"Login","Exit"); // this is Bugged
        }
    }
    else
    {
        Kick(playerid);
    }
    return 1;
}

Dialog:Register(playerid, response, listitem, inputtext[])
{
    if(response)
    {
        if(strlen(inputtext))
        {
            new string[ 30 ];
            format(string, sizeof(string), "%s.ini", PlayerName(playerid));
            if(dini_Exists(string))
            {
                SendClientMessage(playerid, COLOR_YELLOW, "Това име е заето, сменето го с друго!");
                return 1;
            }
            new tmp[64];
            strmid(tmp, inputtext, 0, strlen(inputtext), 255);
            OnPlayerRegister(playerid, tmp);
        }
        else
        {
            new regstring[256];
            format(regstring,sizeof(regstring),"{FFFFFF}[Bulgarian] {32cd32}[Red County] {FF0000}[Roleplay]\n{FFFFFF}Това име не е регистрирано. Въведи парола за да го регистрираш.");
            ShowDialog(playerid, Show:Register,DIALOG_STYLE_PASSWORD,"Регистрация:",regstring,"Регистрирай","Излез");
        }
    }
    else
    {
        Kick(playerid);
    }
    return 1;
}
Dialog:Events(playerid, response, listitem, inputtext[])
{
    if(response)
    {
        SetPlayerPos(playerid, EvnTp[playerid][0],EvnTp[playerid][1],EvnTp[playerid][2]);
        ResetPlayerWeapons(playerid);
        SetPlayerColor(playerid, COLOR_EVENT);
        ResetPlayerWeaponsEx(playerid);
        SetPlayerVirtualWorld(playerid, 1);
        SetPlayerHealth(playerid, 100);
        SetPlayerArmour(playerid, 100);
        SendClientMessage(playerid,0x00FF00FF, "Ти прие поканата си и оръжията ти бяха премахнати!");
    }
    else
    {
        SendClientMessage(playerid,COLOR_GRAD1, "Ти отказа поканата в евента!");
    }
    return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    new string[256];
    switch(dialogid)
    {
        case 12346:
        {
            if(response)
            {
                if(strlen(inputtext))
                {
                    new tmp[64];
                    strmid(tmp, inputtext, 0, strlen(inputtext), 255);
                    OnPlayerLogin_(playerid,tmp);//
                } //
                else
                {
                    new loginstring[256];
                    SendClientMessage(playerid, COLOR_WHITE, "SERVER: You have to entry your password");
                    format(loginstring,sizeof(loginstring),"{FFFFFF}[Bulgarian] {32cd32}[Red County] {FF0000}[Roleplay]\n{FFFFFF}Pleaes entry your password.");
                    ShowPlayerDialog(playerid,12347,DIALOG_STYLE_PASSWORD,"Login:",loginstring,"Login","Exit"); // this is Bugged
             }
            }
            else
            {
                Kick(playerid);
            }
        }
        case 12347:
        {
            if(response)
            {
                if(strlen(inputtext))
                {
                    new tmp[64];
                    strmid(tmp, inputtext, 0, strlen(inputtext), 255);
                    OnPlayerLogin_(playerid,tmp);//
                } //
                else
                {
                    new loginstring[256];
                    SendClientMessage(playerid, COLOR_WHITE, "SERVER: You have to entry your password");
                    format(loginstring,sizeof(loginstring),"{FFFFFF}[Bulgarian] {32cd32}[Red County] {FF0000}[Roleplay]\n{FFFFFF}Pleaes entry your password.");
                    ShowPlayerDialog(playerid,12347,DIALOG_STYLE_PASSWORD,"Login:",loginstring,"Login","Exit"); // this is Bugged
             }
            }
            else
            {
                Kick(playerid);
            }
        }
        case 12345:
        {
            if(response)
            {
                if(strlen(inputtext))
                {
                    format(string, sizeof(string), "%s.ini", PlayerName(playerid));
                    if(dini_Exists(string))
                    {
                        SendClientMessage(playerid, COLOR_YELLOW, "Това име е заето, сменето го с друго!");
                        return 1;
                    }
                    new tmp[64];
                    strmid(tmp, inputtext, 0, strlen(inputtext), 255);
                    OnPlayerRegister(playerid, tmp);
                }
                else
                {
                    new regstring[256];
                    format(regstring,sizeof(regstring),"{FFFFFF}[Bulgarian] {32cd32}[Red County] {FF0000}[Roleplay]\n{FFFFFF}Това име не е регистрирано. Въведи парола за да го регистрираш.");
                    ShowPlayerDialog(playerid,12345,DIALOG_STYLE_PASSWORD,"Регистрация:",regstring,"Регистрирай","Излез");
                }
            }
            else
            {
                Kick(playerid);
            }
        }
        case 525:
        {
            if(response)
            {
                SetPlayerPos(playerid, EvnTp[playerid][0],EvnTp[playerid][1],EvnTp[playerid][2]);
                ResetPlayerWeapons(playerid);
                SetPlayerColor(playerid, COLOR_EVENT);
                ResetPlayerWeaponsEx(playerid);
                SetPlayerVirtualWorld(playerid, 1);
                SetPlayerHealth(playerid, 100);
                SetPlayerArmour(playerid, 100);
                SendClientMessage(playerid,0x00FF00FF, "Ти прие поканата си и оръжията ти бяха премахнати!");
            }
            else
            {
                SendClientMessage(playerid,COLOR_GRAD1, "Ти отказа поканата в евента!");
            }
        }
        case 30://aoc
        {
            if(response)
            {//Main gate/ Water Gate/ Spec Gate/ View Gate/ Locker door / Up door
                if(listitem == 0)
                {
                }
                if(listitem == 1)
                {
                }
                if(listitem == 2)
                {
                }
                if(listitem == 3)
                {
                }
                if(listitem == 4)
                {
                }
                if(listitem == 5)
                {
                }
            }
            else
            {
            }
            return 1;
        }
        case 31:
        {
            if(response)
            {//Main gate/ Water Gate/ Spec Gate/ View Gate/ Locker door / Up door
                if(listitem == 0)
                {
                }
                if(listitem == 1)
                {
                }
                if(listitem == 2)
                {
                }
                if(listitem == 3)
                {
                }
                if(listitem == 4)
                {
                }
                if(listitem == 5)
                {
                }
                return 1;
            }
            else
            {
            }
        }
    }
    return 0;
}
Like this again doesn't work. I Said this is biggest problem and my script is okay .. but i dont know why Dialogs doesn't works