14.02.2014, 21:11
I've got this also:
and THREAD_USER_LOOKUP responses to this:
But it wont show anything at all...
pawn Код:
new escapedPlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
mysql_real_escape_string(PlayerName, escapedPlayerName);
format(string, sizeof(string), "SELECT * FROM Users WHERE Name = '%s'", escapedPlayerName);
mysql_query(string, THREAD_USER_LOOKUP, playerid, MySQLConnection);
pawn Код:
case THREAD_USER_LOOKUP:
{
mysql_store_result(connectionHandle);
if(mysql_num_rows(connectionHandle) > 0)
{
new Return[256];
mysql_retrieve_row();
cache_get_field_content(0, "VIP", Return);
PlayerInfo[extraid][pTempVIP] = strval(Return);
cache_get_field_content(0, "Admin", Return);
PlayerInfo[extraid][pTempAdmin] = strval(Return);
cache_get_field_content(0, "Password", Return);
format(PlayerInfo[extraid][pPassword], 256, Return);
mysql_free_result(connectionHandle);
ShowPlayerDialog(extraid, DIALOG_TYPE_LOGIN, DIALOG_STYLE_PASSWORD, "Server Login", "Server Login:\n\nThe account with the name you joined is already registered!\nType your password below to retrieve your stats!", "Login", "");
}
else
{
ShowPlayerDialog(extraid, DIALOG_TYPE_REGISTER, DIALOG_STYLE_INPUT, "Server Register", "Server Register:\n\nThe account with the name you joined is not yet registered!\nType your password below to save your stats!\n\nNote: Do not press ESC or you will be kicked.", "Register", "Kick");
}
}