Michael Wojtanis 23 Posted August 7, 2015 Share Posted August 7, 2015 Hello, i have problem with this: static BOOL _WORLD3D_TO_SCREEN2D(float x3d, float y3d, float z3d, float* x2d, float* y2d) When i call it, this return amazing big float and crashing game because this is too big from float.I use C#, somebody know how to call it correctly? Link to post Share on other sites
CamxxCore 156 Posted August 8, 2015 Share Posted August 8, 2015 (edited) Hello, i have problem with this: static BOOL _WORLD3D_TO_SCREEN2D(float x3d, float y3d, float z3d, float* x2d, float* y2d)When i call it, this return amazing big float and crashing game because this is too big from float.I use C#, somebody know how to call it correctly? Try this: bool Get2DScreenPos(Vector3 position, out PointF screenPos) {var posX = new OutputArgument();var posY = new OutputArgument();var result = Function.Call<bool>(Hash._WORLD3D_TO_SCREEN2D, position.X, position.Y, position.Z, posX, posY);if (result)screenPos = new PointF((posX.GetResult<float>() * UI.Width), (posY.GetResult<float>() * UI.Height);else screenPos = new PointF();return result;} I would say use the function in scripthookvdotnet but it never returns anything. Edited August 8, 2015 by CamxxCore Link to post Share on other sites
Michael Wojtanis 23 Posted August 8, 2015 Author Share Posted August 8, 2015 (edited) Okey, ...new PointF((posX.GetResult<float>() * UI.Width... I do not knew this is like that in GTA V. Also, why UI.WIDTH? Can replace as game width? EDIT2: No, YOU CANT. EDIT: Replaced. Working fine. UI return my... first screen width. Not game width.So i replaced for Game.ScreenResolution.Width and looks fine. Edited August 8, 2015 by Michael Wojtanis Link to post Share on other sites