Jump to content

Callout crashing LSPDFR when trying to enable a route.


Sleet

Recommended Posts

So I'm making a callout plugin, whenever there is a route enable already or blips which were not removed my plugin decides to crash LSPDFR, so I'm wondering how can I remove the routes that are already enabled or how I can prevent it from crashing.

 

OnCalloutAccepted();


// It gets to here and then crashes before it can log the Enabled route.

police.GetAttachedBlip().EnableRoute(System.Drawing.Color.Red); 
Game.LogTrivial("Enabled route");

And yes the variable police and the blip does exist.

" police = new Vehicle("police", spawnpoint.Around(10f));"

" CalloutUtils.addBlip(police, System.Drawing.Color.Blue);"

 

RagePluginHook.log:

[01/03/2018 13:01:54.823] LSPD First Response: ==============================
[01/03/2018 13:01:54.823] LSPD First Response: UNHANDLED EXCEPTION DURING GAME FIBER TICK
[01/03/2018 13:01:54.823] LSPD First Response: ------------------------------
[01/03/2018 13:01:54.823] LSPD First Response: Origin: Game fiber "CalloutManager".
[01/03/2018 13:01:54.823] LSPD First Response: ------------------------------
[01/03/2018 13:01:54.824] LSPD First Response: Exception type: System.NullReferenceException
[01/03/2018 13:01:54.824] LSPD First Response: Exception message: Object reference not set to an instance of an object.
[01/03/2018 13:01:54.824] LSPD First Response: ------------------------------
[01/03/2018 13:01:54.824] LSPD First Response: Inner exceptions:
[01/03/2018 13:01:54.825] LSPD First Response: ------------------------------
[01/03/2018 13:01:54.825] LSPD First Response: Stack trace:
[01/03/2018 13:01:54.826] LSPD First Response: at BCallouts.Callouts.PursuitAssistance.OnCalloutAccepted()
[01/03/2018 13:01:54.826] at ?????????????????????????????????????????.?????????????????????????????????????????() in E:\GTA V\LSPD First Response\LSPD First Response\Mod\Callouts\CalloutManager.cs:line 338
[01/03/2018 13:01:54.826] at ?????????????????????????????????????????.?????????????????????????????????????????() in E:\GTA V\LSPD First Response\LSPD First Response\Mod\Callouts\CalloutManager.cs:line 173
[01/03/2018 13:01:54.826] at Rage.GameFiber.Main()
[01/03/2018 13:01:54.826] LSPD First Response: ==============================

 

Link to comment
Share on other sites

Also before using a Blip or Entity, always check if it is non-null and exists. There's a shorthand way to check this in RPH, just type if(blipVariableName) or if(entityVariableName)

[REL] Coastal Callouts: An action-packed mod with new vehicles, maps, capabilities, and callouts in and around the waters of Los Santos

[REL] Police Tape: Make your scenes more realistic while stopping peds and traffic

[REL] Better EMS: Realistic and dynamic EMS response

Join the Parks Benefactor Program to support my work and get early beta access!

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