Jump to content

[QUESTION] Callout timer


ZPhDevs

Recommended Posts

What do you mean call this feature I dont understand. If you just want to start a pursuit whether it be a robbery or not, and are using RagePluginHook to run lspdfr, press f4 and a ragepluginhook menu pops up, now type "StartCallout Pursuit" which will start a pursuit. If you want to start a holdup, do the same, "StartCallout Holdup" and same for every callout you download in the future.

GRAY

Link to comment
Share on other sites

No, what I meant was how one would go about coding this feature. I haven't found it anywhere yet, looking through the LSPDFR API and RageHookDev document.

 

EDIT:  I basically want to try an add the same function to a callout I've been working on. 

Edited by ZPhDevs
Link to comment
Share on other sites

3 minutes ago, Rich said:

You probably want to work with RNUI for the timer bar and add pursuit logic based off of that.

 

Oh I see. Well I figured since LSPDFR does it without involving RNUI (assumed) something like that was possible without adding more references. I wanted to try and keep down the requirements for users.

Edited by ZPhDevs
Link to comment
Share on other sites

Looking at RNUI it does indeed have Timer Bars, however it doesn't seem to have a countdown. Not when browsing through the documentation on GitHub atleast.

Maybe @LMS knows more about how LSPDFR handles the Timerbars.

 

EDIT: I've found when using LSPD_First_Response.Engine.UI there's TimerBarBase, TextTimerBar and BarTimerBar, which does sound like what I'm looking for. But then, being new to scripting in general, I really don't know how to make any good use of it.

Edited by ZPhDevs
Link to comment
Share on other sites

  • Management Team

We do not expose that functionality.

Please do not PM me unless really necessary (knowing you helps). If you think you need my attention in a topic, tag me.

Link to comment
Share on other sites

16 minutes ago, LMS said:

We do not expose that functionality.

That's alright. I was just wondering if there was anything in the API document I didn't fully understand. But if that's the case I'll look more closely into RNUI and see if I can get something to work from there.

 

Thanks for responding! 🙂

Link to comment
Share on other sites

13 minutes ago, ZPhDevs said:

That's alright. I was just wondering if there was anything in the API document I didn't fully understand. But if that's the case I'll look more closely into RNUI and see if I can get something to work from there.

 

Thanks for responding! 🙂

Make a down counting timer, format the seconds / milliseconds and display the value in the bartimerbar

For LSPDFR support join my discord:
https://discord.gg/4zx2uXCmMe

 

❤️

 

Link to comment
Share on other sites

 I got the  bar to show up when the callout started by adding the code to the callout. Being new to this, I couldn't figure out how to call it from a separate item. But I'll leave that for the future.

 

What's the easiest approach to making a count down timer? Using Game.GameTime or Windows.Timer ? 

 

EDIT: I used an integer decreasing value for the timer until I can understand how to make full use of Game.GameTime. It's working properly except for when the game is slowed down. But I can live with that for now.

When the integer value is 0 (Time is up), a boolean is switched to true so other methods can detect it.

 

 

I made it like this. The pursuit is properly triggered when the timer reaches 0 but it's immediately called off and the callout is ended.

I suspect this is because of some LOS issue? Is there a way to trigger a pursuit with a ped without the player being nearby?

if (TimeUp && Game.LocalPlayer.Character.DistanceTo(Mugger.Position) > 30f)
            {
                pursuit = Functions.CreatePursuit();
                Functions.AddPedToPursuit(pursuit, Mugger);
                Functions.SetPursuitIsActiveForPlayer(pursuit, true);
                Functions.PlayScannerAudio("ATTENTION_ALL_UNITS CRIME_RESIST_ARREST IN_OR_ON_POSITION UNITS_RESPOND_CODE_3 ");
                PursuitCreated = true;
                Mugger.BlockPermanentEvents = false;

                Victim.Tasks.ReactAndFlee(Mugger);
                SearchArea.Delete();
                CallSpot.Delete();
            }

 

Edited by ZPhDevs
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...