01.06.2018, 01:17
I've got this snippet of code:
In which especially this part is concerning me
In the console it returns the following:
So it considers me as not being connected, while I clearly am. What could be the reason(s) that this is the case?
pawn Код:
public OnPlayerConnect(playerid)
{
//Check if player has an account
new query[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
mysql_format(sql_connection, query, sizeof(query), "SELECT * FROM player WHERE name = '%s' LIMIT 1", pname);
mysql_tquery(sql_connection, query, "OnAccountCheck", "r", playerid);
return 1;
}
forward OnAccountCheck(playerid);
public OnAccountCheck(playerid)
{
printf("Connect status: %d", IsPlayerConnected(playerid));
new row_count;
if(!cache_get_row_count(row_count))
{
return 1;
}
if(row_count == 0) //No account, register
{
}
else //Account registered, log in
{
printf("Hello %s", RoleplayName(playerid));
}
return 1;
}
In which especially this part is concerning me
pawn Код:
printf("Connect status: %d", IsPlayerConnected(playerid));
Quote:
Connect status: 0 |