Skip to content
View in the app

A better way to browse. Learn more.

LCPDFR.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[Solved] DistanceTo "Coordinates"

Featured Replies

Hi guys, I made my first mod, yay.

I press a button and my car gets fixed and washed, if it's a police vehicle and I am inside it, I know it's so simple.

But now I am stuck, I spend the entire night on google, and trying out everything I could think of to make it work, including reading a ton of C# stuff, but I can't wrap my head around how to actually do it.

 

So here goes:

I have made a mod where I can press a key and something happens, but what if I only want something to happen near one or more coordinates ?

I tried messing around with this: Game.LocalPlayer.Character.Position.Around() -- but I can't get it to accept my Vector3 without making a ton of errors.

 

To be honest I am not really sure how to put it together, I am just trying to learn 🙂 

Edited by Demuth
Solved

/Demuth

  • Management Team

You can check if the player is near a given position like this (where 5 is the x coordinate, 6 the y coordinate, 7 the z coordinate and 20 the distance):

if (Game.LocalPlayer.Character.Position.DistanceTo(new Vector3(5, 6, 7)) < 20)
{
}

 

Please do not PM me unless really necessary (knowing you helps). If you think you need my attention in a topic, tag me.

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...

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.