Jump to content

Ped Stuck in Arrest Animation


SimuNews

Recommended Posts

Hi there,

In my Callout Plugin I have a Ped who is fight against me.

But when I will arrest them it stucks in a unusual way like this: http://sendvid.com/kmpv1jdu

 

Can anyone help me pls?

 

My Code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Rage;
using LSPD_First_Response.Mod.API;
using LSPD_First_Response.Mod.Callouts;
using LSPD_First_Response.Engine.Scripting.Entities;
using System.Drawing;
using System.Threading;

namespace HotCallouts.Callouts
{
    [CalloutInfo("PersonWithAKnife", CalloutProbability.Medium)]
    class PersonWithAKnife : Callout
    {

        private Ped Suspect;
        private Vector3 SpawnPoint;
        private Blip SuspectBlip;

        public override bool OnBeforeCalloutDisplayed()
        {

            SpawnPoint = new Vector3(-(609f), -(388f), 34f);

            ShowCalloutAreaBlipBeforeAccepting(SpawnPoint, 40f);
            AddMinimumDistanceCheck(10f, SpawnPoint);

            CalloutMessage = "Person with a Knife";
            CalloutPosition = SpawnPoint;

            Functions.PlayScannerAudioUsingPosition("CITIZENS_REPORT CRIME_PERSONCARRYINGKNIFE IN_OR_ON_POSITION UNITS_RESPOND_CODE_02", SpawnPoint);

            return base.OnBeforeCalloutDisplayed();
        }

        public override bool OnCalloutAccepted()
        {

            Suspect = new Ped(SpawnPoint);
            Suspect.IsPersistent = true;
            Suspect.Inventory.GiveNewWeapon("WEAPON_KNIFE", 1, true);
            Suspect.RandomizeVariation();
            Suspect.CanAttackFriendlies = true;
            Suspect.BlockPermanentEvents = true;
            Suspect.RelationshipGroup = "RED";

            Game.LocalPlayer.Character.RelationshipGroup = "BLUE";

            Game.SetRelationshipBetweenRelationshipGroups("RED", "BLUE", Relationship.Hate);
            Game.SetRelationshipBetweenRelationshipGroups("BLUE", "RED", Relationship.Hate);

            SuspectBlip = Suspect.AttachBlip();
            SuspectBlip.Color = Color.Yellow;
            SuspectBlip.EnableRoute(Color.Yellow);

            return base.OnCalloutAccepted();
        }

        public override void Process()
        {
            base.Process();
            
            switch (Game.LocalPlayer.Character.Position.DistanceTo(Suspect.Position) < 30)
            {
                case true:
                Game.DisplayNotification("True");
                Suspect.Tasks.FightAgainstClosestHatedTarget(50);
                break;

                case false:
                Game.DisplayNotification("False");
                Suspect.Tasks.Wander().WaitForCompletion();
                break;
            }

            if (Suspect.IsDead || Suspect.IsCuffed)
            {
                Functions.PlayScannerAudio("WE_ARE_CODE FOUR NO_FURTHER_UNITS_REQUIRED");
                End();
            }
        }

        public override void End()
        {
            base.End();
            if (Suspect.Exists()) { Suspect.Dismiss(); }
            if (SuspectBlip.Exists()) { SuspectBlip.Delete(); }
        }

    }
}

 

Willkommen

 

Website: SimuNews

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