21.08.2011, 10:34
Read in wikipedia the result of those functions. It's some bad tutorial you readed.
try this:
try this:
pawn Code:
MySQL_Login(playerid)
{
new query[67], pname[24], savingstring[64];
GetPlayerName(playerid, pname, 24);
format(query, sizeof(query), "SELECT * FROM users WHERE name = '%s' LIMIT 1", pname);
mysql_query(query);
mysql_store_result();
if(mysql_fetch_row_format(savingstring,"|"))
{
mysql_fetch_field_row(savingstring, "level"); SetPlayerScore(playerid, strval(savingstring));
ResetPlayerMoney(playerid);
mysql_fetch_field_row(savingstring, "money"); GivePlayerMoney(playerid, strval(savingstring));
mysql_fetch_field_row(savingstring, "Adminlevel"); Playerdata[playerid][Adminlevel] = strval(savingstring);
mysql_fetch_field_row(savingstring, "bank"); Playerdata[playerid][Bank] = strval(savingstring);
mysql_fetch_field_row(savingstring, "exp"); Playerdata[playerid][Exp] = strval(savingstring);
mysql_fetch_field_row(savingstring, "tut"); Playerdata[playerid][Bank] = strval(savingstring);
mysql_fetch_field_row(savingstring, "xpos"); Playerdata[playerid][Xpos] = strval(savingstring);
mysql_fetch_field_row(savingstring, "ypos"); Playerdata[playerid][Ypos] = strval(savingstring);
mysql_fetch_field_row(savingstring, "zpos"); Playerdata[playerid][Zpos] = strval(savingstring);
mysql_fetch_field_row(savingstring, "apos"); Playerdata[playerid][Apos] = strval(savingstring);
mysql_fetch_field_row(savingstring, "tut"); Playerdata[playerid][Tut] = strval(savingstring);
}
mysql_free_result();
SendClientMessage(playerid, -1, "You have been logged in.");
SetSpawnInfo(playerid, -1, Playerdata[playerid][Skin], Playerdata[playerid][Xpos], Playerdata[playerid][Ypos], Playerdata[playerid][Zpos], Playerdata[playerid][Apos], -1, -1, -1, -1, -1, -1);
SpawnPlayer(playerid);
return 1;
}