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.

Suspect glitching (refusing to go down?)

Featured Replies

Hey guys! Recently got into developing and hope to eventually, after getting a little better release a callout pack. 

 

Today I've spent a few hours on some code and I'm not exactly sure why I'm having so many issues with it. It could just be something obvious and my lack of experience is making me miss something important, but I'm not able to find what is wrong with my code.

Any help would be amazing!

 

The issue is shown below this that video:

 

 

Here is the the only part I think I could have messed up in the code:

           

            if (Game.LocalPlayer.Character.DistanceTo(Suspect.Position) < 20f)
            {
                Suspect.Tasks.FightAgainst(Game.LocalPlayer.Character);
            }
            else
            {
                Suspect.Tasks.Wander().WaitForCompletion(20000);
            }
            if (Suspect.IsDead || Suspect.IsCuffed)
            {
                End();
                Game.DisplayNotification("Dispatch we are Code 4, No additionals needed");
                Functions.PlayScannerAudio("ALL_UNITS CODE_4_ADAM_NO_ADDITIONAL");
            }

 

Again, thanks for any help and if anyone would like to help me further, send me a pm or let me know in this forum and i'll send you the entire thing. 

 

I have these set as that as well.

  1.    Suspect.IsPersistent = true;
  2.             Suspect.BlockPermanentEvents = true;

Understand, our police officers put their lives on the line for us every single day. They've got a tough job to do to maintain public safety and hold accountable those who break the law. - Barack Obama

You call  Suspect.Tasks.FightAgainst(Game.LocalPlayer.Character); directly inside Process() => it means that whenever (Game.LocalPlayer.Character.DistanceTo(Suspect.Position) < 20f) == true the game assigns a new task to your ped. You should use switch..case + enum containing stages or my method based on Action. I suggest to take a look at Albo's tutorials.

Here are links to my library and example of use:

https://github.com/LtFlash/LtFlash.Common/blob/master/LtFlash.Common/Processes/ProcessHost.cs

https://github.com/LtFlash/LtFlash.Common/blob/master/Examples/Processes/ProcessHost.cs

 

  • Author

Thanks for the help!

Understand, our police officers put their lives on the line for us every single day. They've got a tough job to do to maintain public safety and hold accountable those who break the law. - Barack Obama

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.