Jump to content

Hello need help on detecting which side a police car(the player) is passing on and make the cars move to the opposite lane away from the player


timnboys

Recommended Posts

Hello need help on detecting which side a police car(the player) is passing on and make the cars move to the opposite lane away from the player

as I was trying to implement this but I still haven't gotten it to work like I want yet(as they still jump right in front of me and I have to go around them to avoid hitting them.)

if anyone could provide some sample code to do something like this it will be much appreciated 

My plugins by me are on this site in addition to my own site as well.

Do Not PM Me for Support! follow the instructions for getting support with any mods. 

Link to comment
Share on other sites

if (Vector3.Distance(Game.LocalPlayer.Character.Position, veh.GetOffsetPosition(Vector3.RelativeLeft * 2f) < Vector3.Distance(Game.LocalPlayer.Character.Position, veh.GetOffsetPosition(Vector3.RelativeRight* 2f)) 
                     { //player is on the left 
                     }
                     else { //player is on the right 
                     }

That's what I use :wink:

My YouTube: Click here. 

My Discord Server - https://discord.gg/0taiZvBSiw5qGAXU

Useful post? Let me and others know by clicking the Like button.
Check out my many script modifications! 
Having issues? LSPDFR Troubleshooter by Albo1125.

Link to comment
Share on other sites

2 hours ago, Albo1125 said:

if (Vector3.Distance(Game.LocalPlayer.Character.Position, veh.GetOffsetPosition(Vector3.RelativeLeft * 2f) < Vector3.Distance(Game.LocalPlayer.Character.Position, veh.GetOffsetPosition(Vector3.RelativeRight* 2f)) 
                     { //player is on the left 
                     }
                     else { //player is on the right 
                     }

That's what I use :wink:

thanks albo I will try that and see if that works.

My plugins by me are on this site in addition to my own site as well.

Do Not PM Me for Support! follow the instructions for getting support with any mods. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...