29.09.2015, 19:29
pawn Код:
public OnPlayerConnect(playerid)
{
PlayerInfo[playerid][Logged] = 0;
new query[128];
mysql_format(g_Handle, query, sizeof(query), "SELECT * FROM `users` WHERE `name` = '%e' LIMIT 1", GetPName(playerid));
mysql_tquery(g_Handle, query, "CheckPlayerExists", "i", playerid);
return 1;
}
pawn Код:
public CheckPlayerExists(playerid)
{
new rows, fields;
cache_get_data(rows, fields, g_Handle);
if(rows)
{
cache_get_field_content(0, "password", PlayerInfo[playerid][Password]);
printf("%s", PlayerInfo[playerid][Password]); //debug
print("Exists!); //debug
ShowLogin(playerid);
}
else
{
print("Does not exist."); //debug
ShowRegister(playerid);
}
return 1;
}
This is not retrieving the password from the database and I can't figure out why. I'm using blueG's r39-3 and recently converted to it so I guess I did something wrong. Can anyone correct me?