mysql_fetch_field_row
#7

I have this now:
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;
}
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:
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;
}
and i spawn on a freaky location. (Bluebarry)

Thanks...!
Reply


Messages In This Thread
mysql_fetch_field_row - by wouter0100 - 21.08.2011, 10:15
Re: mysql_fetch_field_row - by Macluawn - 21.08.2011, 10:21
Re: mysql_fetch_field_row - by Jochemd - 21.08.2011, 10:24
Re: mysql_fetch_field_row - by wouter0100 - 21.08.2011, 10:27
Re: mysql_fetch_field_row - by Macluawn - 21.08.2011, 10:34
Re: mysql_fetch_field_row - by wouter0100 - 21.08.2011, 12:31
Re: mysql_fetch_field_row - by wouter0100 - 21.08.2011, 17:27
Re: mysql_fetch_field_row - by wouter0100 - 21.08.2011, 18:21

Forum Jump:


Users browsing this thread: 2 Guest(s)