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
#2

1. Shiity title.
2. How do you expect help calling us girls?

Grow up kid. Seriously.
Reply
#3

sad state, no dolls
Reply
#4

Hm, its just for attracking your attention (worked fine),
as this category gets flooded with requests.

Girls is, cause i love scrubs...
If you dont like it, i wont use it anymore.

Reply
#5

Yep, it worked.

I'm not sure, but it might be because you're returning a float value. Maybe try if(bla == float(1))?
Reply
#6

I dont return a float value anywhere
Reply
#7

Quote:
Originally Posted by Trooper[Y
]
I dont return a float value anywhere
Код:
1.468024 1
AFAIK, that's a float value.
Reply
#8

printf("%f %d",calc,(calc < 10.0));

I return %d
Reply
#9

Quote:
Originally Posted by ♂ Antonio [G-RP
]
1. Shiity title.
2. How do you expect help calling us girls?

Grow up kid. Seriously.
I have watch you and now I have some conclusions:
Stop to annoy the whole forum with you spam and childish post because you never give some tips. You just look around what users make wrong and then you annoy them with this.

You have no right to control how people chose there title for topics. Grow up please (you!)

Topic: Like Hiddos said.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)