MySQL Register/Login won't load
#1

Can anyone see what's wrong? When I go in-game, nothing shows up.

pawn Код:
public OnPlayerConnect(playerid)
    {
        new string[256];
        new query[300], pname[24];
        GetPlayerName(playerid, pname, 24);
        format(query, sizeof(query), "SELECT * FROM accounts WHERE username = '%s'", pname);
        mysql_query(query);
        mysql_store_result();
        new rows = mysql_num_rows();
        if(!rows)
        {
            format(string, sizeof(string), "{FFFFFF}Welcome to Red County Roleplay {FFFF00}%s{FFFFFF}\nPlease register by entering a password below:", RemoveUnderScore(playerid));
            ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Red County Roleplay - {FFFF00}Register", string, "Register", "Quit");
        }
        if(rows == 1)
        {
            format(string, sizeof(string), "{FFFFFF}Welcome back to Red County Roleplay {3A8F32}%s{FFFFFF}.\nEnter your password below to log in:", RemoveUnderScore(playerid));
            ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Red County Roleplay - {3A8F32}Login", string, "Login", "Quit");
        }
        mysql_free_result();
        return 1;
    }
Reply


Messages In This Thread
MySQL Register/Login won't load - by Lyksus - 11.01.2014, 10:01
Re: MySQL Register/Login won't load - by DarrenReeder - 11.01.2014, 10:11
Re: MySQL Register/Login won't load - by MadafakaPro - 11.01.2014, 10:15

Forum Jump:


Users browsing this thread: 1 Guest(s)