Pawno hates me -.-#
#1

Hey girls.

Currently, i have this snippet :
Код:
stock DistanceCameraTargetToLocation(Float:CamX, Float:CamY, Float:CamZ,  Float:ObjX, Float:ObjY, Float:ObjZ,  Float:FrX, Float:FrY, Float:FrZ)
{

	new Float:TGTDistance;
	// get distance from camera to target
	TGTDistance = floatsqroot((CamX - ObjX) * (CamX - ObjX) + (CamY - ObjY) * (CamY - ObjY) + (CamZ - ObjZ) * (CamZ - ObjZ));

	new Float:tmpX, Float:tmpY, Float:tmpZ;

	tmpX = FrX * TGTDistance + CamX;
	tmpY = FrY * TGTDistance + CamY;
	tmpZ = FrZ * TGTDistance + CamZ;
	new Float:calc = floatsqroot((tmpX - ObjX) * (tmpX - ObjX) + (tmpY - ObjY) * (tmpY - ObjY) + (tmpZ - ObjZ) * (tmpZ - ObjZ));
	printf("%f %d",calc,(calc < 10.0));
	return (calc < 10.0);
}
and i use it like this :
Код:
if(DistanceCameraTargetToLocation(cx, cy, cz, cc_p[0],cc_p[1],cc_p[2], fx, fy, fz) == 1)
or
Код:
if(DistanceCameraTargetToLocation(cx, cy, cz, cc_p[0],cc_p[1],cc_p[2], fx, fy, fz))
Printout :
Quote:

[19:27:12] 1.468024 1

I mean, what the god dawn ...

I have 1,4 as float - ok
The result is = 1

But even in the printout its 1, my if-condition isnt true

Why ?
This have to be some odd bug from pawno...

Regards,
Trooper
Reply


Messages In This Thread
Pawno hates me -.-# - by Trooper[Y] - 24.06.2010, 17:28
Re: Pawno hates me -.-# - by Antonio [G-RP] - 24.06.2010, 17:32
Re: Pawno hates me -.-# - by kaallaaroy - 24.06.2010, 17:33
Re: Pawno hates me -.-# - by Trooper[Y] - 24.06.2010, 17:36
Re: Pawno hates me -.-# - by Hiddos - 24.06.2010, 17:43
Re: Pawno hates me -.-# - by Trooper[Y] - 24.06.2010, 17:44
Re: Pawno hates me -.-# - by Hiddos - 24.06.2010, 17:45
Re: Pawno hates me -.-# - by Trooper[Y] - 24.06.2010, 18:39
Re: Pawno hates me -.-# - by Flashy - 24.06.2010, 18:43

Forum Jump:


Users browsing this thread: 2 Guest(s)