29.09.2012, 12:53
pawn Code:
stock LoadStats(playerid)
{
new pName[24],Query[200];
GetPlayerName(playerid,pName,24);
format(Query, sizeof(Query), "SELECT * FROM `users` WHERE `username` = '%s' ", pName);
mysql_query(Query);
mysql_store_result();
new rstr[100];
while(mysql_fetch_row_format(Query, "|"))
{
mysql_fetch_field_row(rstr, "money");
PlayerInfo[playerid][Pmoney] = strval(rstr);
mysql_fetch_field_row(rstr, "admin");
PlayerInfo[playerid][Padmin] = strval(rstr);
}
mysql_free_result();
GivePlayerMoney(playerid,PlayerInfo[playerid][Pmoney]);
return 1;
}