Float:Z Check - 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: Float:Z Check (
/showthread.php?tid=89005)
Float:Z Check -
Marc_307 - 30.07.2009
Hi, with the command /check you should get a message after one second. The message includes the difference between the first coordinate of the Z-axis and it's new position after one second. (The axis belongs to an moving object [Speed=0.0625].)
But the problem is that the difference is too large to be real. (Over 1billion

)
Here's the Code, what might be incorrect?
pawn Код:
else if(strcmp("/check",cmdtext,true,6)==0)
{
GetObjectPos(obj1,x,y,z);
SetTimer("ZP",1000,0);
}
return 0;
}
public ZP(playerid)
{
GetObjectPos(obj1,x,y,z2);
new string[255];
format(string,sizeof(string),"%d",z-z2);
SendClientMessage(playerid,WHITE,string);
return 1;
}
Re: Float:Z Check -
Jefff - 30.07.2009
Its a float not integer
not
Re: Float:Z Check -
Marc_307 - 30.07.2009
Thx, it works much better now. But the shown number is still without a point.
I need a more exactly number like 1.234!
Re: Float:Z Check -
Joe Staff - 30.07.2009
Then get rid of the period in that, "%f"
Re: Float:Z Check -
Marc_307 - 30.07.2009
Thx, now it works well.