[HELP] Saving pos.. Types of Variables - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] Saving pos.. Types of Variables (
/showthread.php?tid=124022)
[HELP] Saving pos.. Types of Variables -
Zafire2008 - 28.01.2010
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
Re: [HELP] Saving pos.. Types of Variables -
Finn - 28.01.2010
Use
%f when you're formatting floats.