Jump to content

plugin crashing


khorio

Recommended Posts

The plugin i'm trying to make keeps crashing over weird stuff and i can't seem to figure out why.

 

        public override bool OnCalloutAccepted()
        {


            AreaBlip = new Blip(SpawnPoint,20f);            
            AreaBlip.Color = Color.Yellow;
            AreaBlip.Alpha = 100;
            AreaBlip.EnableRoute(Color.Yellow);

            Rage.Native.NativeFunction.CallByName<uint>("TASK_REACT_AND_FLEE_PED", Victim, Suspect);
            Suspect.Tasks.EnterVehicle(Bike, -1).WaitForCompletion();
            Suspect.Tasks.ChaseWithGroundVehicle(Victim).WaitForCompletion(2000);


            check = 0;

            Game.LogTrivial("k: 1/10 Create Pursuit");
            Pursuit = Functions.CreatePursuit();
            Game.LogTrivial("k: 2/10 Entering Runthings()");
            runthings();


            return base.OnCalloutAccepted();
        }

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



 
        public void runthings()
        {

            Game.LogTrivial("k: 3/10 Deleting AreaBlip");
            if (AreaBlip.Exists()) { AreaBlip.Delete(); }
            Game.LogTrivial("k: 4/10 Attaching Blips");
            SuspectBlip = Suspect.AttachBlip();
            VictimBlip = Victim.AttachBlip();
            VictimBlip.Color = Color.Yellow;
            Random randNum = new Random();
            Game.LogTrivial("k: 5/10 Display victimcall");
            Game.DisplaySubtitle("~y~Victim: ~w~" + help[randNum.Next(help.Count)], 5000);
            GameFiber.Sleep(5000);
            Game.LogTrivial("k: 6/10 Display suspectcall");
            randNum = new Random();
            Game.DisplaySubtitle("~r~Suspect: ~w~" + harrassmentlines[randNum.Next(harrassmentlines.Count)], 5000);
            GameFiber.Sleep(5000);
            Game.LogTrivial("k: 7/10 fleeing suspect");
            GameFiber.Sleep(5000);
            Rage.Native.NativeFunction.CallByName<uint>("TASK_REACT_AND_FLEE_PED", Suspect, Rage.Game.LocalPlayer.Character);
            GameFiber.Sleep(5000);
            Game.LogTrivial("k: 8/10 adding suspect to pursuit");
            Functions.AddPedToPursuit(Pursuit, Suspect);

        }



        public override void Process()
        {

            Game.LogTrivial("k: 9/10 entering process()");
            base.Process();
            if (!Functions.IsPursuitStillRunning(Pursuit))
            {
                End();
            }
        }


        public override void End()
        {
            Game.LogTrivial("k: ending call");
            if (Suspect.Exists()) Suspect.Dismiss();
            Game.LogTrivial("k: susblipdel");
            if (SuspectBlip.Exists()) SuspectBlip.Delete();            
            if (Victim.Exists()) Victim.Dismiss();
            Game.LogTrivial("k: vicblipdel");
            if (VictimBlip.Exists()) VictimBlip.Delete();
            base.End();
        }
    }
[18/05/2016 21:09:31.479] LSPD First Response: k: 1/10 Create Pursuit
[18/05/2016 21:09:31.482] [TRACE] Created new chase
[18/05/2016 21:09:31.482] LSPD First Response: k: 2/10 Entering Runthings()
[18/05/2016 21:09:31.485] LSPD First Response: k: 3/10 Deleting AreaBlip
[18/05/2016 21:09:31.485] LSPD First Response: k: 4/10 Attaching Blips
[18/05/2016 21:09:31.486] LSPD First Response: k: 5/10 Display victimcall
[18/05/2016 21:09:36.132] [TRACE] Asked thread ZoomThread #2 to abort: Timeout exceeded
[18/05/2016 21:09:36.132] [TRACE] Instance cleaned (ZoomThread #2)
[18/05/2016 21:09:36.134] [TRACE] Thread ZoomThread #2 has been shut down
[18/05/2016 21:09:36.491] LSPD First Response: k: 6/10 Display suspectcall
[18/05/2016 21:09:41.507] LSPD First Response: k: 7/10 fleeing suspect
[18/05/2016 21:09:51.526] LSPD First Response: k: 8/10 adding suspect to pursuit
[18/05/2016 21:09:51.528] [TRACE] Suspect added to chase
[18/05/2016 21:09:51.650] LSPD First Response: 
[18/05/2016 21:09:51.651] LSPD First Response: ==============================
[18/05/2016 21:09:51.651] LSPD First Response: UNHANDLED EXCEPTION DURING GAME FIBER TICK
[18/05/2016 21:09:51.651] LSPD First Response: ------------------------------
[18/05/2016 21:09:51.652] LSPD First Response: Origin: Game fiber "CalloutManager".
[18/05/2016 21:09:51.652] LSPD First Response: ------------------------------
[18/05/2016 21:09:51.654] LSPD First Response: Exception type: Rage.Exceptions.InvalidHandleableException
[18/05/2016 21:09:51.654] LSPD First Response: Exception message: Operation is not valid because the specified  Rage.Blip is invalid.
[18/05/2016 21:09:51.654] LSPD First Response: ------------------------------
[18/05/2016 21:09:51.654] LSPD First Response: Inner exceptions:
[18/05/2016 21:09:51.654] LSPD First Response: ------------------------------
[18/05/2016 21:09:51.654] LSPD First Response: Stack trace:
[18/05/2016 21:09:51.655] LSPD First Response: at Rage.Blip.Delete()
[18/05/2016 21:09:51.655] at LSPD_First_Response.Mod.Callouts.Callout.OnCalloutAccepted() in E:\GTA V\LSPD First Response\LSPD First Response\Mod\Callouts\Callout.cs:line 154
[18/05/2016 21:09:51.655] at LSPDFR_Khallouts.Callouts.Sexual_Harrassment.OnCalloutAccepted()
[18/05/2016 21:09:51.655] at ?????????????????????????????????????????.?????????????????????????????????????????() in E:\GTA V\LSPD First Response\LSPD First Response\Mod\Callouts\CalloutManager.cs:line 338
[18/05/2016 21:09:51.656] at ?????????????????????????????????????????.?????????????????????????????????????????() in E:\GTA V\LSPD First Response\LSPD First Response\Mod\Callouts\CalloutManager.cs:line 173
[18/05/2016 21:09:51.656] at Rage.GameFiber.Main()
[18/05/2016 21:09:51.657] LSPD First Response: ==============================

 

I even tried to stop the removal of the blips by commenting it out, it still crashes on the same thing.

Link to comment
Share on other sites

pervs chasing girls, but that's beyond the point :p

 

Fixed my problem, had a loop error.

But now this is what happens after my callout finishes :

 

[19/05/2016 04:19:43.914] [TRACE] Arrested or dead
[19/05/2016 04:19:43.940] [TRACE] No more suspects useable, aborting chase
[19/05/2016 04:19:43.944] [TRACE] Removing ped from ChaseController #1 (GameplayMandatory)
[19/05/2016 04:19:43.948] [TRACE] Removing ped from ChaseController #1 (GameplayMandatory)
[19/05/2016 04:19:43.948] [TRACE] Instance cleaned (ChaseController #1)
[19/05/2016 04:19:43.948] [TRACE] Aborted chase
[19/05/2016 04:19:43.951] [TRACE] Instance cleaned ( #1)
[19/05/2016 04:19:55.837] [TRACE] Ending already
[19/05/2016 04:19:55.842]    at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)
[19/05/2016 04:19:55.842]    at System.Environment.get_StackTrace()
[19/05/2016 04:19:55.842]    at LSPD_First_Response.Engine.BaseComponent.End() in E:\GTA V\LSPD First Response\LSPD First Response\Engine\BaseComponent.cs:line 34
[19/05/2016 04:19:55.842]    at LSPD_First_Response.Mod.Callouts.Callout.End() in E:\GTA V\LSPD First Response\LSPD First Response\Mod\Callouts\Callout.cs:line 194
[19/05/2016 04:19:55.842]    at LSPDFR_Khallouts.Callouts.Sexual_Harrassment.End()
[19/05/2016 04:19:55.842]    at LSPDFR_Khallouts.Callouts.Sexual_Harrassment.Process()
[19/05/2016 04:19:55.842]    at ?????????????????????????????????????????.?????????????????????????????????????????() in E:\GTA V\LSPD First Response\LSPD First Response\Mod\Callouts\CalloutManager.cs:line 197
[19/05/2016 04:19:55.842]    at Rage.GameFiber.Main()
[19/05/2016 04:19:55.842]    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
[19/05/2016 04:19:55.842]    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
[19/05/2016 04:19:55.842]    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
[19/05/2016 04:19:55.842]    at System.Threading.ThreadHelper.ThreadStart()
[19/05/2016 04:19:55.842] [TRACE] Ending already
[19/05/2016 04:19:55.842]    at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)
[19/05/2016 04:19:55.842]    at System.Environment.get_StackTrace()
[19/05/2016 04:19:55.842]    at LSPD_First_Response.Engine.BaseComponent.End() in E:\GTA V\LSPD First Response\LSPD First Response\Engine\BaseComponent.cs:line 34
[19/05/2016 04:19:55.842]    at LSPD_First_Response.Mod.Callouts.Callout.End() in E:\GTA V\LSPD First Response\LSPD First Response\Mod\Callouts\Callout.cs:line 194
[19/05/2016 04:19:55.842]    at LSPDFR_Khallouts.Callouts.Sexual_Harrassment.End()
[19/05/2016 04:19:55.842]    at LSPDFR_Khallouts.Callouts.Sexual_Harrassment.Process()
[19/05/2016 04:19:55.842]    at ?????????????????????????????????????????.?????????????????????????????????????????() in E:\GTA V\LSPD First Response\LSPD First Response\Mod\Callouts\CalloutManager.cs:line 197
[19/05/2016 04:19:55.842]    at Rage.GameFiber.Main()
[19/05/2016 04:19:55.842]    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
[19/05/2016 04:19:55.842]    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
[19/05/2016 04:19:55.843]    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
[19/05/2016 04:19:55.843]    at System.Threading.ThreadHelper.ThreadStart()

anyone?

Link to comment
Share on other sites

The crash log doesn't say much because you may not have had the pdb file loaded. 

When you build your project you get a .DLL and a .pdb -- the pdb allows the game to know where your code actually crashed so copy it to the lspdfr plugin dir with your plugin.

If you look at your first crash log it tells you the issue was dealing with rage blips that were destroyed. The log file above has a bunch of ?????? Marks 

Link to comment
Share on other sites

AreaBlip = new Blip(SpawnPoint,20f);            
            AreaBlip.Color = Color.Yellow;
            AreaBlip.Alpha = 100;
            AreaBlip.EnableRoute(Color.Yellow);

Try putting this in a different place than your OnCalloutAccepted() override.

My YouTube: Click here. 

My Discord Server - https://discord.gg/0taiZvBSiw5qGAXU

Useful post? Let me and others know by clicking the Like button.
Check out my many script modifications! 
Having issues? LSPDFR Troubleshooter by Albo1125.

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