24.06.2010, 17:28
Hey girls.
Currently, i have this snippet :
and i use it like this :
or
Printout :
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
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); }
Код:
if(DistanceCameraTargetToLocation(cx, cy, cz, cc_p[0],cc_p[1],cc_p[2], fx, fy, fz) == 1)
Код:
if(DistanceCameraTargetToLocation(cx, cy, cz, cc_p[0],cc_p[1],cc_p[2], fx, fy, fz))
Quote:
[19:27:12] 1.468024 1 |
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