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.

Questions regarding Peds and Player

Featured Replies

Hello guys,

 

I've decided to learn modding for LSPDFR. As I'm a C# .NET developer, I was happy really about the API, so this shouldn't be the problem.

Here are some thoughts of what I'm planning to do:

Most of the time I'm playing as a federal agent (FIB or IAA) but the callouts don't really fit at the moment. With the Traffic Policer mod I had a callout to stop a guy who has associations with IS, which perfectly fit as I was an FIB agent.

Now I wanted to do following things:

  • Spawn suspects (with or without weapons) only in LS or maybe the surrounding villages in the county (so no random ped in the middle of the highway)
  • This leads of course to a longer ETA (intended)
  • Agency dependent callouts, e.g. terrorist associations for FIB/IAA, drug stuff for DOA like 
if(Player.Agency == Agencies.FIB)
{
    RegisterTerroristCallout();
}
  • Peds who just stroll like every other peds (looks stupid when the suspect is waiting for you)

 

So do you guys have examples or tips on that? Is this even possible at the moment or should I create a request on GitHub?

 

Best regards,

Mythos

Remember that calling Ped.Dismiss() sets IsPersistent to false, so the ped could be cleaned up by GTA V at any time. Telling them to wander is fine, but sometimes they tend to take out their cell phone and start talking on it. Once they do that, they become more difficult to interact with and seem to ignore commands, at least in my experience.

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!

Remember that calling Ped.Dismiss() sets IsPersistent to false, so the ped could be cleaned up by GTA V at any time. Telling them to wander is fine, but sometimes they tend to take out their cell phone and start talking on it. Once they do that, they become more difficult to interact with and seem to ignore commands, at least in my experience.

Are you sure nothing else is controlling the ped? I'm working on a callout right now and I amd using Wander() but have had no issues (ped seems to take out phone every time though), that said I did not call Dismiss() on the ped. Maybe the issue comes from dismissing them?

 

As for the agency thing, the only thing I can see right now that would help is the PoliceAgency Enum. I am actually currently trying to do the same thing as you... PoliceAgency doesn't seem to provide any information at the moment as there are no API functions for it.

I believe callouts are registered when LSPDFR is loaded, if they are not you should be able to just do an if statement in your method that handles OnOnDutyStateChanged. Otherwise, you could verify the players PoliceAgency in the callout itself and then not display the callout if they are the wrong agency. If you have multiple callouts it'd be beneficial to create a central method for this.

Edited by goigle

Are you sure nothing else is controlling the ped? I'm working on a callout right now and I amd using Wander() but have had no issues (ped seems to take out phone every time though), that said I did not call Dismiss() on the ped. Maybe the issue comes from dismissing them?

As for the agency thing, the only thing I can see right now that would help is the PoliceAgency Enum. I am actually currently trying to do the same thing as you... PoliceAgency doesn't seem to provide any information at the moment as there are no API functions for it.

I believe callouts are registered when LSPDFR is loaded, if they are not you should be able to just do an if statement in your method that handles OnOnDutyStateChanged. Otherwise, you could verify the players PoliceAgency in the callout itself and then not display the callout if they are the wrong agency. If you have multiple callouts it'd be beneficial to create a central method for this.

I had (experimental/development) versions of Keep Calm running whenever that happened, so Keep Calm was likely the culprit there, or at least I assumed so. I just have never tried it since. But yeah, I don't dismiss them until the end of the callout, or unless I am completely finished with that entity.

For the agency thing, you have to either do a map zone detection like Albo said, or the LSPDFR guys need to add an API function that tells us which agency the player selected. You could do it based on the ped model of the player too, I guess. But agency would be better...throw a request for that on the GitHub repo.

I don't have VS2013 in front of me right now to check, but I think OnOnDutyStateChanged only tells you when the player goes on/off duty, not what agency they are. Keep in mind that the PoliceAgency enum may be marked internal in a future release. Try and stick to stuff thats in the API namespace.

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!

 

I don't have VS2013 in front of me right now to check, but I think OnOnDutyStateChanged only tells you when the player goes on/off duty, not what agency they are. Keep in mind that the PoliceAgency enum may be marked internal in a future release. Try and stick to stuff thats in the API namespace.

You are correct, OnOnDutyStateChanged only gives you a bool to work with

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.