Jump to content
PNWParksFan

[bug] LSPDFR takes over comp_tasks

Recommended Posts

It appears that the LSPDFR cop manager takes over cop peds' comp_tasks, preventing you from ever spawning your own cop or sheriff ped with a bullet-proof vest. You can set comp_tasks to give them a vest, but as soon as LSPDFR does anything with the cop it'll remove it. Any time you go on/off duty, start or end a pursuit, or start/end engagement with hostile peds. Here is the test I did to confirm this: 

  • Spawned a cop ped (with LSPDFR not loaded at all)
  • Set the ped's comp_tasks to 2 (bullet proof vest)
  • Loaded LSPDFR (did not go on duty)
    • Cop immediately removed vest
  • Turned the vest back on
  • Went on duty
    • Cop's vest immediately went away again
  • Turned vest on again
  • Accepted a callout for pursuit in progress
    • Cop's vest disappeared yet again
  • Turned it back on again
  • Force-ended the pursuit
    • Cop's vest disappeared again

I would really like the ability to set a ped's comp_tasks for myself! Is there any way to disable or override this behavior? I could make my plugin constantly scan for when a ped it's trying to control has its components messed with, and then set it back, but I'd prefer not to have my plugin wasting the user's resources to constantly battle LSPDFR's behavior. 

@LMS any suggestions?

Share this post


Link to post
Share on other sites

This is part of the managed holster of LSPDFR for pistols. Unfortunately the holstered pistol is the same category as the vest, so it conflicts. I guess all I could do is add an API function that disables the holster management for a specific cop.

Share this post


Link to post
Share on other sites
5 minutes ago, LMS said:

This is part of the managed holster of LSPDFR for pistols. Unfortunately the holstered pistol is the same category as the vest, so it conflicts. I guess all I could do is add an API function that disables the holster management for a specific cop.

It would be nice to have that option.

You could also check if comp_tasks is set to 2, in which case don't mess with it. If it's set to 0 or 1, then manage it appropriately. That way if the vest is set explicitly it won't be turned off, but if it isn't then the holster can be managed. 

Share this post


Link to post
Share on other sites
23 minutes ago, PNWParksFan said:

It would be nice to have that option.

You could also check if comp_tasks is set to 2, in which case don't mess with it. If it's set to 0 or 1, then manage it appropriately. That way if the vest is set explicitly it won't be turned off, but if it isn't then the holster can be managed. 

This is how it works for the vest selected by the player in the character selection, but I guess for complete control a flag that can be set via API would be the best option. Especially when the vest is added when LSPDFR has already recognized the ped.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×