SA-MP Forums Archive
Being kicked from my own server? - 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: Being kicked from my own server? (/showthread.php?tid=554124)



Being kicked from my own server? - Derexi - 02.01.2015

This has just started to happen recently for seemingly no reason. What happens is I connect to the server and the register dialog appears. I type in a password and click "register" and it registers my account and saves it in the MySQL database, but then instantly says "Server closed the connection". It's the same if I log in too. My dialogs' buttons are the correct way around according to the OnDialogResponse page on the SA-MP Wiki:
Quote:

response - 1 for left button and 0 for right button (if only one button shown, always 1)

My dialogs
Quote:

ShowPlayerDialog(playerid, D_REG, DIALOG_STYLE_PASSWORD, "{00D3FF}Register your account", string, "Register", "Quit");

ShowPlayerDialog(playerid, D_LOGIN, DIALOG_STYLE_PASSWORD, "{00D3FF}Login to your account", string, "Login", "Quit");




Re: Being kicked from my own server? - Facerafter - 02.01.2015

Can you show us your OnDialogResponse?


Re: Being kicked from my own server? - Derexi - 02.01.2015

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
        case D_REG:
        {
            new string[128];
            if(response == 0)
            {
                Kick(playerid);
            }
            else
            { // password length checks and valid character check
I don't want to paste the whole thing because it's a large chunk of script, but you can clearly see the response is written correctly. And like I said, it was working fine before and I haven't changed this part of the script since it stopped working.


Re: Being kicked from my own server? - Facerafter - 02.01.2015

Not sure what else it could be.

You could try this:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
        case D_REG:
        {
            new string[128];
            if(response == 0)
            {
                print("Kicking player");
                Kick(playerid);
            }
And than test it, than you could find out the origin of the problem.
If it gets printed its here if not its somewere else.


Re: Being kicked from my own server? - Derexi - 02.01.2015

Quote:
Originally Posted by Facerafter
Посмотреть сообщение
Not sure what else it could be.

You could try this:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
        case D_REG:
        {
            new string[128];
            if(response == 0)
            {
                print("Kicking player");
                Kick(playerid);
            }
And than test it, than you could find out the origin of the problem.
If it gets printed its here if not its somewere else.
I did that and the print message didn't show. I also commented out every single instance of the Kick(playerid); function in my script and it still closes the connection. Really weird.


Re: Being kicked from my own server? - biker122 - 02.01.2015

Show your register dialog for us to have a better look into the script..