SQLite - Save position player
#1

Hi all ^^

My code:

Код:
new string[256];
new Float:posx;
new Float:posy;
new Float:posz;

GetPlayerPos(playerid, posx, posy, posz);
format(string, sizeof(string), "UPDATE `PLAYER` SET `POSX` = '%f' AND `POSY` = '%f' AND `POSZ` = '%f' WHERE NAME= '%s'", posx, posy, posz, DB_Escape(NamePlayer(playerid)));
db_free_result(db_query(Sqlite, string));
No save in Sqlite.db, code of table:

Код:
CREATE TABLE `PLAYER` (`NAME` VARCHAR(45), `SCORE` SMALLINT(5) DEFAULT 0, `KARMA` SMALLINT(5) DEFAULT 0, `POSX` FLOAT DEFAULT 0.0, `POSY` FLOAT DEFAULT 0.0, `POSZ` FLOAT DEFAULT 0.0, `SKIN` SMALLINT(3) DEFAULT 0);
PD: I create POSX, POSY and POSZ in table with Float. But not save, for default in db 0.0

Thx for all, waiting posible fix
Reply
#2

pawn Код:
format(string, sizeof(string), "UPDATE `PLAYER` SET `POSX` = %f, `POSY` = %f, `POSZ` = %f WHERE `NAME`= '%s'", posx, posy, posz, DB_Escape(NamePlayer(playerid)));
Reply
#3

Quote:
Originally Posted by Knappen
Посмотреть сообщение
pawn Код:
format(string, sizeof(string), "UPDATE `PLAYER` SET `POSX` = %f, `POSY` = %f, `POSZ` = %f WHERE `NAME`= '%s'", posx, posy, posz, DB_Escape(NamePlayer(playerid)));
Thx Knappen, work! ^^
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)