Jump to content

How can I configure proper police behavior for peds?


Recommended Posts

Hey all, I'm creating a small mod for myself using Rage Plugin Hook that spawns some extra police guards in a few places. I'm using NOOSE and FIB peds that extend the following base class:

Spoiler

    abstract class LawEnforcementOfficer : Ped {
        public LawEnforcementOfficer(Model model, Vector3 position, float heading) : base(model, position, heading) {
            RandomizeVariation();

            RelationshipGroup = RelationshipGroup.Cop;
            BlockPermanentEvents = false;
            IsPersistent = false;
        }
    }

And I instruct them to guard the spot they spawned at with a native call (else they wander away):

Spoiler

NativeFunction.CallByName<uint>("TASK_STAND_GUARD", this, position.X, position.Y, position.Z, heading, "WORLD_HUMAN_GUARD_STAND");

This is working almost perfectly - when I have a wanted level/attack them/discharge a weapon/steal a car in the vicinity, they immediately engage me. However, if an NPC attacks me, they do not attack it, unlike regular police officers. They also don't care about me climbing on parked police vehicles, whereas that would immediately result in a wanted level if they were regular policemen.

 

Basically, all I'm trying to accomplish is that the peds should behave like the LSPD officers you can find hanging around the LSPD police stations or in the metro - guarding a specific spot without wandering away but engaging the player as well as criminal NPCs. Is it possible to accomplish this, and if yes, how?

Edited by The Auditor
Link to comment
Share on other sites

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

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...