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.

Secondary Callouts Help!

Featured Replies

  • Replies 24
  • Views 2.2k
  • Created
  • Last Reply

Top Posters In This Topic

Most Popular Posts

  • The computer only does what it's told to do. 

  • This native GET_SAFE_COORD_FOR_PED

  • What I'm doing for ambient events, is starting a new GameFiber as part of my "OnDuty" function. This fiber then does the random check for an ambient event, calling the relevant code if one gets trigge

Posted Images

Let's try solving the first problem first (haha?). Make sure that your End method is even being called in the first place, by ensuring that your vehicles / peds are being deleted on call out completion. If not, then your end method is not being called / executed.

Try getting the call out to end by:

Killing the suspect / arresting the suspect / force ending the call out by pressing X.

I'm thinking that your if statement isn't even being called because your state  does not equal your enum. 

If you'd like to post more of your code, please do :)

The problem with your EMS callout is in OnBeforeCalloutDisplayed(). You put " if (Ambulance.Exists()) return false; " so everytime the ambulance exists your callout will be aborted, it should be " if (!Ambulance.Exists()) return false; ", note the "!" symbol

  • Author
8 hours ago, tanu1215 said:

Let's try solving the first problem first (haha?). Make sure that your End method is even being called in the first place, by ensuring that your vehicles / peds are being deleted on call out completion. If not, then your end method is not being called / executed.

Try getting the call out to end by:

Killing the suspect / arresting the suspect / force ending the call out by pressing X.

I'm thinking that your if statement isn't even being called because your state  does not equal your enum. 

If you'd like to post more of your code, please do :)

Thanks! I just figured it out!  It was a stupid mistake!

36 minutes ago, alexguirre said:

The problem with your EMS callout is in OnBeforeCalloutDisplayed(). You put " if (Ambulance.Exists()) return false; " so everytime the ambulance exists your callout will be aborted, it should be " if (!Ambulance.Exists()) return false; ", note the "!" symbol

Oh my goodness, I can't believe the mistake was that simple! I didn't even notice that!! Thank you so much!

 

 

The computer only does what it's told to do. :turned:

Stealth22
LSPDFR Tester | Plugin Developer
My Plugins: Code 3 Callouts | Traffic Control | Keep Calm | ALPR+

Please do not PM me for any kind of technical support.
I unfortunately do not have enough free time to answer every PM that I get. For issues with my plugins, please post in the comments section of the file, or it's forum thread. You'll get a much quicker response from me there than if you send me a PM; I do my best to respond to every question in the comments sections. For API/programming questions, please post them in the API Development forum, so all developers can benefit from the answer as well. Thanks!

3 hours ago, Stealth22 said:

The computer only does what it's told to do. :turned:

At least we don't get a certain robot war problem cough cough

8 hours ago, fiskey111 said:

Thanks! I just figured it out!  It was a stupid mistake!

Oh my goodness, I can't believe the mistake was that simple! I didn't even notice that!! Thank you so much!

What was the mistake ?

  • Author
2 hours ago, tanu1215 said:

At least we don't get a certain robot war problem cough cough

What was the mistake ?

If you look here:

  //A simple check, if our pursuit has ended we end the callout
                if (state == EShootingState.DecisionMade && !Functions.IsPursuitStillRunning(pursuit))
                {
                    this.End();
                }
            }

The bolded bracket was from the original "if" statement from the callout logic, which I accidentally carried below to that if statement.

 

Thanks for all your help!  I have two more questions:

What's the best way to spawn perps?

I'm currently using

                            perp3 = new Ped(Cop1.GetOffsetPosition(new Vector3(0, 10f, 0)));
                            perp4 = new Ped(Cop1.GetOffsetPosition(new Vector3(0, 12f, 0)));

to spawn them, but I've noticed the spawning is a bit annoying (twice I've had them spawn in buildings, and once on the roof).  Is there any other way to spawn them?

Last question:

How can I achieve more randomness in my callouts.  Currently I'm using the

"int r = new Random().Next(1, 4);" and then within the if statement an "if (new Random().Next (1, 3) == 2)" but I've found you can only use that twice and only in the "if" part.  Any other methods?

 

 

Create one Random()  instance and use it everywhere in your Plugin instead of making a new random() every time. 

For spawning you could use World. GetNextPositionOnStreet() to get a relatively safe spawn location for a ped :) 

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.

21 hours ago, Albo1125 said:

Create one Random()  instance and use it everywhere in your Plugin instead of making a new random() every time. 

For spawning you could use World. GetNextPositionOnStreet() to get a relatively safe spawn location for a ped :) 

This...there is also a native for finding ped-safe coordinates. I forget exactly what it's called. Its not 100% reliable though...I ended up running that native 5 times I think, expanding the distance each time. If it still fails, then I use GetNextPositionOnStreet(). It at least minimizes the amount of times that they spawn in the middle of the road.

Stealth22
LSPDFR Tester | Plugin Developer
My Plugins: Code 3 Callouts | Traffic Control | Keep Calm | ALPR+

Please do not PM me for any kind of technical support.
I unfortunately do not have enough free time to answer every PM that I get. For issues with my plugins, please post in the comments section of the file, or it's forum thread. You'll get a much quicker response from me there than if you send me a PM; I do my best to respond to every question in the comments sections. For API/programming questions, please post them in the API Development forum, so all developers can benefit from the answer as well. Thanks!

47 minutes ago, Stealth22 said:

This...there is also a native for finding ped-safe coordinates. I forget exactly what it's called. Its not 100% reliable though...I ended up running that native 5 times I think, expanding the distance each time. If it still fails, then I use GetNextPositionOnStreet(). It at least minimizes the amount of times that they spawn in the middle of the road.

This native GET_SAFE_COORD_FOR_PED

  • Author
23 hours ago, Albo1125 said:

Create one Random()  instance and use it everywhere in your Plugin instead of making a new random() every time. 

For spawning you could use World. GetNextPositionOnStreet() to get a relatively safe spawn location for a ped :) 

So do I do my Random() in the beginning in the namespace, then just refer back to it when I want?  What do I put under it, normally I do 

spawn perp3, give gun, make them fight, make them run, or any combination of them.  (Sorry, I'm still not too good with coding!)

1 hour ago, Stealth22 said:

This...there is also a native for finding ped-safe coordinates. I forget exactly what it's called. Its not 100% reliable though...I ended up running that native 5 times I think, expanding the distance each time. If it still fails, then I use GetNextPositionOnStreet(). It at least minimizes the amount of times that they spawn in the middle of the road.

Right, I use that for the spawnpoint, but the issue is that I spawn vehicles and peds off of that spawnpoint.  I'm going to try something using this though and will report back!

1 hour ago, alexguirre said:

This native GET_SAFE_COORD_FOR_PED

Haha, that is way above my skill level!  I wish I could understand how to use it!

Another question, too.  How in the world do I get a route to my blips?  I've tried "CopBlip.EnableRoute(Color.Blue);" and it only works when I do it inside my if, else statements.  The issue is I have those set up not to start the callout spawning until a certain distance away, which means the person won't have the route for half the distance.  I tried putting it below Process() and base.Process() but  it won't work and just crashes.  Any ideas? 

 

Thank you guys for helping me!  (I'm assuming you tried my plugin and saw how bad the spawns are, haha)

Edited by fiskey111
Added another question!

 

 

4 hours ago, fiskey111 said:

So do I do my Random() in the beginning in the namespace, then just refer back to it when I want?  What do I put under it, normally I do 

spawn perp3, give gun, make them fight, make them run, or any combination of them.  (Sorry, I'm still not too good with coding!)

Right, I use that for the spawnpoint, but the issue is that I spawn vehicles and peds off of that spawnpoint.  I'm going to try something using this though and will report back!

Haha, that is way above my skill level!  I wish I could understand how to use it!

Another question, too.  How in the world do I get a route to my blips?  I've tried "CopBlip.EnableRoute(Color.Blue);" and it only works when I do it inside my if, else statements.  The issue is I have those set up not to start the callout spawning until a certain distance away, which means the person won't have the route for half the distance.  I tried putting it below Process() and base.Process() but  it won't work and just crashes.  Any ideas? 

 

Thank you guys for helping me!  (I'm assuming you tried my plugin and saw how bad the spawns are, haha)

Did you put the EnableRoute() under your Attatchblip()?

 CopBlip = myCopCar.AttachBlip();
  CopBlip.Color = Color.Blue;

CopBlip.EnableRoute();

  • 4 weeks later...
  • Author

I have two questions so far:

1. How do I make an ambient scenario?  I assume it's using "WorldEventInfoAttribute.WorldEventInfoAttribute(string, int)" but I have no clue how to use that...

2. Is there a way to give my ped body armor?

Thank you!

 

 

9 hours ago, fiskey111 said:

I have two questions so far:

1. How do I make an ambient scenario?  I assume it's using "WorldEventInfoAttribute.WorldEventInfoAttribute(string, int)" but I have no clue how to use that...

2. Is there a way to give my ped body armor?

Thank you!

1. What exactly are you thinking of?

2. ped.Armor = 100;

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.

  • Author
1 hour ago, Albo1125 said:

1. What exactly are you thinking of?

2. ped.Armor = 100;

1. Well my hope is to basically have a ped (either spawned or grabbed from the environment a small distance away) get a gun and start shooting the player.

2. Wow I literally could not find that anywhere....  Didn't know that was so simple....

And the third question I forgot...

3. I want to make the unit spawning in my callouts specific to the area.  Like in Blaine County a sheriff unit spawns.  I'm assuming it's using EWorldZone._____, but I can't figure out how to use it to register the area....

4. Any idea why these cops don't leave after my callouts done?  These are the backup units that responded CODE3 to the location.  I can't figure out why they don't leave.

Spoiler

help2.thumb.jpg.ef08b5126e89646135c190a6

 

Edited by fiskey111
Added a 4th question!

 

 

What I'm doing for ambient events, is starting a new GameFiber as part of my "OnDuty" function. This fiber then does the random check for an ambient event, calling the relevant code if one gets triggered, then sleeps for 60 seconds, all within a while(true) loop (the 60 seconds is primarily for testing, it should be longer than that to avoid spamming the user with events). Not sure if this is the best way to do it, but it works.

My YouTube Channel: Darkmyre Gaming (Australian LSPDFR patrols, plugins in development, and other games)

My Discord Server | AusGamer Network

 

Please do not PM me for technical support or bug reports, use the appropriate forum or plugin's comments instead.

  • Author

Hi everyone,

So I'm running into something new with 0.3 (at least from what I've noticed)- in my Gang Attack callout I call in backup units CODE 3 to the scene (I don't put the suspects in a pursuit since they'll flee and not fight).

However, when the callout ends and calls CODE 4 the backup units just sit there and don't leave the scene (even if the cops are alive).  

Check this video- you can see the units just sitting there with one officer standing at his car)

 

Any ideas on how to fix this?  Or is this just something with 0.3?  (I haven't played 0.3 much [only like 15 mins] so I'm not sure how the backup usually acts with CODE 3 response)

Thanks!

 

 

  • Author

Hi guys!

Another question!  I want to check to see if a callout is in a specific state (like state == EOfficerShotState.Arrived)

How can I accomplish this?  I've tried but I can't figure it out. Here's my code:

Spoiler

        public static void OnItemSelect(UIMenu sender, UIMenuItem selectedItem, int index)
        {
            if (sender != mainMenu) return;

            if (selectedItem == saveofficer && OfficerDown.EOfficerDownState.OnScene)
            {
                Call SaveOfficer(); somehow too
            }

That isn't working- so how can I do that?  Is there another way?  I don't want to player to crash if they select the wrong thing.

Thanks!!

 

 

9 hours ago, fiskey111 said:

Hi guys!

Another question!  I want to check to see if a callout is in a specific state (like state == EOfficerShotState.Arrived)

How can I accomplish this?  I've tried but I can't figure it out. Here's my code:

  Hide contents

        public static void OnItemSelect(UIMenu sender, UIMenuItem selectedItem, int index)
        {
            if (sender != mainMenu) return;

            if (selectedItem == saveofficer && OfficerDown.EOfficerDownState.OnScene)
            {
                Call SaveOfficer(); somehow too
            }

That isn't working- so how can I do that?  Is there another way?  I don't want to player to crash if they select the wrong thing.

Thanks!!

if (OfficerDown == EOfficerDownState.OnScene) or something similar. You should check a custom enum variable against one of the values; in the code above, you don't seem to be checking an enum but a bool.

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.

See my inheritance example on the GitHub repo: https://github.com/LMSDev/LSPDFR-API/tree/master/API%20Examples/InheritanceExample

I've got a callout state enum in there. Its in the CalloutBase class, which is inherited by each of the callout classes.

Stealth22
LSPDFR Tester | Plugin Developer
My Plugins: Code 3 Callouts | Traffic Control | Keep Calm | ALPR+

Please do not PM me for any kind of technical support.
I unfortunately do not have enough free time to answer every PM that I get. For issues with my plugins, please post in the comments section of the file, or it's forum thread. You'll get a much quicker response from me there than if you send me a PM; I do my best to respond to every question in the comments sections. For API/programming questions, please post them in the API Development forum, so all developers can benefit from the answer as well. Thanks!

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.