MySQL floats not loading!
#1

Once again with the MySQL problem here, this'll be the last I hope..


Now that everything works and there's no query errors/mysql_log.txt errors the floats aren't loading!

Код:
    pData[playerid][pPosX] = cache_get_field_content_float(0, "pPosX");
    pData[playerid][pPosY] = cache_get_field_content_float(0, "pPosY");
    pData[playerid][pPosZ] = cache_get_field_content_float(0, "pPosZ");
    pData[playerid][pPosA] = cache_get_field_content_float(0, "pPosA");
Printing pPosX with both these codes;

Код:
	new Float:tempstr = cache_get_field_content_float(0, "pPosX");
	printf("%f print1", tempstr);
	printf("%f print2", cache_get_field_content_float(0, "pPosX"));
just outputs this


Код:
[09:30:50] [DEBUG] cache_get_field_content_float - row: 0, field_name: "pPosX", connection: 1
[09:30:50] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "pPosX", data: "0"
[09:30:50] [DEBUG] cache_get_field_content_float - row: 0, field_name: "pPosY", connection: 1
[09:30:50] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "pPosY", data: "0"
[09:30:50] [DEBUG] cache_get_field_content_float - row: 0, field_name: "pPosZ", connection: 1
[09:30:50] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "pPosZ", data: "0"
[09:30:50] [DEBUG] cache_get_field_content_float - row: 0, field_name: "pPosA", connection: 1
[09:30:50] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "pPosA", data: "0"
All this is located under "OnAccountLoad"




Код:
	Float:pPosX,
	Float:pPosY,
	Float:pPosZ,
	Float:pPosA
That's under the pData enum

Table has correct types, everything saves but doesn't load!!
Reply
#2

Show the code the snippet is used in.
Reply
#3

Quote:
Originally Posted by Abagail
Посмотреть сообщение
Show the code the snippet is used in.
Код:
            WP_Hash(hashpass, sizeof(hashpass), inputtext);
            if(!strcmp(hashpass, pData[playerid][pPass]))
            {
                mysql_format(mysql, query, sizeof(query), "SELECT * FROM `accs` WHERE `pName` = '%e' LIMIT 1", PlayerName(playerid));
                mysql_tquery(mysql, query, "OnAccountLoad", "i", playerid);
            }
Код:
forward OnAccountLoad(playerid); public OnAccountLoad(playerid)
{
	new Float:tempstr = cache_get_field_content_float(0, "pPosX");
	printf("%f print1", tempstr);
	printf("%f print2", cache_get_field_content_float(0, "pPosX"));
	GetPlayerIp(playerid, pData[playerid][pIP], 16);
    pData[playerid][pLevel] = cache_get_field_content_int(0, "pLevel");
    pData[playerid][pRespect] = cache_get_field_content_int(0, "pRespect");
    pData[playerid][pSkin] = cache_get_field_content_int(0, "pSkin");
    pData[playerid][pAdmin] = cache_get_field_content_int(0, "pAdmin");
    pData[playerid][pVIP] = cache_get_field_content_int(0, "pVIP");
    pData[playerid][pMoney] = cache_get_field_content_int(0, "pMoney");
    pData[playerid][pGender] = cache_get_field_content_int(0, "pGender");
    pData[playerid][pAge] = cache_get_field_content_int(0, "pAge");
    pData[playerid][pBank] = cache_get_field_content_int(0, "pBank");
    pData[playerid][pBanned] = cache_get_field_content_int(0, "pBanned");
    pData[playerid][pBans] = cache_get_field_content_int(0, "pBans");
    cache_get_field_content(0, "pBannedBy", pData[playerid][pBannedBy], mysql, MAX_PLAYER_NAME);
    cache_get_field_content(0, "pBanReason", pData[playerid][pBanReason], mysql, 130);
    cache_get_field_content(0, "pBanDate", pData[playerid][pBanDate], mysql, 32);
    cache_get_field_content(0, "pBanTime", pData[playerid][pBanTime], mysql, 32);
    pData[playerid][pBanAppealable] = cache_get_field_content_int(0, "pBanAppealable");
    pData[playerid][pFaction] = cache_get_field_content_int(0, "pFaction");
    pData[playerid][pRank] = cache_get_field_content_int(0, "pRank");
    pData[playerid][pFacSkin] = cache_get_field_content_int(0, "pFacSkin");
    pData[playerid][pPosX] = cache_get_field_content_float(0, "pPosX");
    pData[playerid][pPosY] = cache_get_field_content_float(0, "pPosY");
    pData[playerid][pPosZ] = cache_get_field_content_float(0, "pPosZ");
    pData[playerid][pPosA] = cache_get_field_content_float(0, "pPosA");
    pData[playerid][pTester] = cache_get_field_content_int(0, "pTester");
    pData[playerid][pTutStep] = cache_get_field_content_int(0, "pTutStep");
	pData[playerid][pFinishedTut] = cache_get_field_content_int(0, "pFinishedTut");
	pData[playerid][pMuted] = cache_get_field_content_int(0, "pMuted");

	gPlayerLogged[playerid] = 1;

    GivePlayerMoney(playerid, pData[playerid][pMoney]);
    SendClientMessage(playerid, COLOR_HAPPYGREEN, "You're ready to play! Hit the spawn button to begin!");
    return 1;
}
Reply
#4

Does your query actually run? Have you tried running your query in something like phpmyadmin and made sure it actually returns a row with values?

Edit: No where in that posted code do you execute a query...
Reply
#5

Quote:
Originally Posted by !damo!spiderman
Посмотреть сообщение
Does your query actually run? Have you tried running your query in something like phpmyadmin and made sure it actually returns a row with values?
Yes it does!
Everything loads, it's the floats that don't load
Reply
#6



and I believe this is where the query gets executed?

Код:
mysql_tquery(mysql, query, "OnAccountLoad", "i", playerid);
edit; how do i delete this i shouldn't have double posted
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)