That name is already taken.
#1

Hey Guys,

I convert my regular registation system to dialog registation system and there is a bug that I can't solve and I need your guys help.

So here it is,when I finish register the server it says:"That Username is already taken, please choose a different one."

That is the only line in my GM the sentence show in:
pawn Код:
if (fexist(string))
                {
                    SendClientMessage(playerid, COLOR_YELLOW, "That Username is already taken, please choose a different one.");
                    Kick(playerid);
                    return 1;
                }
This code shows on this script:
pawn Код:
if(dialogid == 11)
    {
        if (response == 1)
        {
            if(IsPlayerConnected(playerid))
            {
                GetPlayerName(playerid, sendername, sizeof(sendername));
                format(string, sizeof(string), "users/%s.ini", sendername);
                //new File: hFile = fopen(string, io_read);
                if (fexist(string))
                {
                    SendClientMessage(playerid, COLOR_YELLOW, "That Username is already taken, please choose a different one.");
                    Kick(playerid);
                    return 1;
                }
                if(!strlen(inputtext))
                {
                    new msg[256];
                    format(msg,256,"Welcome to Quyz Role Play Community\nPlease enter your password to create new account\n\nEnter the new password:");
                    ShowPlayerDialog(playerid,11,DIALOG_STYLE_INPUT,"Please Register!",msg,"Register","Quit");
                    return 1;
                }
                OnPlayerRegister(playerid,inputtext);
            }
            return 1;
        }
        else return Kick(playerid);
    }
What can I do .. ?
Reply
#2

Its looks like I didn't c,osed it right because other scripts are involved in this ..
pawn Код:
if(listitem == 1) // They selected the second item - AK-47
            {
                ClearChatbox(playerid, 4);
                SendClientMessage(playerid, COLOR_LIGHTRED, "!!!!!!Wrong!!!!!!");
                ClearChatbox(playerid, 1);
                SendClientMessage(playerid, COLOR_LIGHTRED, ">> You can visit ******.co.il and read guides about RolePlay!  <<");
                Kick(playerid);
            }
            if(listitem == 2) // They selected the third item - Desert Eagle
            {
                ClearChatbox(playerid, 4);
                SendClientMessage(playerid, COLOR_LIGHTRED, "!!!!!!Wrong!!!!!!");
                ClearChatbox(playerid, 1);
                SendClientMessage(playerid, COLOR_LIGHTRED, ">> You can visit ******.co.il and read guides about RolePlay!  <<");
                Kick(playerid);
            }
        }
        }
        return 1; // We handled a dialog, so return 1. Just like OnPlayerCommandText.
    }
Sorry for the double I was tying to edit :X
Reply
#3

This code doesn't give you any opportunity to login the server, so when you connect you can just register! You should write another function about login like 'OnPlayerRegister'.
Reply
#4

Quote:
Originally Posted by Rupert
Посмотреть сообщение
This code doesn't give you any opportunity to login the server, so when you connect you can just register! You should write another function about login like 'OnPlayerRegister'.
Tnx for replay dude

I already have this public bro,I tried to paste it there but its brings up the login dialog and when I write my password it says:"You are already logged in".

Help.. :\

EDIT:
I solved it by changing the name of the dialog O_o
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)