19.07.2015, 14:53
Quote:
there is a problem with the mysql_real_escape_string function in the Login() function of your script
|
PHP код:
forward Login(playerid);
public Login(playerid)
{
// Display the main menu
ShowMainMenuGUI(playerid);
ClearChatbox(playerid);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerCameraPos(playerid, 2022.083740, -1308.260620, 80.478797);
SetPlayerCameraLookAt(playerid, 1970.506103, -1201.447143, 25.596593);
new
szQuery[128],
szPlayerName[MAX_PLAYER_NAME],
szPlayerName2[MAX_PLAYER_NAME];
GetPlayerName(playerid, szPlayerName, sizeof(szPlayerName));
mysql_real_escape_string(szPlayerName, szPlayerName2, g_MySQLConnections[0]);
// Check MySQL to see if any accounts exist with the specified username on login.
format(szQuery, sizeof(szQuery), "SELECT COUNT(*) FROM players WHERE Username = '%s'", szPlayerName);
mysql_query(szQuery, THREAD_CONFIRM_USERNAME, playerid, g_MySQLConnections[0]);
ConnectionLog(playerid, PlayerInfo[playerid][pID], szPlayerName);
return 1;
}