Jump to content

When ped is arrested by another cop ped


AdirB

Recommended Posts

Hello,
I have created a callout and every end method I gave it works fine, except the method when another cop arrests the suspects and than comes the transport.

The method is actually working great, the callout ends but I don't get a notification says that the suspects are in custody.

I do get a notification when I make the arrest.

            if (Functions.IsPedArrested(SuspectA) && Functions.IsPedArrested(SuspectB) && !Functions.IsPursuitStillRunning(Pursuit))
            {
                Game.DisplayNotification("Distpach, suspects are in custody. Resuming Patrol.");
                Functions.PlayScannerAudio("10_15_SUSPECT_IN_CUSTODY 10-4_COPY");
                End();
            }

So I assume that IsCuffed is only when the player is making the arrest.
What can I do to end the callout properly when others arrests the suspect?
EDIT: Fixed above by changing SuspectA.IsCuffed to Functions.IsPedArrested(SuspectA)

I also have another problem with callouts.
When in a pursuit after a suspect and when I press X the callout ends but the entities are not being removed, even the blips.
It happens only when I'm in a pursuit with my callouts, I know because I tried to press X when not in a pursuit and it does delete everything.
So it's only happens when in pursuit. Do I need to add somethign additional to make the callout terminate itself when pressing X in a pursuit?

Thanks :)

Edited by AdirB
Link to comment
Share on other sites

6 hours ago, AdirB said:

I also have another problem with callouts.
When in a pursuit after a suspect and when I press X the callout ends but the entities are not being removed, even the blips.
It happens only when I'm in a pursuit with my callouts, I know because I tried to press X when not in a pursuit and it does delete everything.
So it's only happens when in pursuit. Do I need to add somethign additional to make the callout terminate itself when pressing X in a pursuit?

Thanks :)

You'll need to make sure all of your cleanup code is in End, then it'll get called whenever your callout ends for any reason.

My YouTube Channel: Darkmyre Gaming (Australian LSPDFR patrols, plugins in development, and other games)

My Discord Server | AusGamer Network

 

Please do not PM me for technical support or bug reports, use the appropriate forum or plugin's comments instead.

Link to comment
Share on other sites

19 minutes ago, Darkmyre said:

You'll need to make sure all of your cleanup code is in End, then it'll get called whenever your callout ends for any reason.

It does in End().

        public override void End()
        {
            Game.LogTrivial("callout is ended and entities removed.");
            base.End();
            if (MaleBanker.Exists()) { MaleBanker.Dismiss(); } if (FemaleBanker.Exists()) { FemaleBanker.Dismiss(); }
            if (SuspectA.Exists()) { SuspectA.Dismiss(); } if (SuspectBlipA.Exists()) { SuspectBlipA.Delete(); }
            if (SuspectB.Exists()) { SuspectB.Dismiss(); } if (SuspectBlipB.Exists()) { SuspectBlipB.Delete(); }
            if (SceneIndicator.Exists()) { SceneIndicator.Delete(); }
            Game.LogTrivial("callout entities are removed.");
        }

 

Edited by AdirB
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...