Quantcast

Jump to content

» «
Photo

how to know which vehicle door is the closest to the player

1 reply to this topic
nordi
  • nordi

    Square Civilian

  • Members
  • Joined: 17 Mar 2014
  • France

#1

Posted 29 July 2014 - 04:45 PM Edited by nordi, 16 August 2014 - 05:39 PM.

Hi

 

I would like the player to open the closest vehicle door, for example: if he is close to the right front passenger door, i'd like him to open the right front passenger door, but if he is close to the left rear passenger door, i'd like him to open the left rear passenger door.

I know how to actually open the door, but the problem is more to know which door is the closest to the player ?

Here is my current code, i think DistanceTo is the solution but i don't know what to set for the OffsetPosition of the vehicle:

thanks !


Jitnaught
  • Jitnaught

    ✰✰✰✰✰✰

  • Members
  • Joined: 24 Aug 2013
  • United-States

#2

Posted 29 July 2014 - 05:01 PM

DistanceTo and GetOffsetPosition is probably the best solution there is, but then you have to figure out the offset for each individual vehicle, and then if someone has car mods it would mess it up.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users