Mersad Posted October 26, 2023 Share Posted October 26, 2023 Hello Everyone! I have the following code: local thePlayer = localPlayer local x, y, z = getElementPosition(thePlayer) local rot = getPedRotation(thePlayer) local newX, newY = getPointFromDistanceRotation(x, y, 3, rot+180) So, this code calculates the coordinates (x and y) 3 meters in front of the player's position. Now, I want to check if the highest point at these coordinates is water (true) or not (false). This is to ensure that the action is only performed if there is water in front of the player. How can I achieve this? Link to comment
FlyingSpoon Posted October 26, 2023 Share Posted October 26, 2023 Would this work for your approach? https://wiki.multitheftauto.com/wiki/TestLineAgainstWater 1 Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now