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.

New programer, does anyone know what's causing a crash here?

Featured Replies

I've been trying to get custom locations working for my callout pack, I think I've done everything correctly and I don't see error messages in Visual studio, but it's clear that the problem is here somewhere:

 

Spoiler

YouToolBackRoad = new Vector3(2653.1551300970923f, 3512.095996984054f, 0f);
            YouToolSideRoad = new Vector3(2714.225604481665f, 3436.5440488848185f, 0f);
            YouToolLot = new Vector3(2761.278126811762f, 3457.787128559615f, 0f);

            HumaneLabArea = new Vector3(3503.4937209865193f, 3664.1484739719267f, 0f);
            HumaneLabLot = new Vector3(3591.52747244283f, 3762.7770581763402f, 0f);
            HumaneLabEntry = new Vector3(3410.906499627296f, 3744.5687041693714f, 0f);

            SandyAirfield = new Vector3(1783.7999209865193f, 3277.220951323843f, 0f);
            GrapeseedAirfield = new Vector3(2134.417103510791f, 4799.135873739639f, 0f);
            LSInternational = new Vector3(-1051.4940052270729f, -3009.21326958208f, 0f);

            PaletoGas = new Vector3(158.2111656467173f, 6582.03720358865f, 0f);
            SandyGas = new Vector3(1986.3088988094776f, 3764.405672726937f, 0f);
            HarmonyGas = new Vector3(1227.2316229385965f, 2662.768560625255f, 0f);
            GrapeseedGas = new Vector3(1694.4541875745713f, 4784.217116746875f, 0f);


            if (Game.LocalPlayer.Character.DistanceTo(YouToolBackRoad) < Game.LocalPlayer.Character.DistanceTo(YouToolLot) && Game.LocalPlayer.Character.DistanceTo(YouToolBackRoad) < Game.LocalPlayer.Character.DistanceTo(YouToolSideRoad) && Game.LocalPlayer.Character.DistanceTo(YouToolBackRoad) < Game.LocalPlayer.Character.DistanceTo(HumaneLabArea) && Game.LocalPlayer.Character.DistanceTo(YouToolBackRoad) < Game.LocalPlayer.Character.DistanceTo(HumaneLabEntry) && Game.LocalPlayer.Character.DistanceTo(YouToolBackRoad) < Game.LocalPlayer.Character.DistanceTo(HumaneLabLot) && Game.LocalPlayer.Character.DistanceTo(YouToolBackRoad) < Game.LocalPlayer.Character.DistanceTo(GrapeseedAirfield) && Game.LocalPlayer.Character.DistanceTo(YouToolBackRoad) < Game.LocalPlayer.Character.DistanceTo(GrapeseedGas) && Game.LocalPlayer.Character.DistanceTo(YouToolBackRoad) < Game.LocalPlayer.Character.DistanceTo(SandyAirfield) && Game.LocalPlayer.Character.DistanceTo(YouToolBackRoad) < Game.LocalPlayer.Character.DistanceTo(SandyGas) && Game.LocalPlayer.Character.DistanceTo(YouToolBackRoad) < Game.LocalPlayer.Character.DistanceTo(HarmonyGas) && Game.LocalPlayer.Character.DistanceTo(YouToolBackRoad) < Game.LocalPlayer.Character.DistanceTo(LSInternational) && Game.LocalPlayer.Character.DistanceTo(YouToolBackRoad) < Game.LocalPlayer.Character.DistanceTo(PaletoGas))
            {
                CalloutLocation = YouToolBackRoad;
            }
            else
            {
                CalloutLocation = YouToolLot;
            }

 

I've only put in the if statement for part of it today but I've got it set up to test for now.

 

Any and all help is appreciated thanks! 🙂

Everyone wants happiness, no one wants pain. But you can't have a rainbow, without a little rain.

What kind of problem do you have with this code? The style can definitely be better but there's no obvious bug. You could use an array/dictionary to store vectors and LINQ to check the condition so your code would look like this:

 

CalloutLocation = locations.All(l => DistanceToPlayer(l) > distToBackRoad) ? YouToolBackRoad : YouToolLot;

  • Author
6 hours ago, LtFlash said:

What kind of problem do you have with this code? The style can definitely be better but there's no obvious bug. You could use an array/dictionary to store vectors and LINQ to check the condition so your code would look like this:

 

CalloutLocation = locations.All(l => DistanceToPlayer(l) > distToBackRoad) ? YouToolBackRoad : YouToolLot;

That's part of the problem, I'm not sure what the problem with the code is. I'm getting no errors, it just crashes when running through the code. This might be easier to see (The if statement continues as it did above):

Capture.PNG

Everyone wants happiness, no one wants pain. But you can't have a rainbow, without a little rain.

Whenever you ask for help with code crashing, you should specify what happens when it crashes. Saying "it crashed" could be anything. Post an excerpt from your log showing the particular exception. 

[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!

  • Author
7 hours ago, PNWParksFan said:

Whenever you ask for help with code crashing, you should specify what happens when it crashes. Saying "it crashed" could be anything. Post an excerpt from your log showing the particular exception. 

Thanks for the advice 🙂

 

Here is the log

https://pastebin.com/iDwSGDxh

 

I'm not sure what to make of it since it ends so abruptly...

Everyone wants happiness, no one wants pain. But you can't have a rainbow, without a little rain.

  • 2 weeks later...

Are all the other mods dependencies? I would be testing without them, unless they are. That way you can be sure that it's not conflicting with another mod.

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.