27.05.2013, 10:12
PHP код:
stock LoadPlayerData(PlayerID)
{
new Query[256];
format(Query, 256, "SELECT * FROM `users` WHERE `Name` = '%s'", PlayerName(PlayerID));
mysql_query(Query);
mysql_store_result();
while(mysql_fetch_row_format(Query,"|"))
{
/*Password*/
format(PlayerInformation[PlayerID][Password], 129, "");
mysql_fetch_field_row(PlayerInformation[PlayerID][Password], "Password");
/*Password*/
/*Score*/
PlayerInformation[PlayerID][Score] = 0;
mysql_fetch_field_row(PlayerInformation[PlayerID][Score], "Score");
SetPlayerScore(PlayerID, PlayerInformation[PlayerID][Score]);
/*Score*/
/*Money*/
PlayerInformation[PlayerID][Money] = 0;
mysql_fetch_field_row(PlayerInformation[PlayerID][Money], "Money");
ResetPlayerMoney(PlayerID);
GivePlayerMoney(PlayerID, PlayerInformation[PlayerID][Money]);
/*Money*/
/*AdminLevel*/
PlayerInformation[PlayerID][AdminLevel] = 0;
mysql_fetch_field_row(PlayerInformation[PlayerID][AdminLevel], "AdminLevel");
/*AdminLevel*/
/*Kills*/
PlayerInformation[PlayerID][Kills] = 0;
mysql_fetch_field_row(PlayerInformation[PlayerID][Kills], "Kills");
/*Kills*/
/*Deaths*/
PlayerInformation[PlayerID][Deaths] = 0;
mysql_fetch_field_row(PlayerInformation[PlayerID][Deaths], "Deaths");
/*Deaths*/
}
SendClientMessage(PlayerID, SexyBlue, "[SERVER]{FFFFFF} You Have Successfully Logged-In.");
PlayerInformation[PlayerID][LoggedIn] = 1;
mysql_free_result();
}