MySQL & Sscanf
#1

Hello all, I have problem with MySQL and Sscanf :/
ok, so when I disconnect from server - ok, server saves my last poz,
but.. when i connecting sscanf my poz loading fine but my position is sets to 0.0.

My LoadPlayerData stock

pawn Код:
stock LoadPlayerData( playerid )
{
    new
        String[ 500 ],
        explode,Float:Pos[ 3 ]
    ;
    mysql_fetch_row( String );
    sscanf( String, "p<|>s[24]s[25]dddddddddddfffdd",
    explode,explode,
    playerDB[ playerid ][ admin ],
    playerDB[ playerid ][ vip ],
    playerDB[ playerid ][ pinigai ],
    playerDB[ playerid ][ wlevel ],
    playerDB[ playerid ][ plead ],
    playerDB[ playerid ][ specialybe ],
    playerDB[ playerid ][ kalejimo_laikas ],
    playerDB[ playerid ][ uniforma ],
    playerDB[ playerid ][ uniformd ],
    playerDB[ playerid ][ narkotikai ],
    playerDB[ playerid ][ wworld],
    playerDB[ playerid ][ teises ],
    playerDB[ playerid ][ interiors ],
    playerDB[ playerid ][ mobsas ],
    Pos[ 0 ],Pos[ 1 ],Pos[ 2 ],
    playerDB[ playerid ][ drabuziai ],
    playerDB[ playerid ][ lytis ],
    playerDB[ playerid ][ score ] );
    GivePlayerMoneyA( playerid, playerDB[ playerid ][ pinigai ] );
    SetPlayerVirtualWorld( playerid, playerDB[ playerid ][ wworld ] );
    SetPlayerInterior( playerid, playerDB[ playerid ][ interiors ] );
    SetPlayerPos( playerid, Pos[ 0 ],Pos[ 1 ],Pos[ 2 ] );
}
Reply
#2

Is the pos in your database updated ?
Reply
#3

Yes.

And sscanf it loading fine

Then saving
Quote:

CMySQLHandler::Query(UPDATE `players` SET `Money.Pocket` = '0', `Wanted` = '0', `Lead` = '0', `Kalejime` = '0',`Job` = '0',`Drabuziai` = '-1', `Uniforma` = '-1', `Uniformad` = '0', `Xp` = '0', `Mobsas` = '1318926965', `Lytis` = '0',`X` = '139.522338',`Y` = '-65.921928', `Z` = '1.570331', `Interior` = '0', `Drugs` = '0', `License` = '0', `World` = '0' WHERE `Vardas` = 'Raimis_Reksnys' ) - Successfully executed.

[09:27:38] >> mysql_query( Connection handle: 1 )

[09:27:38] CMySQLHandler::Query(SELECT * FROM `players` WHERE Vardas = 'Raimis_Reksnys' ) - Successfully executed.

[09:27:38] >> mysql_store_result( Connection handle: 1 )

[09:27:38] CMySQLHandler::StoreResult() - Result was stored.

Then loading

Quote:

>> mysql_fetch_row_format( Connection handle: 1 )

[09:27:43] CMySQLHandler::FetchRow() - Return: Raimis_Reksnys|lopas|2|0|0|0|0|0|0|-1|0|0|0|0|0|1318926965|139.522|-65.9219|1.57033|-1|0|0

[09:29:11] >> mysql_real_escape_string( Connection handle: 1 )

[09:29:11] CMySQLHandler::EscapeString(Raimis_Reksnys); - Escaped 14 characters to Raimis_Reksnys.

Reply
#4

Okey i'dont bumping topic but i whas testing poz.
See this

pawn Код:
printf("Pos 0 %f Pos 1 %f Pos 2 %f",Pos[ 0 ],Pos[ 1 ],Pos[ 2 ] );
And result is

Quote:

join] Raimis_Reksnys has joined the server (0:127.0.0.1)
[11:58:16] Pos 0 0.000000 Pos 1 0.000000 Pos 2 0.000000

but in the mysql_debug its loading fine

Quote:

CMySQLHandler::FetchRow() - Return: Raimis_Reksnys|lopas|0|0|5000|0|0|0|0|-1|0|0|0|0|0|20|1657.42|-2322.03|13.3828|117|1|0

Poz is 1657.42|-2322.03|13.3828

so probleam
Reply
#5

Bump. Plz help :/
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)