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.

Ped & Vehicle Functions?

Featured Replies

Alright, so after many hours of reading online guides and having some much needed help from Sam, I managed to put together something extremely simple.

 

I know I had planned to do some sort of ANPR, but I see that Sniper has already got that covered and it'd probably be too much for me as an utter newbie to scripting, what I have done (or plan to continue doing) is incorporate the rest of the megaphone speeches that the AI use and then modify surrounding peds and vehicles so they react appropriately,

 

So far, I've got the speech working when you press 9 on the NumPad. Although it requires you to be in the COP BLACK skin with the same voice (not all models have the speech files).

 

What I need some help with:

 

The ped functions. I've so far tried putting this underneath;

World.GetClosestPed(Vector3 Position, float Radius);

But that's throwing up some errors, I need someone to explain how I can get this working. Same with the vehicles

 

If someone has the time, and patience, I'd love to hear how I can get peds and cars in a radius and cause them to react appropriately.

 

Many Thanks.

Processor: Intel i5-6600 @ 3.30GHz 

GPU: MSI ARMOR GeForce GTX 1080 OC

Ram: 16GB Skylake

Closest vehicle should work out of the box but closest ped function is totally unreliable.

 

Try something like this (may contain errors):

float dist = 1000f;
            Ped pedToFind = null;
            foreach (Ped p in World.GetPeds(Game.LocalPlayer.Character.Position, 30f))
            {
                if (p.Exists())
                {
                    float distCalculated = p.Position.DistanceTo(Game.LocalPlayer.Character.Position);
                    if (distCalculated < dist)
                    {
                        pedToFind = p;
                        dist = distCalculated;
                    }
                }
            }
            if (pedToFind.Exists())
            {
                // do something with closest ped
            }

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.