Jump to content

need help to add a function on my system


Weigh

Recommended Posts

 

Good evening I would add to my door system a function that forces the player to be close enough to the door to use the command to open the door.

I would understand if you did not give me the whole code but at least tell me the necessary functions

I'm french sorry for my english.

 

Bye ;)

Edited by Weigh
Link to comment

You can use https://wiki.multitheftauto.com/wiki/GetElementPosition to get current player's position every frame with onClientRender and compare that to the door's position (again use same way to get door positron). For the comparing you'll need a function called getDistanceBetweenPoints3D. Good luck :) There are examples in wiki to help you. 

 

 

And if the player is in the specified interval, allow the player to use the command which opens the door. 

Edited by koragg
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...