MySQL Dialog Won't Open
#1

Hello, I have a register system on my website and I want it to check if that user has registered, if they haven't I want it to kick them off the server but if they have, I want it to open the login dialog box. It worked but when I removed the register part of it from my script no dialog will open:

pawn Код:
public OnPlayerConnect(playerid)
{
    MoneyGiven[playerid] = -1; // This is the MySQL login system I have
    new pname[24]; //Creates our variables.
    new string[210];
    GetPlayerName(playerid, pname, 24); //Gets the players name
    mysql_store_result(); //We store the result.
    new rows = mysql_num_rows(); //We get how many rows the query returned. // This is the MySQL login system I have
    if(!rows)
    {
        //If the rows are equal to 0. This means that the query did not find
        //anyone under the name we connected under in the database.
        //So here we send the player the register dialog.
        SendClientMessage(playerid, COLOR_LIGHTRED, "Error: Please register an account at http://127.0.0.1 before being able to play!");
        Kick(playerid);
    }
    if(rows == 1)
    {
        //If the rows are equal to 1, this means there is a player already registered
        //so we can initiate the login dialog to the player or check if the players
        //current IP is the same one as in the database.
        format(string, sizeof(string), "Welcome back, %s. Please enter your password below to log in.",  GetName(playerid));
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Login", string, "Confirm", "Quit");
        IsRegistered[playerid] = 1; //Sets the registered variable to 1 (Shows that the player is registered).
    }
    return 1;
}
I have tried a registered and a non-registered name, nothing happens..
Reply


Messages In This Thread
MySQL Dialog Won't Open - by AphexCCFC - 22.01.2013, 22:04
Re: MySQL Dialog Won't Open - by [jS]Thomas - 22.01.2013, 22:13
Re: MySQL Dialog Won't Open - by AphexCCFC - 22.01.2013, 22:21
Re: MySQL Dialog Won't Open - by [jS]Thomas - 22.01.2013, 22:23
Re: MySQL Dialog Won't Open - by AphexCCFC - 22.01.2013, 22:30
Re: MySQL Dialog Won't Open - by AphexCCFC - 22.01.2013, 22:32
Re: MySQL Dialog Won't Open - by [jS]Thomas - 22.01.2013, 22:33
Re: MySQL Dialog Won't Open - by AphexCCFC - 22.01.2013, 22:35

Forum Jump:


Users browsing this thread: 1 Guest(s)