mySQL not loading position
#1

Hello, i have a problem, mySQL loading all data, but not position.

mysql_log:
Код HTML:
[03:36:23] CMySQLHandler::Query(SELECT * FROM `zaidejai` WHERE Vardas = 'Harry_Jones') - Successfully executed.

[03:36:23] >> mysql_store_result( Connection handle: 1 )

[03:36:23] CMySQLHandler::StoreResult() - Result was stored.

[03:36:23] >> mysql_retrieve_row( Connection handle: 1 )

[03:36:23] >> mysql_fetch_field_row( Connection handle: 1 )

[03:36:23] CMySQLHandler::FetchField("Lytis") - 0

[03:36:23] >> mysql_fetch_field_row( Connection handle: 1 )

[03:36:23] CMySQLHandler::FetchField("Skin") - 48

[03:36:23] >> mysql_fetch_field_row( Connection handle: 1 )

[03:36:23] CMySQLHandler::FetchField("x") - 

[03:36:23] >> mysql_fetch_field_row( Connection handle: 1 )

[03:36:23] CMySQLHandler::FetchField("y") - 

[03:36:23] >> mysql_fetch_field_row( Connection handle: 1 )

[03:36:23] CMySQLHandler::FetchField("z") - 

[03:36:23] >> mysql_fetch_field_row( Connection handle: 1 )

[03:36:23] CMySQLHandler::FetchField("r") - 

[03:36:23] >> mysql_fetch_field_row( Connection handle: 1 )

[03:36:23] CMySQLHandler::FetchField("Pinigai") - 20000

[03:36:23] >> mysql_fetch_field_row( Connection handle: 1 )

[03:36:23] CMySQLHandler::FetchField("XP") - 0

[03:36:23] >> mysql_free_result( Connection handle: 1 )

[03:36:23] CMySQLHandler::FreeResult() - Result was successfully free'd.

[03:37:44] >> mysql_query( Connection handle: 1 )

[03:37:44] CMySQLHandler::Query(UPDATE `zaidejai` SET Lytis = '0', Skin = '48', X = '148.980651', Y = '-65.400489', Z = '1.578125', R = '115.307769', Pinigai = '20000', XP = '0') - Successfully executed.
loading system:
Код HTML:
stock loadUser(playerid){
	new query[256], tmp[32], Float:pos[4];
	format(query, sizeof(query), "SELECT * FROM `zaidejai` WHERE Vardas = '%s'", getName(playerid));
	mysql_query(query);
	mysql_store_result();
	mysql_retrieve_row();
	mysql_fetch_field_row(tmp, "Lytis"); uInfo[playerid][Lytis] = strval(tmp);
	mysql_fetch_field_row(tmp, "Skin"); uInfo[playerid][Drabuziai] = strval(tmp);	
	mysql_fetch_field_row(tmp, "x"); pos[0] = floatstr(tmp);
	mysql_fetch_field_row(tmp, "y"); pos[1] = floatstr(tmp);
	mysql_fetch_field_row(tmp, "z"); pos[2] = floatstr(tmp);
	mysql_fetch_field_row(tmp, "r"); pos[3] = floatstr(tmp);
	mysql_fetch_field_row(tmp, "Pinigai"); uInfo[playerid][Pinigai] = strval(tmp); SetPlayerMoney(playerid, uInfo[playerid][Pinigai]);
	mysql_fetch_field_row(tmp, "XP"); uInfo[playerid][XP] = strval(tmp); SetPlayerScore(playerid, uInfo[playerid][XP]);
	mysql_free_result();

	SetSpawnInfo(playerid, 0, uInfo[playerid][Drabuziai], pos[0], pos[1], pos[2], pos[3], 0, 0, 0, 0, 0, 0);
	SpawnPlayer(playerid);
	printf("[.:.]: Zaidejas %s (IP: %s) pakrautas !", getName(playerid), getIP(playerid));	
}
Reply
#2

You should be retrieving the row as a float

https://sampwiki.blast.hk/wiki/MySQL/R33..._get_row_float
Reply
#3

And, you are using outdated mysql version as i see.
I council you to change it ASAP because later you will regret when you will need the new functions
Reply
#4

Quote:
Originally Posted by Flake.
Посмотреть сообщение
You should be retrieving the row as a float

https://sampwiki.blast.hk/wiki/MySQL/R33..._get_row_float
my mysql version r5
Reply
#5

Quote:
Originally Posted by HJones
Посмотреть сообщение
my mysql version r5
Update it then.
Reply
#6

Yes i knew it because i used it also before and done your same mistake, in the end i had to rework my whole script af... Get R39-5 Version
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)