Jump to content

Callout Process Not Working


OfficerBL09

Recommended Posts

hey guys, so I'm developing a new callout for my callouts pack and everything works other than the process. here is the code: 

Spoiler
Spoiler

        public override void Process()
        {
            base.Process();

            if (Game.LocalPlayer.Character.DistanceTo(DeputyVehicle) < 15)
            {
                Deputy.Tasks.LeaveVehicle(LeaveVehicleFlags.LeaveDoorOpen);
                Rage.Native.NativeFunction.Natives.TASK_TURN_PED_TO_FACE_ENTITY(Deputy, Game.LocalPlayer.Character, -1);
            }

            if (Game.LocalPlayer.Character.DistanceTo(Deputy) <= 5)
            {
                Game.DisplayHelp("Press ~y~Y~w~ To Speak To ~b~Deputy~w~", false);

                if (Game.IsKeyDown(System.Windows.Forms.Keys.Y))
                {
                    counter++;

                    if (counter == 1)
                    {
                        Game.DisplaySubtitle("~b~Deputy~w~: Hey, thanks for coming. I pulled the this guy over for improper lane switching, and he seems to be intoxicated. I called you down here to perform a DUI.");
                    }
                    if (counter == 2)
                    {
                        Game.DisplaySubtitle("~y~You~w~: Okay, has he been complying with you?");
                    }
                    if (counter == 3)
                    {
                        Game.DisplaySubtitle("~b~Deputy~w~: So far, yes. But when I asked him if he has had any drinks today, he started going on a rampage.");
                    }
                    if (counter == 4)
                    {
                        Game.DisplaySubtitle("~y~You~w~: Okay, just standby near me whilst I perform the tests.");
                    }
                }
            }

            if (Game.LocalPlayer.Character.DistanceTo(SuspectVehicle) <= 5)
            {
                Game.DisplayHelp("Press ~y~Y~w~ To Speak To ~r~Suspect~w~", false);

                if (Game.IsKeyDown(System.Windows.Forms.Keys.Y))
                {
                    counter++;

                    if (counter == 1)
                    {
                        Game.DisplaySubtitle("~y~You~w~: Hey sir, what seems to be the problem?");
                    }
                    if (counter == 2)
                    {
                        Game.DisplaySubtitle("~r~Suspect~w~: H- *Hic* Hey officer, just chilling..");
                    }
                    if (counter == 3)
                    {
                        Game.DisplaySubtitle("~y~You~w~: The officer you talked to just now told me you went on a rampage when being asked if you had any drinks tonight, can you answer his question for me?");
                    }
                    if (counter == 4)
                    {
                        Game.DisplaySubtitle("~r~Suspect~w~: Oh n-no officer.. *Hic* I'm sober for a couple months now!");
                    }
                    if (counter == 5)
                    {
                        Game.DisplaySubtitle("~y~You~w~: Okay sir, I'm gonna have you step out of the vehicle and we're gonna perform some simple tests. Is that alright with you?");
                    }
                    if (counter == 6)
                    {
                        Game.DisplaySubtitle("~r~Suspect~w~: S- *Hic* Sure..");
                        Deputy.Tasks.LeaveVehicle(LeaveVehicleFlags.LeaveDoorOpen);
                    }
                }
            }

            if (Suspect.IsStopped || Functions.HasPedBeenFrisked(Suspect) || Functions.IsPedBeingFrisked(Suspect) || Functions.IsPedBeingCuffed(Suspect) || Functions.IsPedBeingGrabbed(Suspect))
            {
                Functions.SetPedResistanceChance(Suspect, 85);
                {
                    if (Suspect.IsFleeing || Suspect.IsGettingIntoVehicle);
                    {
                        Functions.CreatePursuit();
                        Functions.AddPedToPursuit(Pursuit, Suspect);
                        Functions.SetPursuitIsActiveForPlayer(Pursuit, true);
                    }

                }
                
            }

        }

Thoughts? Fixes?

 

I make vehicle textures, and make various LSPDFR videos and tutorials on my youtube!

Link to comment
Share on other sites

  • Management Team

What exactly is not working as expected?

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

Link to comment
Share on other sites

4 hours ago, LMS said:

What exactly is not working as expected?

The code itself doesn't work, the AI's just sit in their vehicles. For example, at the top it says that the officer should get out of his vehicle when you're within a certain range of it. That doesn't work, as well as the rest of the code.

I make vehicle textures, and make various LSPDFR videos and tutorials on my youtube!

Link to comment
Share on other sites

27 minutes ago, Rich said:

Didn't you say in your other topic that all the code was working?  What changed?

Yes, in that callout everything is working. The section of code from the callout I am currently working on and uploaded above doesn't work, but everything else in the callout works. (Vehicles spawn properly, peds spawn properly, can accept callout)

I make vehicle textures, and make various LSPDFR videos and tutorials on my youtube!

Link to comment
Share on other sites

2 minutes ago, Rich said:

I would check to make sure Process is even running by putting in a log message outside all the condition statements.

Okay, then what after that? Re-arrange the code?

I make vehicle textures, and make various LSPDFR videos and tutorials on my youtube!

Link to comment
Share on other sites

4 minutes ago, Rich said:

Well it depends on if Process is actually being called.  If it's not, then the code inside doesn't matter right now.  If it is, then your conditions aren't firing.

Okay, thanks. I'll look into it

I make vehicle textures, and make various LSPDFR videos and tutorials on my youtube!

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