Float Y -> Timer -> 0.0000 -
Trooper[Y] - 21.04.2009
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
on first line of the Timer "checkregion", it tells me,that oldy (= Yy) is 0.0000
Hoping on your answer

,
Trooper
Re: Float Y -> Timer -> 0.0000 -
kasco - 21.04.2009
Where u start ?
And why you don't Create
One Timer: SetTimerEx("checkregion",10000,1,"%f",playerid,X-500,Yy,500);
Re: Float Y -> Timer -> 0.0000 -
Trooper[Y] - 21.04.2009
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....
On top

Don`t know what you mean and if you need it...
Re: Float Y -> Timer -> 0.0000 -
Sandra18[NL] - 21.04.2009
Код:
SetTimerEx("checkregion",10000,0,"iffi",playerid,X-500,Yy,500);
Re: Float Y -> Timer -> 0.0000 -
Trooper[Y] - 21.04.2009
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
Re: Float Y -> Timer -> 0.0000 -
HB - 21.04.2009
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).
Re: Float Y -> Timer -> 0.0000 -
Sandra18[NL] - 21.04.2009
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).
Re: Float Y -> Timer -> 0.0000 -
Trooper[Y] - 21.04.2009
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
Re: Float Y -> Timer -> 0.0000 -
Sandra18[NL] - 21.04.2009
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
Re: Float Y -> Timer -> 0.0000 -
Trooper[Y] - 21.04.2009
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