26.07.2012, 19:14
pawn Код:
stock MySQL_Login(playerid)
{
new query[900], pname[24], savingstring[50];
GetPlayerName(playerid, pname, 24);
format(query, sizeof(query), "SELECT Cash, Level, EXP, Rank, TurfsCaptured, TurfsLost, Kills, Deaths, Score, Muted, Warnings, Vip FROM playerdata WHERE User = '%s'", pname);
mysql_query(query);
mysql_store_result();
while(mysql_fetch_row_format(query,"|"))
{
mysql_fetch_field_row(savingstring, "Cash"); GivePlayerMoney(playerid, strval(savingstring));
mysql_fetch_field_row(savingstring, "Level"); PInfo[playerid][Level] = strval(savingstring);
mysql_fetch_field_row(savingstring, "EXP"); PInfo[playerid][EXP] = strval(savingstring);
mysql_fetch_field_row(savingstring, "Rank"); PInfo[playerid][Rank] = strval(savingstring);
mysql_fetch_field_row(savingstring, "TurfsCaptured"); PInfo[playerid][TurfsCaptured] = strval(savingstring);
mysql_fetch_field_row(savingstring, "TurfsLost"); PInfo[playerid][TurfsLost] = strval(savingstring);
mysql_fetch_field_row(savingstring, "Kills"); PInfo[playerid][Kills] = strval(savingstring);
mysql_fetch_field_row(savingstring, "Deaths"); PInfo[playerid][Deaths] = strval(savingstring);
mysql_fetch_field_row(savingstring, "Score"); PInfo[playerid][Score] = strval(savingstring);
mysql_fetch_field_row(savingstring, "Muted"); PInfo[playerid][Muted] = strval(savingstring);
mysql_fetch_field_row(savingstring, "Warnings"); PInfo[playerid][Warnings] = strval(savingstring);
mysql_fetch_field_row(savingstring, "Vip"); PInfo[playerid][Vip] = strval(savingstring);
}
mysql_free_result();
TogglePlayerSpectating(playerid, 0);
PInfo[playerid][Logged] = 1;
SendClientMessage(playerid,COLOR_ORANGE,"[*]: You Have Successfully Logged In!");
return 1;
}