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.

SetPedAsACop (Ped) Questiion

Featured Replies

Hello All,

The code SetPedAsACop (Ped), does just that.

Is there a code to set a ped that is all ready a cop, to not be a cop anymore?

When I spawn a cop model, they are all ready a cop. I'm trying to write something that lets the player interact with a ped (cop model), then recruit them as a partner.

Or should I be looking at spawning a random ped, then changing their uniform?

Any thoughts?

Thanks

  • Management Team

This API call is to make LSPDFR officially recognize them as a cop internally. If you spawn one yourself, there will still be certain game mechanics and LSPDFR mechanics that pick them up as a cop due to their relationship group and ped type. But the partner approach should still work. What have you tried?

Please do not PM me unless really necessary (knowing you helps). If you think you need my attention in a topic, tag me.

  • Author

As a work around, I just used models that don't spawn as cops, but look similar to cops ("mp_s_m_armoured_01", "s_m_m_armoured_01", "s_m_m_armoured_02"

I can have a dialog and interaction, then recruit them through Ultimate backup.

 

I'll play around with the relationship group with the cop model, and see what I can do with it.

 

 

Here's my interaction for now:

(condensed version)

Spoiler

           PartSpawnPoint = new Vector3(-556.81f, -143.11f, 38.28f);
            Part = new Ped(PMod[new Random().Next(PMod.Length)], PartSpawnPoint, 0f);
            Part.IsPersistent = true;
            PartBlip = Part.AttachBlip();
            PartBlip.IsRouteEnabled = true;
            PartBlip.Color = Color.Blue;
            PartBlip.IsFriendly = true;

 

 

  if (Game.LocalPlayer.Character.DistanceTo(Part) <= 5f)
            {
                Part.Face(Game.LocalPlayer.Character.Position);
                PartName = Functions.GetPersonaForPed(Part).FullName;
                Game.DisplaySubtitle("~r~Officer ~w~ " + PartName + "~r~ Reporting for Duty!", 2500);
                GameFiber.Wait(3000);
                Game.DisplaySubtitle("Add Nearest Ped as Partner in UB.", 3000);
                End();
            }

 

 

  • Author

STP would not allow me to speak to them. I wanted to be able to ask them for ID,  search them,and ask a few basic custom questions, then convert to partner.

 

Also, it looks like all the cop models are default male gender (regardless of model selected). I was thinking, i may be able to change gender for the female model spawned, which would solve one issue. I assign custom names by gender. If they all default to male, only male names would be assigned from my list.

I believe there are only about 7 actual cop models.

 

So, my thought on all of this was, if they were not "cops" to start with, I could perform all those actions.

Hope that makes sense.

 

Hello there.

 

Actually I'm about to build quite the same stuff and this is one of the problems I already managed to solve. 🙂 

 

Try the following methods on a cop:

  • Functions.SetPedCantBeArrestedByPlayer
  • Functions.SetPedCanBePulledOver

They should do the trick.

 

  • Management Team
On 4/9/2022 at 3:16 AM, Radsel said:

STP would not allow me to speak to them. I wanted to be able to ask them for ID,  search them,and ask a few basic custom questions, then convert to partner.

 

Also, it looks like all the cop models are default male gender (regardless of model selected). I was thinking, i may be able to change gender for the female model spawned, which would solve one issue. I assign custom names by gender. If they all default to male, only male names would be assigned from my list.

I believe there are only about 7 actual cop models.

 

So, my thought on all of this was, if they were not "cops" to start with, I could perform all those actions.

Hope that makes sense.

 

 

Makes perfect sense, but I presume that plugin relies on the model and/or relationship group to determine it. In that case, perhaps your other model workaround is the best if you need that plugin.

Please do not PM me unless really necessary (knowing you helps). If you think you need my attention in a topic, tag me.

  • Author
5 hours ago, Yosus said:
  • Functions.SetPedCantBeArrestedByPlayer
  • Functions.SetPedCanBePulledOver

I will try that. Thanks

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...

Similar Content

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.