Alright, I have a problem with a SQL function called DoesPlayerExists, this is the code:
It shows the register dialog when needed but it doesn't shows the login one. Don't know why
Code:
public OnPlayerConnect(playerid)
{
DefaultPlayerValues(playerid);
Logged[playerid] = false;
DoesPlayerExist(playerid);
return true;
}
Code:
public DoesPlayerExist(playerid)
{
new query[128];
mysql_format(sqlConnection, query, sizeof(query), "SELECT id FROM users WHERE Name= '%e' LIMIT 1", GetName(playerid));
mysql_pquery(sqlConnection, query, "SQL_DoesPlayerExist", "i", playerid);
return true;
}
Code:
public SQL_DoesPlayerExist(playerid)
{
new exists = -1;
if(cache_num_rows(sqlConnection) != 0)
{
ShowLoginDialog(playerid, "");
}
else
{
ShowRegisterDialog(playerid, "");
}
TogglePlayerSpectating(playerid, true);
return exists;
}