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.

[Solved] Callout troubles

Featured Replies

Hello world!

 

I'm currently working on quite a large callout pack, and figured I would extend the reach of realism by adding smaller less exciting events. Anyways, I've been working on this one for the last few hours because I truly do not understand where I am going wrong. This callout is simply a fight, with random 2-4 people. However, when accepting the callout it ends immediately.

 

My error message

[4/14/2020 11:07:07 PM.423] LSPD First Response: Creating FightInProgressSimple from _970Callouts.Callouts.FightInProgressSimple, 970Callouts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
[4/14/2020 11:07:07 PM.425] LSPD First Response: [TRACE] Callout created:  #1
[4/14/2020 11:07:07 PM.427] LSPD First Response: 970Callouts-FightInProgressSimple is starting
[4/14/2020 11:07:07 PM.430] LSPD First Response: 970Callouts-FightInProgressSimple has created peds and tested them, creating map info and notification
[4/14/2020 11:07:09 PM.985] LSPD First Response: Fighters exists and blip created, route enabled.
[4/14/2020 11:07:09 PM.986] LSPD First Response: [TRACE] Cleaning UI
[4/14/2020 11:07:09 PM.988] LSPD First Response: [TRACE] User accepted callout
[4/14/2020 11:07:10 PM.011] LSPD First Response: Relations are made and hateful!
[4/14/2020 11:07:10 PM.021] LSPD First Response: Error while processing callout: FightInProgressSimple: Object reference not set to an instance of an object.   at _970Callouts.Callouts.FightInProgressSimple.Process()
[4/14/2020 11:07:10 PM.021] at }qtN\]S"~D86<\*myV\\n$aS>(D#./}lr8sR\8K&Zf!wztK{:+U<1"() in E:\GTA V\LSPD First Response\LSPD First Response\Mod\Callouts\CalloutManager.cs:line 184
[4/14/2020 11:07:10 PM.022] LSPD First Response: EndCurrentCallout: Finishing...
[4/14/2020 11:07:10 PM.022] LSPD First Response: FightInProgressSimple is starting cleanup!
[4/14/2020 11:07:10 PM.023] LSPD First Response: FightInProgressSimple is cleaned up!
[4/14/2020 11:07:10 PM.023] LSPD First Response: [TRACE] Cleaning UI
[4/14/2020 11:07:10 PM.025] LSPD First Response: [TRACE] Released 0 entities from  #1 Content Manager
[4/14/2020 11:07:10 PM.025] LSPD First Response: [TRACE] Instance cleaned ( #1)

My code pertaining to Process()

        public override void Process()  //ON CALLOUT ACCEPTED AND WORKING//
        {

            base.Process();

            new RelationshipGroup("Group1");
            new RelationshipGroup("Group2");  //fighting groups are made

            Fighter1.RelationshipGroup = "Group1";
            Fighter2.RelationshipGroup = "Group2";
            if (Fighter3.Exists()) Fighter3.RelationshipGroup = "Group1"; // groups are assigned
            if (Fighter4.Exists()) Fighter4.RelationshipGroup = "Group2";

            Game.SetRelationshipBetweenRelationshipGroups("Group1", "Group2", Relationship.Hate);
            Game.SetRelationshipBetweenRelationshipGroups("Group2", "Group1", Relationship.Hate);  //hate relationships made

            Game.LogTrivial("Relations are made and hateful!");
            
            
            if (Game.LocalPlayer.Character.Position.DistanceTo(SpawnPoint) <= 75f && !IsPursuit) //player gets close, pursuit starts, peds are added.
            {

                Fighter1.Tasks.FightAgainstClosestHatedTarget(50F);
                Fighter2.Tasks.FightAgainstClosestHatedTarget(50F);
                if (Fighter3.Exists()) Fighter3.Tasks.FightAgainstClosestHatedTarget(50F); //fighters begin fighting enemy, hopefully
                if (Fighter4.Exists()) Fighter4.Tasks.FightAgainstClosestHatedTarget(50F);


                pursuit = Functions.CreatePursuit();

                Functions.AddPedToPursuit(pursuit, Fighter1);
                Functions.AddPedToPursuit(pursuit, Fighter2);
                if (Ro == 3)
                {
                    Functions.AddPedToPursuit(pursuit, Fighter3); // adding fighters, if applicable, to the pursuit
                }
                if (Ro == 4)
                {
                    Functions.AddPedToPursuit(pursuit, Fighter3);
                    Functions.AddPedToPursuit(pursuit, Fighter4);
                }
                Functions.SetPursuitIsActiveForPlayer(pursuit, true);

                IsPursuit = true;

                Game.LogTrivial("Pursuit has started with any existing fighters");
            }

 

-Shawn

Hey!

 

I see that you only check if fighters 3 or 4 exists, but fighters 1 and 2 might not be available right away when process starts or they got despawned. So every logic with any entities in game should use the Exists() function.

 

Also if you add your pdb file together with your dll file you'll get more detailed error messages, you will also see on what line the exception was thrown and a little stack trace.

Thank you

  • Author

@epicmrjuan Thank you for the response so fast!
 

Thank you for the advice! I added the .Exists() and the .pdb file.

It ended up being my end loop within the process(), not even included in the code I attached lol, so I simply got rid of it and problem is fixed!

-Shawn

  • The title was changed to [Solved] Callout troubles

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

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.