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.

Making ped stay in the area

Featured Replies

Basically the goal is to make the suspects stay in the area filled with potential covers to make it more difficult for police forces to put them down. The problem is that once in combat they run all over the place and end up out in the open, easy to kill... Is it possible to limit their actions in combat?

 

I tried to force them to "TakeCoverAt" the specific positions every time they find themselves more than 100 feet from their spawn points but I came up short. 

Edited by PawelSad12

If you've engaged them in a pursuit then they will use the custom AI to escape the police.

If you specifically want them to stay put then you need to assign a task to them and make it persistent i.e no other tasks can override it.

Live Streaming daily from 8pm GMT (UK) at https://twitch.tv/OfficialLukeD - I play a variety of things 😄

Join my official discord server for support, general chat and my stream schedule! https://discord.gg/Mddj7PQ

  • Author
8 hours ago, LukeD said:

If you've engaged them in a pursuit then they will use the custom AI to escape the police.

If you specifically want them to stay put then you need to assign a task to them and make it persistent i.e no other tasks can override it.

 

Thank you.

They're not in the pursuit. I've followed your other advise but the game has crashed and I can't really say why. Could you have a quick look?

 

            GameFiber.StartNew(delegate
            {
                //meansnothing is set to true by now
                Guard1.Tasks.TakeCoverAt(Spawn1, Spawn2, 200000, MEANSNOTHING);
                Guard2.Tasks.TakeCoverAt(Spawn1, Spawn2, 200000, MEANSNOTHING);
                GameFiber.Sleep(9000); //time for finding cover
                Game.SetRelationshipBetweenRelationshipGroups("MYENEMY", "COP", Relationship.Hate);

                while (true)
                {
                    GameFiber.Yield();
                    if (Guard1.IsAlive)
                    {
                        break;
                    }
                }

                NativeFunction.Natives.TASK.STAY.IN.COVER(Guard1);
                NativeFunction.Natives.TASK.STAY.IN.COVER(Guard2);
            });
[4/25/2020 1:28:20 AM.145] LSPD First Response: Exception type: Microsoft.CSharp.RuntimeBinder.RuntimeBinderException
[4/25/2020 1:28:20 AM.145] LSPD First Response: Exception message: 'object' does not contain a definition for 'TASK'
[4/25/2020 1:28:20 AM.145] LSPD First Response: ------------------------------
[4/25/2020 1:28:20 AM.145] LSPD First Response: Inner exceptions:
[4/25/2020 1:28:20 AM.145] LSPD First Response: ------------------------------
[4/25/2020 1:28:20 AM.145] LSPD First Response: Stack trace:
[4/25/2020 1:28:20 AM.145] LSPD First Response: at CallSite.Target(Closure , CallSite , Object )
[4/25/2020 1:28:20 AM.145] at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0)
[4/25/2020 1:28:20 AM.145] at CopKillers.CopKillers.Tryout.<Process>b__8_0()
[4/25/2020 1:28:20 AM.145] at Rage.GameFiber.Main()
[4/25/2020 1:28:20 AM.145] LSPD First Response: ==============================
[4/25/2020 1:28:20 AM.145] LSPD First Response: 
[4/25/2020 1:28:20 AM.147] LSPD First Response: [FATAL] Forced termination
[4/25/2020 1:28:20 AM.149] LSPD First Response: [TRACE] Released 0 entities from DefaultContentManager
[4/25/2020 1:28:21 AM.708] LSPD First Response: [INFO] LSPDFR has shut down

The moment I get rid of the loop the code works but without it its kinda useless. I'm thinking missing reference? Do you happen to know if I need one for "GameFiber.StartNew(delegate);" ?

  • Author
8 hours ago, Will said:

Your native call is wrong. It should be


NativeFunction.Natives.TASK_STAY_IN_COVER(Guard1);

or


NativeFunction.Natives.TaskStayInCover(Guard1);

 

 

Thank you so much! Problem solved.

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.