SA-MP Forums Archive
OnDialogResponse help? - 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: OnDialogResponse help? (/showthread.php?tid=369568)



OnDialogResponse help? - N0FeaR - 17.08.2012

Help?

Код:
C:\Users\N0FeaR\Desktop\PRP\gamemodes\P-RP.pwn(39162) : error 010: invalid function or declaration
pawn Код:
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
        if(dialogid == 1244)
        {
            if(response)
            {
                if (gPlayerAccount[playerid] != 0)
                {
                    ShowPlayerDialog(playerid, 1245, DIALOG_STYLE_INPUT,"{00FF00}Welcome, {FF0000}Please Log-In","Type your password below to log-in","Log-in","Quit");
                }
                else
                {
                    ShowPlayerDialog(playerid, 1246, DIALOG_STYLE_INPUT,"Welcome, Please Register","Type your password below to register a new account.","Register","Quit");
                }
                new sendername[MAX_PLAYERS];
                new string[128];
                new y, m, d;
                new h,mi,s;
                getdate(y,m,d);
                gettime(h,mi,s);
                format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has accepted the terms and conditions.",d,m,y,h,mi,s,sendername);
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY,"* You selected \"Refuse\", To play you must agree to the terms of condition");
                Kick(playerid);
            }
        }
        if(dialogid == 1245)
        {
            if(response)
            {
                strmid(Typed[playerid], inputtext, 0, strlen(inputtext), 255);
                if(!strcmp(Typed[playerid], "None", true))
                {
                    ShowPlayerDialog(playerid, 1245, DIALOG_STYLE_INPUT,"Try Again, Please Log-In","You didn't typed a password!\nType your password below to log-in","Log-in","Quit");
                }
                else
                {
                    OnPlayerLogin(playerid, inputtext);
                }
            }
            else
            {
                Kick(playerid);
            }
        }
        if(dialogid == 1246)
        {
            if(response == 1)
            {
                if(strlen(inputtext) < 3)
                {
                    ShowPlayerDialog(playerid, 1246, DIALOG_STYLE_INPUT,"Try Again, Please Register","The password entered is Too Short!\nType your password below to register a new account.","Register","Quit");
                    return 1;
                }
                if(strlen(inputtext) > 20)
                {
                    ShowPlayerDialog(playerid, 1246, DIALOG_STYLE_INPUT,"Try Again, Please Register","The password entered is too Long!\nType your password below to register a new account.","Register","Quit");
                    return 1;
                }
                OnPlayerRegister(playerid, inputtext);
            }
            else
            {
                Kick(playerid);
            }
        }
        return 1;
    }

  line 39162  return 0;
}



Re: OnDialogResponse help? - kbalor - 17.08.2012

EDIT: Got it


Re: OnDialogResponse help? - Gangster-rocks - 17.08.2012

pawn Код:
line 39162 return 0;
                            //this is the error line LOL



Re: OnDialogResponse help? - [DOG]irinel1996 - 17.08.2012

Quote:
Originally Posted by Gangster-rocks
Посмотреть сообщение
pawn Код:
line 39162 return 0;
                            //this is the error line LOL
Seriously? He put it to make us see the line. -.-
_____________________
On topic, checking it N0FeaR...
EDIT: Give a try now:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 1244)
    {
        if(response)
        {
            if (gPlayerAccount[playerid] != 0)
            {
                ShowPlayerDialog(playerid, 1245, DIALOG_STYLE_INPUT,"{00FF00}Welcome, {FF0000}Please Log-In","Type your password below to log-in","Log-in","Quit");
            }
            else
            {
                ShowPlayerDialog(playerid, 1246, DIALOG_STYLE_INPUT,"Welcome, Please Register","Type your password below to register a new account.","Register","Quit");
            }
            new sendername[MAX_PLAYERS];
            new string[128];
            new y, m, d;
            new h,mi,s;
            getdate(y,m,d);
            gettime(h,mi,s);
            format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has accepted the terms and conditions.",d,m,y,h,mi,s,sendername);
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY,"* You selected \"Refuse\", To play you must agree to the terms of condition");
            Kick(playerid);
        }
        return 1;
    }
    if(dialogid == 1245)
    {
        if(response)
        {
            strmid(Typed[playerid], inputtext, 0, strlen(inputtext), 255);
            if(!strcmp(Typed[playerid], "None", true))
            {
                ShowPlayerDialog(playerid, 1245, DIALOG_STYLE_INPUT,"Try Again, Please Log-In","You didn't typed a password!\nType your password below to log-in","Log-in","Quit");
            }
            else
            {
                OnPlayerLogin(playerid, inputtext);
            }
        }
        else
        {
            Kick(playerid);
        }
        return 1;
    }
    if(dialogid == 1246)
    {
        if(response == 1)
        {
            if(strlen(inputtext) < 3)
            {
                ShowPlayerDialog(playerid, 1246, DIALOG_STYLE_INPUT,"Try Again, Please Register","The password entered is Too Short!\nType your password below to register a new account.","Register","Quit");
                return 1;
            }
            if(strlen(inputtext) > 20)
            {
                ShowPlayerDialog(playerid, 1246, DIALOG_STYLE_INPUT,"Try Again, Please Register","The password entered is too Long!\nType your password below to register a new account.","Register","Quit");
                return 1;
            }
            OnPlayerRegister(playerid, inputtext);
        }
        else
        {
            Kick(playerid);
        }
        return 1;
    }
    return 0;
}



Re: OnDialogResponse help? - FireCat - 17.08.2012

Quote:
Originally Posted by irinel1996
Посмотреть сообщение
Seriously? He put it to make us see the line. -.-
_____________________
On topic, checking it N0FeaR...
EDIT: Give a try now:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 1244)
    {
        if(response)
        {
            if (gPlayerAccount[playerid] != 0)
            {
                ShowPlayerDialog(playerid, 1245, DIALOG_STYLE_INPUT,"{00FF00}Welcome, {FF0000}Please Log-In","Type your password below to log-in","Log-in","Quit");
            }
            else
            {
                ShowPlayerDialog(playerid, 1246, DIALOG_STYLE_INPUT,"Welcome, Please Register","Type your password below to register a new account.","Register","Quit");
            }
            new sendername[MAX_PLAYERS];
            new string[128];
            new y, m, d;
            new h,mi,s;
            getdate(y,m,d);
            gettime(h,mi,s);
            format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has accepted the terms and conditions.",d,m,y,h,mi,s,sendername);
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY,"* You selected \"Refuse\", To play you must agree to the terms of condition");
            Kick(playerid);
        }
        return 1;
    }
    if(dialogid == 1245)
    {
        if(response)
        {
            strmid(Typed[playerid], inputtext, 0, strlen(inputtext), 255);
            if(!strcmp(Typed[playerid], "None", true))
            {
                ShowPlayerDialog(playerid, 1245, DIALOG_STYLE_INPUT,"Try Again, Please Log-In","You didn't typed a password!\nType your password below to log-in","Log-in","Quit");
            }
            else
            {
                OnPlayerLogin(playerid, inputtext);
            }
        }
        else
        {
            Kick(playerid);
        }
        return 1;
    }
    if(dialogid == 1246)
    {
        if(response == 1)
        {
            if(strlen(inputtext) < 3)
            {
                ShowPlayerDialog(playerid, 1246, DIALOG_STYLE_INPUT,"Try Again, Please Register","The password entered is Too Short!\nType your password below to register a new account.","Register","Quit");
                return 1;
            }
            if(strlen(inputtext) > 20)
            {
                ShowPlayerDialog(playerid, 1246, DIALOG_STYLE_INPUT,"Try Again, Please Register","The password entered is too Long!\nType your password below to register a new account.","Register","Quit");
                return 1;
            }
            OnPlayerRegister(playerid, inputtext);
        }
        else
        {
            Kick(playerid);
        }
        return 1;
    }
    return 0;
}
Aff to late...
Garfielda


Re: OnDialogResponse help? - N0FeaR - 17.08.2012

Quote:
Originally Posted by irinel1996
Посмотреть сообщение
Seriously? He put it to make us see the line. -.-
_____________________
On topic, checking it N0FeaR...
EDIT: Give a try now:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 1244)
    {
        if(response)
        {
            if (gPlayerAccount[playerid] != 0)
            {
                ShowPlayerDialog(playerid, 1245, DIALOG_STYLE_INPUT,"{00FF00}Welcome, {FF0000}Please Log-In","Type your password below to log-in","Log-in","Quit");
            }
            else
            {
                ShowPlayerDialog(playerid, 1246, DIALOG_STYLE_INPUT,"Welcome, Please Register","Type your password below to register a new account.","Register","Quit");
            }
            new sendername[MAX_PLAYERS];
            new string[128];
            new y, m, d;
            new h,mi,s;
            getdate(y,m,d);
            gettime(h,mi,s);
            format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has accepted the terms and conditions.",d,m,y,h,mi,s,sendername);
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY,"* You selected \"Refuse\", To play you must agree to the terms of condition");
            Kick(playerid);
        }
        return 1;
    }
    if(dialogid == 1245)
    {
        if(response)
        {
            strmid(Typed[playerid], inputtext, 0, strlen(inputtext), 255);
            if(!strcmp(Typed[playerid], "None", true))
            {
                ShowPlayerDialog(playerid, 1245, DIALOG_STYLE_INPUT,"Try Again, Please Log-In","You didn't typed a password!\nType your password below to log-in","Log-in","Quit");
            }
            else
            {
                OnPlayerLogin(playerid, inputtext);
            }
        }
        else
        {
            Kick(playerid);
        }
        return 1;
    }
    if(dialogid == 1246)
    {
        if(response == 1)
        {
            if(strlen(inputtext) < 3)
            {
                ShowPlayerDialog(playerid, 1246, DIALOG_STYLE_INPUT,"Try Again, Please Register","The password entered is Too Short!\nType your password below to register a new account.","Register","Quit");
                return 1;
            }
            if(strlen(inputtext) > 20)
            {
                ShowPlayerDialog(playerid, 1246, DIALOG_STYLE_INPUT,"Try Again, Please Register","The password entered is too Long!\nType your password below to register a new account.","Register","Quit");
                return 1;
            }
            OnPlayerRegister(playerid, inputtext);
        }
        else
        {
            Kick(playerid);
        }
        return 1;
    }
    return 0;
}
Thank you a lot, is fixed now.


Re: OnDialogResponse help? - [DOG]irinel1996 - 17.08.2012

No problem. Glad that it works.
________________
OFF: BurnedCat, I though that cats were faster. :3