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.

Please Help!

Featured Replies

  • Author
2 hours ago, alexguirre said:

Use UIMenuListItem.Index if you only need the current position.
If you also need also the object at that position use UIMenuListItem.IndexToItem() and, as parameter, pass UIMenuListItem.Index

Can we hide cursor while RageNativeUI is visible?

5 minutes ago, Fenix2525WOT said:

Can we hide cursor while RageNativeUI is visible?

Figured it out, sorry for asking.

header.png.584c28e8d611130062860b2efc498fc2.png

Los Santos Rescue Division Developer

CLICK HERE TO LEARN MORE

 

  • Replies 33
  • Views 2.3k
  • Created
  • Last Reply

Top Posters In This Topic

Most Popular Posts

  • alexguirre
    alexguirre

    I doubt he could go to line 131 of Functions.cs and line 579 in CalloutManager.cs, because those are classes from LSPDFR  @Fenix2525WOT the problem is that you can't sleep a FrameRender, OnItemSel

  • alexguirre
    alexguirre

    At the end of your Main() method put GameFiber.Hibenate() or a while loop if you need something to run constantly. This will prevent the plugin from reaching the end of the Main() method and therefore

  • alexguirre
    alexguirre

    Use the InitializationFile class from RPH(http://docs.ragepluginhook.net/html/DEEB0B71.htm). Previous topic about the same thing:   

  • Author
1 hour ago, alexguirre said:

Use the InitializationFile class from RPH(http://docs.ragepluginhook.net/html/DEEB0B71.htm).

Previous topic about the same thing: 

 

How to check if the pursuit is running and write the data to boolean?

Tried     Functions.GetActivePursuit      but didn't manage to make bool out of it's data.

header.png.584c28e8d611130062860b2efc498fc2.png

Los Santos Rescue Division Developer

CLICK HERE TO LEARN MORE

 

17 minutes ago, Fenix2525WOT said:

How to check if the pursuit is running and write the data to boolean?

Tried     Functions.GetActivePursuit      but didn't manage to make bool out of it's data.

using LSPD_First_Response.Mod.API;

private static bool isPursuitRunning()
{
     LHandle pursuitHandle = Functions.GetActivePursuit();
     
     if (pursuitHandle == null)
     {
         //no pursuit found
         return false;
     }
     else
     {
         return Functions.IsPursuitStillRunning(pursuitHandle);
     }
}

That should* work.

* Disclaimer: Poster's code is provided as-is, with no guarantees of functionality provided. :whistling:

EDIT: By the way, you might find Visual Studio's Object Browser (View --> Object Browser) quite useful

Edited by Stealth22

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 minutes ago, Stealth22 said:

using LSPD_First_Response.Mod.API;

private static bool isPursuitRunning()
{
     LHandle pursuitHandle = Functions.GetActivePursuit();
     
     if (pursuitHandle == null)
     {
         //no pursuit found
         return false;
     }
     else
     {
         return Functions.IsPursuitStillRunning(pursuitHandle);
     }
}

That should* work.

* Disclaimer: Poster's code is provided as-is, with no guarantees of functionality provided. :whistling:

Thanks, man. Helped me a lot!

@Stealth22 ,  Do you know if there's a function to call fire department?  like Main characters can dialing 911 on the phone

header.png.584c28e8d611130062860b2efc498fc2.png

Los Santos Rescue Division Developer

CLICK HERE TO LEARN MORE

 

2 hours ago, Fenix2525WOT said:

Thanks, man. Helped me a lot!

@Stealth22 ,  Do you know if there's a function to call fire department?  like Main characters can dialing 911 on the phone

It's something like Dispatch.RequestBackup.Fire

I can let you know when I get home, don't have my computer handy. Maybe @Stealth22 knows what I'm talking about and has the code handy.

Also, couldnt you use if (!PursuitIsRunning) { }

??

Functions.RequestBackup(Game.LocalPlayer.Character.Position, EBackupResonseType.Code3, EBackupUnitType.Firetruck);

 

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

LSPD Frist Responce.dll plugin crashes every time trying to do this function. Don't you know why?

 

My Code:

using LSPD_First_Responce.Mod.API;


public static void OnItemSelect(UIMenu sender, UIMenuItem selectedItem, int index)
{
            if (selectedItem == BackupList)
            {
                if(BackupList.Index == 0)
                {
                    Functions.RequestBackup(Game.LocalPlayer.Character.Position,LSPD_First_Response.EBackupResponseType.Code3, LSPD_First_Response.EBackupUnitType.Ambulance);
                } else
                    if (BackupList.Index == 1)
                {
                    Functions.RequestBackup(Game.LocalPlayer.Character.Position, LSPD_First_Response.EBackupResponseType.Code3, LSPD_First_Response.EBackupUnitType.Firetruck);
                }

            }
            if(selectedItem == FIREBACKUP)
           
            {
                Vector3 pos = Game.LocalPlayer.Character.Position;
                LHandle pursuitHandle = Functions.GetActivePursuit();
                if (pursuitHandle != null)
                {
                    Functions.RequestBackup(pos, LSPD_First_Response.EBackupResponseType.Code3, LSPD_First_Response.EBackupUnitType.Firetruck);
                    Functions.RequestBackup(pos, LSPD_First_Response.EBackupResponseType.Code3, LSPD_First_Response.EBackupUnitType.Firetruck);
                    Functions.RequestBackup(pos, LSPD_First_Response.EBackupResponseType.Code3, LSPD_First_Response.EBackupUnitType.Ambulance);
                    Functions.RequestBackup(pos, LSPD_First_Response.EBackupResponseType.Code3, LSPD_First_Response.EBackupUnitType.Ambulance);
                    System.Media.SoundPlayer player = new System.Media.SoundPlayer(Megaphone.Properties.MegaphoneRes.CARONFIRE_1);
                    player.Load();
                    player.Play();
                    GameFiber.Sleep(14000);
                    Functions.PlayScannerAudioUsingPosition("IN_OR_ON_POSITION", pos);
                    GameFiber.Sleep(2000);
                    System.Media.SoundPlayer player2 = new System.Media.SoundPlayer(Megaphone.Properties.MegaphoneRes.CARONFIRE_2);
                    player.Load();
                    player.Play();
                } else Game.DisplaySubtitle("You Should Be In A Pursuit", 6000);
}

 

@ToastinYou and @Stealth22 , help please :)

 

header.png.584c28e8d611130062860b2efc498fc2.png

Los Santos Rescue Division Developer

CLICK HERE TO LEARN MORE

 

  • Author

 

[09.06.2016 17:16:19.812] LSPD First Response: ==============================
[09.06.2016 17:16:19.812] LSPD First Response: UNHANDLED EXCEPTION DURING GAME FIBER TICK
[09.06.2016 17:16:19.813] LSPD First Response: ------------------------------
[09.06.2016 17:16:19.813] LSPD First Response: Origin: Rage.SleeplessGameFiber
[09.06.2016 17:16:19.813] LSPD First Response: ------------------------------
[09.06.2016 17:16:19.814] LSPD First Response: Exception type: System.NullReferenceException
[09.06.2016 17:16:19.815] LSPD First Response: Exception message: ?????? ?? ?????? ?? ????????? ?? ????????? ???????.
[09.06.2016 17:16:19.815] LSPD First Response: ------------------------------
[09.06.2016 17:16:19.816] LSPD First Response: Inner exceptions:
[09.06.2016 17:16:19.816] LSPD First Response: ------------------------------
[09.06.2016 17:16:19.817] LSPD First Response: Stack trace:
[09.06.2016 17:16:19.817] LSPD First Response: ? LSPD_First_Response.Mod.API.Functions.GetActivePursuit() ? E:\GTA V\LSPD First Response\LSPD First Response\Mod\API\Functions.cs:?????? 131
[09.06.2016 17:16:19.818] ? MenuExample.EntryPoint.OnItemSelect(UIMenu sender, UIMenuItem selectedItem, Int32 index) ? C:\Users\Yaroslav\documents\visual studio 2015\Projects\Megaphone\Megaphone\MainClass.cs:?????? 331
[09.06.2016 17:16:19.818] ? RAGENativeUI.ItemSelectEvent.Invoke(UIMenu sender, UIMenuItem selectedItem, Int32 index)
[09.06.2016 17:16:19.818] ? RAGENativeUI.UIMenu.SelectItem()
[09.06.2016 17:16:19.819] ? RAGENativeUI.UIMenu.ProcessControl(Keys key)
[09.06.2016 17:16:19.819] ? RAGENativeUI.MenuPool.ProcessMenus()
[09.06.2016 17:16:19.819] ? MenuExample.EntryPoint.Process(Object sender, GraphicsEventArgs e) ? C:\Users\Yaroslav\documents\visual studio 2015\Projects\Megaphone\Megaphone\MainClass.cs:?????? 359
[09.06.2016 17:16:19.819] ? System.EventHandler`1.Invoke(Object sender, TEventArgs e)
[09.06.2016 17:16:19.820] ? Rage.Game.RaiseFrameRender(GraphicsEventArgs e)
[09.06.2016 17:16:19.820] ? Rage.RemotePlugin.HandleRenderThread()
[09.06.2016 17:16:19.821] ? Rage.GameFiber.Main()
[09.06.2016 17:16:19.821] LSPD First Response: ==============================
[09.06.2016 17:16:19.821] LSPD First Response: 
[09.06.2016 17:16:21.034] LSPD First Response: Error while initializing plugin: MenuExample.EntryPoint: ????? ????????? ? ???????? ??????????.   ? Rage.GameFiber.SleepThis(Int32 duration)
[09.06.2016 17:16:21.035] ? MenuExample.EntryPoint.Initialize() ? C:\Users\Yaroslav\documents\visual studio 2015\Projects\Megaphone\Megaphone\MainClass.cs:?????? 62
[09.06.2016 17:16:21.035] ? ?????????????????????????????????????????.?????????????????????????????????????????() ? E:\GTA V\LSPD First Response\LSPD First Response\Mod\Callouts\CalloutManager.cs:?????? 579
[09.06.2016 17:16:21.038] ForceDuty: ????? ????????? ? ???????? ??????????.
 

Edited by Fenix2525WOT

header.png.584c28e8d611130062860b2efc498fc2.png

Los Santos Rescue Division Developer

CLICK HERE TO LEARN MORE

 

The answers are in there :)

Go to line 131 of Functions.cs and find the issue.

[09.06.2016 17:16:19.817] LSPD First Response: ? LSPD_First_Response.Mod.API.Functions.GetActivePursuit() ? E:\GTA V\LSPD First Response\LSPD First Response\Mod\API\Functions.cs:?????? 131

 

Go to line 359 of MainClass.cs to find the issue.

[09.06.2016 17:16:19.819] ? MenuExample.EntryPoint.Process(Object sender, GraphicsEventArgs e) ? C:\Users\Yaroslav\documents\visual studio 2015\Projects\Megaphone\Megaphone\MainClass.cs:?????? 359

 

Go to line 579 in CalloutManager.cs and find the issue.

[09.06.2016 17:16:21.035] ? ?????????????????????????????????????????.?????????????????????????????????????????() ? E:\GTA V\LSPD First Response\LSPD First Response\Mod\Callouts\CalloutManager.cs:?????? 579

 

If you still can't figure it out copy and paste those lines in the post. And I can help you.

2 minutes ago, ToastinYou said:

The answers are in there :)

Go to line 131 of Functions.cs and find the issue.

[09.06.2016 17:16:19.817] LSPD First Response: ? LSPD_First_Response.Mod.API.Functions.GetActivePursuit() ? E:\GTA V\LSPD First Response\LSPD First Response\Mod\API\Functions.cs:?????? 131

 

Go to line 359 of MainClass.cs to find the issue.

[09.06.2016 17:16:19.819] ? MenuExample.EntryPoint.Process(Object sender, GraphicsEventArgs e) ? C:\Users\Yaroslav\documents\visual studio 2015\Projects\Megaphone\Megaphone\MainClass.cs:?????? 359

 

Go to line 579 in CalloutManager.cs and find the issue.

[09.06.2016 17:16:21.035] ? ?????????????????????????????????????????.?????????????????????????????????????????() ? E:\GTA V\LSPD First Response\LSPD First Response\Mod\Callouts\CalloutManager.cs:?????? 579

 

If you still can't figure it out copy and paste those lines in the post. And I can help you.

I doubt he could go to line 131 of Functions.cs and line 579 in CalloutManager.cs, because those are classes from LSPDFR :tongue:

@Fenix2525WOT the problem is that you can't sleep a FrameRender, OnItemSelect gets called in the FrameRender via RAGENativeUI, if you need to sleep it, encapsulate that code in a new GameFiber.

Also after you finished using objects that implement the IDisposable interface(e.g. SoundPlayer) call the Dispose() method, or use the using statement:
 

System.Media.SoundPlayer player = new System.Media.SoundPlayer(Megaphone.Properties.MegaphoneRes.CARONFIRE_1);
player.Load();
player.Play();
player.Dispose();

//I recommend you to use the 'using' statement
using(System.Media.SoundPlayer player = new System.Media.SoundPlayer(Megaphone.Properties.MegaphoneRes.CARONFIRE_1))
{
	player.Load();
	player.Play();
}
// This way you don't forget to dispose the object, it's done automatically.

 

  • Author
7 minutes ago, alexguirre said:

I doubt he could go to line 131 of Functions.cs and line 579 in CalloutManager.cs, because those are classes from LSPDFR :tongue:

@Fenix2525WOT the problem is that you can't sleep a FrameRender, OnItemSelect gets called in the FrameRender via RAGENativeUI, if you need to sleep it, encapsulate that code in a new GameFiber.

Also after you finished using objects that implement the IDisposable interface(e.g. SoundPlayer) call the Dispose() method, or use the using statement:
 


System.Media.SoundPlayer player = new System.Media.SoundPlayer(Megaphone.Properties.MegaphoneRes.CARONFIRE_1);
player.Load();
player.Play();
player.Dispose();

//I recommend you to use the 'using' statement
using(System.Media.SoundPlayer player = new System.Media.SoundPlayer(Megaphone.Properties.MegaphoneRes.CARONFIRE_1))
{
	player.Load();
	player.Play();
}
// This way you don't forget to dispose the object, it's done automatically.

 

Thanks, but what shoul I do with that? Those buttons also cause crashing

 

public static void OnItemSelect(UIMenu sender, UIMenuItem selectedItem, int index)
{
            if (selectedItem == BackupList)
            {
                if(BackupList.Index == 0)
                {
                    Functions.RequestBackup(Game.LocalPlayer.Character.Position,LSPD_First_Response.EBackupResponseType.Code3, LSPD_First_Response.EBackupUnitType.Ambulance);
                } else
                    if (BackupList.Index == 1)
                {
                    Functions.RequestBackup(Game.LocalPlayer.Character.Position, LSPD_First_Response.EBackupResponseType.Code3, LSPD_First_Response.EBackupUnitType.Firetruck);
                }

            }

header.png.584c28e8d611130062860b2efc498fc2.png

Los Santos Rescue Division Developer

CLICK HERE TO LEARN MORE

 

1 minute ago, Fenix2525WOT said:

Thanks, but what shoul I do with that? Those buttons also cause crashing

 


public static void OnItemSelect(UIMenu sender, UIMenuItem selectedItem, int index)
{
            if (selectedItem == BackupList)
            {
                if(BackupList.Index == 0)
                {
                    Functions.RequestBackup(Game.LocalPlayer.Character.Position,LSPD_First_Response.EBackupResponseType.Code3, LSPD_First_Response.EBackupUnitType.Ambulance);
                } else
                    if (BackupList.Index == 1)
                {
                    Functions.RequestBackup(Game.LocalPlayer.Character.Position, LSPD_First_Response.EBackupResponseType.Code3, LSPD_First_Response.EBackupUnitType.Firetruck);
                }

            }

Did you read what I said? I said that you have to encapsulate that in a new GameFiber.
 

public static void OnItemSelect(UIMenu sender, UIMenuItem selectedItem, int index)
{
	GameFiber.StartNew(() =>
	{
			// your code
	});

 

  • Author
1 minute ago, alexguirre said:

Did you read what I said? I said that you have to encapsulate that in a new GameFiber.
 


public static void OnItemSelect(UIMenu sender, UIMenuItem selectedItem, int index)
{
	GameFiber.StartNew(() =>
	{
			// your code
	});

 

Oh, I missed that, Sorry and thanks very much

header.png.584c28e8d611130062860b2efc498fc2.png

Los Santos Rescue Division Developer

CLICK HERE TO LEARN MORE

 

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.