Float Y -> Timer -> 0.0000
#1

I`ve got following declaration:
Код:
forward checkregion(killerid,oldx,oldy,distance);
Continue with this function:

Код:
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid,X,Y,Z);
printf("%f",Y);
Yy = Y - 500;
printf("%f",Yy);
SetTimerEx("checkregion",10000,0,"%f",playerid,X-500,Yy,500);
Y and Yy show me the real Y coordinates, but if i put
Код:
printf("%f",oldy);
on first line of the Timer "checkregion", it tells me,that oldy (= Yy) is 0.0000

Hoping on your answer ,
Trooper
Reply
#2

Where u start ?
And why you don't Create One Timer: SetTimerEx("checkregion",10000,1,"%f",playerid,X-500,Yy,500);
Reply
#3

Quote:

And why you don't Create One Timer:

Its the same.....
If i enter 0 or 1, theres no difference, i restart the Timer IN the timer....

Quote:

Where u start?

On top
Don`t know what you mean and if you need it...
Reply
#4

Код:
SetTimerEx("checkregion",10000,0,"iffi",playerid,X-500,Yy,500);
Reply
#5

Love you
Now the Value oldy REAL CONTAINS Y *happy*
Now im gonna do the rest

Where do you knew the solution from?
Where did you have learned that?
I`d like to get my own Problems fixed by myself in the future
Reply
#6

Quote:
Originally Posted by =>Sandra<=
Код:
SetTimerEx("checkregion",10000,0,"iffi",playerid,X-500,Yy,500);
i = integer, f = float.

playerid is a integer, X is float, Y is float, 500 is a integer(number).
Reply
#7

Quote:
Originally Posted by Trooper[Y
]
Where do you knew the solution from?
Where did you have learned that?
I`d like to get my own Problems fixed by myself in the future
By searching, reading the wiki, reading other scripts and trying myself (trial and error).
Reply
#8

No i see that distance is 0.00000

All i can do is crying for help again, i tried "iffi" AND "ifff" .....

call the function
Код:
		new Yy = Y - 500;
		SetTimerEx("checkregion",10000,0,"iffi",playerid,X-500,Yy,500);
in "checkregion"
Код:
new Float:X,Float:Y,Float:Z;
	GetPlayerPos(killerid,X,Y,Z);
	oldx2 = oldx + distance + distance;
	oldy2 = oldy - distance - distance;
	printf("%f",distance); //Distanz
	printf("%f",oldx); //down
	printf("%f",oldx2); //top
	printf("%f",oldy); //left
	printf("%f",oldy2); //right
  printf("%f",X); // x position
  printf("%f",Y); // y position
the log
Код:
[21:47:18] 0.000000
[21:47:18] 996.320678
[21:47:18] 996.381713
[21:47:18] 1714.896972
[21:47:18] 1714.774902
[21:47:18] 1557.694213
[21:47:18] 2233.951904
I think im to stupid for the Timer
Reply
#9

The timer is allright, you made a mistake in the print-funtion:
Код:
printf("%f",distance); //Distanz
since 'distance' is a decimal, you should use %d instead of %f:
Код:
printf("%d",distance); //Distanz
Reply
#10

Now its printed right (thanks), but theres no change on calculating....

Watch this:
Код:
	oldxx = oldx - distance;
	oldx2 = oldx + distance;
Distance is 500,so this:
Код:
[22:06:05] 500 //distance
[22:06:05] 1058.012084 //oldxx
[22:06:05] 1058.134155 //oldx2
is wrong, but i don`t know why and where it turned wrong !

I mean, even if DIstance would be zero,
theres a difference of 0.122129, and thats not twice var distance !

Please help this poor lonesome Cowboy
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)