Jump to content

» «


3 replies to this topic
  • akrram

    Player Hater

  • Members
  • Joined: 08 Aug 2017
  • United-States


Posted 16 October 2017 - 04:34 PM

Hi, Newbie here,


I am trying to understand this function. If I use it with vehicle entity, which point of vehicle does it return?


I am trying to draw a circle on the top of vehicle in the top view, (using _WORLD3D_TO_SCREEN2D and DRAW_RECT functions).


But i cant figure out the coordinates. 


Any help with this is greatly appreciated. 

  • LeeC2202

    Mark Chump

  • Members
  • Joined: 24 Oct 2015
  • United-Kingdom


Posted 17 October 2017 - 07:34 PM

It will return the location of the origin (usually the chassis dummy) at 0,0,0 in the model. However, given the inability of some modders to place dummies at the correct location, don't guarantee that it will be where you expect it to be. I have seen it under ground on some vehicles.


If you draw two lines, one directly up from that location and one to the side, you will get an idea of where it is located.


Use this native DRAW_LINE(float x1, float y1, float z1, float x2, float y2, float z2, int r, int g, int b, int alpha) and call it once for each line.

  • akrram likes this

  • Skorpro


  • Members
  • Joined: 19 Jul 2009
  • Germany


Posted 18 October 2017 - 02:07 AM

Vector3 vec3;
float cx, cy;
Vehicle car;

vec3 = GET_ENTITY_COORDS(car, 1);
GET_SCREEN_COORD_FROM_WORLD_COORD/*_WORLD3D_TO_SCREEN2D*/(vec3.x, vec3.y, vec3.z, &cx, &cy);


And read this.

  • akrram likes this

  • akrram

    Player Hater

  • Members
  • Joined: 08 Aug 2017
  • United-States


Posted 18 October 2017 - 03:51 PM

Thanks to both of you.

I figured it out by placing a giant cube :lol:. I have solved this problem.

  • LeeC2202 likes this

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users