06.12.2009, 00:11
Back again, /sigh
Okay I have this now:
and
Now I think if your registered it works fine but if your a new player you get the login dialog.
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;
}
}
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);
}
//====================