MySQL account issue
#7

Back again, /sigh

Okay I have this now:
pawn Код:
public MySQLCheckUserExistance(playerid)
{
    new PlayerName[128];
    new query[265];
    GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
    format(query, sizeof(query), "SELECT `reg_id` FROM `users` WHERE `name` = '%s'", PlayerName);
    mysql_query(query);

    if(mysql_num_rows() == 0)
    {
        return 0;
    }
    else
    {
      return 1;
    }
}
and

pawn Код:
//===> MySQL CHECK <===
    MySQLCheckUserExistance(playerid);
    PlayerInfo[playerid][pSQLId] = INVALID_SQL_ID;
    FindPlayerSQL(playerid);
    if(MySQLCheckUserExistance(playerid))
    {
        gPlayerAccount[playerid] = 1;
        ShowLoginDialog(playerid);
    }
    else
    {
        gPlayerAccount[playerid] = 0;
        ShowRegDialog(playerid);
    }
    //====================
Now I think if your registered it works fine but if your a new player you get the login dialog.
Reply


Messages In This Thread
MySQL account issue - by jamesb93 - 05.12.2009, 19:59
Re: MySQL account issue - by Grim_ - 05.12.2009, 21:17
Re: MySQL account issue - by jamesb93 - 05.12.2009, 21:25
Re: MySQL account issue - by Grim_ - 05.12.2009, 21:30
Re: MySQL account issue - by jamesb93 - 05.12.2009, 23:39
Re: MySQL account issue - by Grim_ - 05.12.2009, 23:44
Re: MySQL account issue - by jamesb93 - 06.12.2009, 00:11
Re: MySQL account issue - by jamesb93 - 06.12.2009, 08:58
Re: MySQL account issue - by Sergei - 06.12.2009, 09:06

Forum Jump:


Users browsing this thread: 2 Guest(s)