21.08.2011, 17:27
I have this now:
But dont work.
And when i type /stats it gives:
______________|Stats|______________
Level: 0 - Exp: 0 - Skin: 1685024101
Money: 0.000000 - Bank: 0.000000 - Tutorial: 0
Script:
and i spawn on a freaky location. (Bluebarry)
Thanks...!
pawn Code:
MySQL_Login(playerid)
{
new query[67], pname[24], savingstring[250];
GetPlayerName(playerid, pname, 24);
format(query, sizeof(query), "SELECT level, money, Adminlevel, bank, exp, xpos, ypos, zpos, apos, tut FROM users WHERE name = '%s' LIMIT 1", pname);
mysql_query(query);
mysql_store_result();
if(mysql_fetch_row_format(savingstring))
{
sscanf(savingstring,"p<|>iiiiiffffi", Playerdata[playerid][Level], Playerdata[playerid][Money], Playerdata[playerid][Adminlevel], Playerdata[playerid][Bank], Playerdata[playerid][Exp], Playerdata[playerid][Xpos], Playerdata[playerid][Ypos], Playerdata[playerid][Zpos], Playerdata[playerid][Apos], Playerdata[playerid][Tut]);
}
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;
}
And when i type /stats it gives:
______________|Stats|______________
Level: 0 - Exp: 0 - Skin: 1685024101
Money: 0.000000 - Bank: 0.000000 - Tutorial: 0
Script:
pawn Code:
CMD:stats(playerid, params[])
{
SendClientMessage(playerid, COLOR_YELLOW, "______________|Stats|______________");
format(string, sizeof(string), "Level: %i - Exp: %i - Skin: %i", GetPlayerScore(playerid), Playerdata[playerid][Exp], GetPlayerSkin(playerid));
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string, sizeof(string), "Money: %f - Bank: %f - Tutorial: %i", GetPlayerMoney(playerid), Playerdata[playerid][Bank], Playerdata[playerid][Tut]);
SendClientMessage(playerid, COLOR_YELLOW, string);
return 1;
}
Thanks...!