[HELP] Saving pos.. Types of Variables
#1

hey i need help here i am triyng to onplayerupdate save position in a database here is my code

Код:
public GuardarPos(playerid)
{
	new Float:x, Float:y, Float:z;
  GetPlayerPos(playerid, x, y, z);
	new qry[128];
	new pname[MAX_PLAYER_NAME];
	GetPlayerName(playerid, pname, sizeof(pname));
	printf("%i cambio su posicion: x: %d y: %d z: %d",playerid, x, y, z);
 	format(qry, sizeof(qry), "UPDATE `evo`.`jugadores` SET `Px` ='%d' `Py` ='%d' `Pz` ='%d' WHERE `jugadores`.`Nombre` ='%s' LIMIT 1", x, y, x, pname);
}
He show meee the pos in the Consolee of the server.. but no decimals like 1250.20545 show me 45121542128 i think there is an error with the types of variables.. and another problem iss doesnt update the database
Reply
#2

Use %f when you're formatting floats.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)