06.07.2011, 08:36
pawn Код:
new UselessData[129], data2[6], Playername[MAX_PLAYER_NAME],QueryString[100],Line[100];
GetPlayerName(playerid,Playername,sizeof(Playername));
format(QueryString,sizeof(QueryString),"SELECT * FROM `playerinfo` WHERE `user` = '%s'",Playername); // Select the row of the player
mysql_query(QueryString);
mysql_fetch_row(Line); // This gets whole MySQL row
sscanf(Line,"p<|>s[128]s[24]ddddds[24]dd",UselessData,UselessData,data2[0],data2[1],data2[2],data2[3],UselessData,data2[4],data2[5]); // Using SSCANF by ****** to split the line
SetPVarInt(playerid, "Kills", data2[0]); //Sets Pvar ints
SetPVarInt(playerid, "Logged", 1); //Sets Pvar ints
SetPVarInt(playerid, "Deaths", data2[1]); //Sets Pvar ints
SetPlayerScore(playerid, data2[2]); // Set Score
GivePlayerMoney(playerid, data2[3]); // Set Cash
SetPVarInt(playerid, "Admin", data2[4]);
SetPVarInt(playerid, "GM", data2[5]);
mysql_free_result();