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

  • Author
12 hours ago, Albo1125 said:

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.

 

4 hours ago, Stealth22 said:

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.

There are two issues I'm running into:

1.  Apparently you can't use an enum in a static class (I'm still not 100% sure with all the names in coding, but I have an idea of what each are)

I try to but it won't register the enum (I even made a common one like yours, Stealth22)

2.  I can't call another process from a callout inside the static voids (again, not quite sure why)

I try to call OfficerDown.Process() inside a part of the RageNativeUI [ public static void OnItemSelect(.....) ] but it won't let me either!

I'm pretty fed up!  I wanted to make this work so the player can select audio files to add realism and variation (and interaction) but I might just end up forcing specific audio if I can't get this to work.

 

 

  • 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

You can't call your Process function from Rage Native UI. In fact, you don't call it at all, LSPDFR does. 

Your callout class should not be static. Think of static classes as one entity. You can't create an instance of a static class. Non static classes, you have to create an instance of in order to use. 

I'm on my phone at the moment, so I can't explain it to you in much detail. I suggest you look up some C# tutorials to get an idea of the terminology. You can also check out the examples in the GitHub repository. 

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!

  • Author
9 hours ago, Stealth22 said:

You can't call your Process function from Rage Native UI. In fact, you don't call it at all, LSPDFR does. 

Your callout class should not be static. Think of static classes as one entity. You can't create an instance of a static class. Non static classes, you have to create an instance of in order to use. 

I'm on my phone at the moment, so I can't explain it to you in much detail. I suggest you look up some C# tutorials to get an idea of the terminology. You can also check out the examples in the GitHub repository. 

Right, sorry.  I probably should have explained myself better...  I know you can't call process, I was using that as a general function; I'd like to call a function that is in my callouts and is called from my process function, OfficerShotSave(), a separate function that is inside the callout class.

The static classes I was talking about were a part of the NativeUI, sorry, I should have been more specific!

I'm definitely going to try to find some tutorials on using static classes and calling things from them!

Thanks!

 

 

  • Author

Just as an update, I found a way to solve my problems!  I'm able to check the enum state of the RageNativeUI, which will allow me to check in my Callouts if a certain button has been pressed!  (I hope that makes sense, haha).  Thank you for your help guys!

 

 

  • 2 weeks later...
  • Author

Hi Everyone!

So I'm coding for my restraining order callout (preparing for the audio, so when you see a subtitle it'll be audio).

For some reason when I get to process "GoodTalk1()" it runs it once, displays the subtitle, but then won't keep my GoodTalk2() running.  Any ideas as to how to fix this?

To simplify it-
GoodTalk1():  Two variations, if variation 2 [good] is active, the ped will say something that I want the cop to respond to by pressing an option in the menu, which is what GoodTalk2() is checking for.

The issue is that it seems to run GoodTalk2() once, (I used notifications to check to see when it ran) then it just abandons it.  So I'm trying to figure out how to keep this process running.  Thanks!

If you check the 2nd spoiler you can see a successful process that's above GoodTalk1() - I tried using the same idea but it just won't work.

Spoiler

        public void GoodTalk1()
        {
            if (state4 == EAudioState.GoodTalk1)
            {
                // Good choice!
                state4 = EAudioState.Neutral;
                int b = RandomNumber.r.Next(1, 5);
                if (b == 1)
                {
                    // Bad variation...
                    perp.Tasks.PlayAnimation("random@shop_tattoo", "_impatient_a", 5f, AnimationFlags.None);
                    Game.DisplaySubtitle("No! I don't know what you're...", 5000);
                    GameFiber.Sleep(5100);
                    BadTalk1();
                }
                else
                {
                    // Good variation...
                    perp.Tasks.PlayAnimation("random@shop_tattoo", "_impatient_a", 5f, AnimationFlags.None);
                    Game.DisplaySubtitle("Yeah I've been near here...", 5000);
                    GameFiber.Sleep(5100);
                    state4 = EAudioState.GoodTalk2;
                }
            }
            if (state4 == EAudioState.GoodTalk2)
            {
                GoodTalk2();
            }
        }

        public void BadTalk1()
        {
            int p = RandomNumber.r.Next(1, 4);

            if (p == 1)
            {
                PerpShoot();
            }
            else
            {
                PerpPunch();
            }
        }

        public void GoodTalk2()
        {
            if (SecondaryMenu.state5 == SecondaryMenu.EState.RestAudio5)
            {
                // Just relax and let's talk for a minute...
                Game.DisplaySubtitle("COP: Just relax...", 5000);
                GameFiber.Sleep(5100);
                state4 = EAudioState.GoodTalk3;
            }
            if (SecondaryMenu.state5 == SecondaryMenu.EState.RestAudio6)
            {
                // We have a person who described you...
                Game.DisplaySubtitle("COP: We have a person...", 5000);
                GameFiber.Sleep(5100);
                state4 = EAudioState.GoodTalk3;
            }
            if (SecondaryMenu.state5 == SecondaryMenu.EState.RestAudio3)
            {
                // You better stop that...
                state4 = EAudioState.BadTalk2;
            }
            if (SecondaryMenu.state5 == SecondaryMenu.EState.RestAudio4)
            {
                // Hey!  Just stay here and talk to me...
                state4 = EAudioState.BadTalk2;
            }
            if (state4 == EAudioState.GoodTalk3)
            {
                GoodTalk3();
            }
            if (state4 == EAudioState.BadTalk2)
            {
                BadTalk2();
            }
        }

 

Spoiler

       	Process()
		{
			base.Process();
			. [other random code starts here]
			.
			. [other random code ends here]

			if (state4 == EAudioState.Intro)
            {
                Conversation();
            }
        }

        public void Conversation()
        {
            if (SecondaryMenu.state5 == SecondaryMenu.EState.RestAudio3)
            {
                state4 = EAudioState.Neutral;
                // You better stop that...
                PerpShoot();
            }
            if (SecondaryMenu.state5 == SecondaryMenu.EState.RestAudio4)
            {
                // Hey! Just stay here...
                Game.DisplaySubtitle("GoodTalk1a", 2000);
                GameFiber.Sleep(2100);
                state4 = EAudioState.GoodTalk1;
            }
            if (SecondaryMenu.state5 == SecondaryMenu.EState.RestAudio5)
            {
                // Just relax and let's talk...
                Game.DisplaySubtitle("GoodTalk1b", 2000);
                GameFiber.Sleep(2100);
                state4 = EAudioState.GoodTalk1;
            }
            if (SecondaryMenu.state5 == SecondaryMenu.EState.RestAudio6)
            {
                // We have a person who described you...
                Game.DisplaySubtitle("GoodTalk1c", 2000);
                GameFiber.Sleep(2100);
                state4 = EAudioState.GoodTalk1;
            }
            if (state4 == EAudioState.Neutral)
            {
                PerpShoot();
            }
            if (state4 == EAudioState.GoodTalk1)
            {
                GoodTalk1();
            }
        }

 

Here's a video of it in action:

 

 

Edited by fiskey111
Added video!

 

 

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.