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.

how to control combat events

Featured Replies

im working on a plugin that uses nearby cops (not spawned manually) to respond when an NPC starts shooting at the player.

Problem is: the cops enter combat for a few seconds, then stop on their own even though the attacker is still alive. I’ve already tried:

- SET_ENTITY_AS_MISSION_ENTITY so I can control them freely
- REMOVE_PED_FROM_GROUP
- Gave them weapons and used Tasks.FightAgainst(attacker)
- Set relationship between COP and Attacker to HATE
- Blocked permanent events, cleared tasks, all that stuff

But still, they only shoot for a bit then just stand there like nothing happened.

From what I read, LSPDFR overrides cop AI and only lets them return fire *if they’re being shot at*. But what I’m trying to figure out is:

1. Is there any way to keep cops in combat until the attacker is dead?  
2. Can I override or disable LSPDFR's logic so the AI doesn’t get reset?  
3. Do I really have to start a pursuit and add cops for them to actually stay aggressive?  
4. Or is there some flag or trick to make them “allowed to fight” without LSPDFR interfering?

What I’m going for is: if a shooting happens near the player, cops nearby should react and help naturally, like a patrol would, without needing to spawn units or start a pursuit.

Edited by Tanjigoor

Have you tried playing with these functions?

 

Functions.SetCopAsBusy(...)

Functions.SetCopIgnoreAmbientCombatControl(...)

 

Setting the Cop as busy from my experience basically turns him into a random ped and disables any special logic tied to him. He wont join chase, wont arrest someone on their own etc.

 

I didn't use CombatControl but from the sounds of it, it does exactly what you want him to do. Ignore any presets by LSPDFR and do whatever you tell him to.

Edited by RicyVasco

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.