01.07.2011, 10:31
pawn Код:
new Float:x, Float:y, Float:z, query[200];
GetPlayerPos(playerid, x, y, z);
format(query, sizeof(query), "INSERT INTO `positions` (`x`, `y`, `z`) VALUES (%f, %f, %f)", x, y, z);
mysql_query(query);
edit: to update a certain row
pawn Код:
new Float:x, Float:y, Float:z, query[250], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerPos(playerid, x, y, z);
format(query, sizeof(query), "UPDATE `positions` SET `x`=%f AND `y`=%f AND `z`=%f WHERE `name`='%s'", x, y, z, name);
mysql_query(query);